version 2.12.1
This commit is contained in:
@@ -12,26 +12,65 @@ extern QApplication a;
|
||||
// return true in case of error
|
||||
bool testRsyncReturn(MainWindow * w, QProcess * myProcess)
|
||||
{
|
||||
if (myProcess->exitStatus() != 0 and w->stopDlAsked != true)
|
||||
{
|
||||
cout << "rsync error: " << myProcess->error() << " : " << myProcess->errorString().toStdString() << endl;
|
||||
QMessageBox::warning(
|
||||
w,
|
||||
a.applicationName(),
|
||||
myProcess->errorString(),
|
||||
QMessageBox::Ok,
|
||||
QMessageBox::Ok);
|
||||
return true;
|
||||
}
|
||||
w->stopDlAsked = false;
|
||||
return false;
|
||||
if (myProcess->exitStatus() != 0 and w->stopDlAsked != true)
|
||||
{
|
||||
qInfo("rsync error %i : %s ", + myProcess->error(), myProcess->errorString().toStdString().c_str());
|
||||
QMessageBox::warning(
|
||||
w,
|
||||
a.applicationName(),
|
||||
rsyncErrorStrings[myProcess->error()],
|
||||
//myProcess->errorString(),
|
||||
QMessageBox::Ok,
|
||||
QMessageBox::Ok);
|
||||
return true;
|
||||
}
|
||||
w->stopDlAsked = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
QString getFileType(QString filename)
|
||||
{
|
||||
QMimeDatabase db;
|
||||
QMimeType mime = db.mimeTypeForFile(filename);
|
||||
QString returnValue = mime.name().section('/',0 ,0);
|
||||
return returnValue;
|
||||
QMimeDatabase db;
|
||||
QMimeType mime = db.mimeTypeForFile(filename);
|
||||
QString returnValue = mime.name().section('/',0 ,0);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
int whatIpVersion(QString ipAddress)
|
||||
{
|
||||
QStringList fieldList;
|
||||
ulong field;
|
||||
uint i;
|
||||
|
||||
qInfo("ipVersion %s", ipAddress.toStdString().c_str());
|
||||
|
||||
fieldList = ipAddress.split(":");
|
||||
if (fieldList.count() == 8)
|
||||
{
|
||||
for (i=0;i<8;i++)
|
||||
{
|
||||
field = fieldList[i].toUInt();
|
||||
if (field > 65535)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
qInfo("Address is Ip V6");
|
||||
return 6;
|
||||
}
|
||||
fieldList = ipAddress.split(".");
|
||||
if(fieldList.count() == 4)
|
||||
{
|
||||
for (i=0;i<4;i++)
|
||||
{
|
||||
field = fieldList[i].toUInt();
|
||||
if (field > 255)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
qInfo("Address is ip V4");
|
||||
return 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user