38 lines
941 B
C++
38 lines
941 B
C++
#include "mainwindow.h"
|
|
|
|
using namespace std;
|
|
|
|
#define READ 0
|
|
#define WRITE 1
|
|
|
|
extern QMap<int, QString> rsyncErrorStrings;
|
|
extern QApplication a;
|
|
|
|
// test return code of rsync
|
|
// 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;
|
|
}
|
|
|
|
QString getFileType(QString filename)
|
|
{
|
|
QMimeDatabase db;
|
|
QMimeType mime = db.mimeTypeForFile(filename);
|
|
QString returnValue = mime.name().section('/',0 ,0);
|
|
return returnValue;
|
|
}
|
|
|