- corrigé bug a la saisie du serveur\n- corrigé bug si adresse serveur vide

This commit is contained in:
2024-08-22 23:08:42 +02:00
parent ec38ce4ec3
commit 3396fde813
17 changed files with 1668 additions and 990 deletions
+49 -5
View File
@@ -1,4 +1,6 @@
#include "mainwindow.h"
#include "tools.h"
#include "password.h"
using namespace std;
@@ -12,18 +14,33 @@ extern QApplication a;
// return true in case of error
bool testRsyncReturn(MainWindow * w, QProcess * myProcess)
{
info(DEBUGMACRO, "testRsyncReturn()");
info(DEBUGMACRO, "Exit status: " + QString::number(myProcess->exitStatus()));
info(DEBUGMACRO, "Exit code: " + QString::number(myProcess->exitCode()));
if (myProcess->exitStatus() != 0 and w->stopDlAsked != true)
{
qInfo("rsync error %i : %s ", + myProcess->error(), myProcess->errorString().toStdString().c_str());
info(DEBUGMACRO, "rsync error " + myProcess->errorString());
QMessageBox::warning(
w,
a.applicationName(),
rsyncErrorStrings[myProcess->error()],
QTranslator::tr("Rsync error:\n") + rsyncErrorStrings[myProcess->error()],
//myProcess->errorString(),
QMessageBox::Ok,
QMessageBox::Ok);
return true;
}
if(myProcess->exitCode() != 0)
{
info(DEBUGMACRO, "rsync error " + myProcess->errorString());
QMessageBox::warning(
w,
a.applicationName(),
QTranslator::tr("Rsync error:\n") + rsyncErrorStrings[myProcess->exitCode()],
QMessageBox::Ok,
QMessageBox::Ok);
return true;
}
w->stopDlAsked = false;
return false;
}
@@ -42,7 +59,7 @@ int whatIpVersion(QString ipAddress)
ulong field;
uint i;
qInfo("ipVersion %s", ipAddress.toStdString().c_str());
info(DEBUGMACRO, "ipVersion of server at " + ipAddress);
fieldList = ipAddress.split(":");
if (fieldList.count() == 8)
@@ -55,7 +72,7 @@ int whatIpVersion(QString ipAddress)
return 0;
}
}
qInfo("Address is Ip V6");
info(DEBUGMACRO, "Address is Ip V6");
return 6;
}
fieldList = ipAddress.split(".");
@@ -69,8 +86,35 @@ int whatIpVersion(QString ipAddress)
return 0;
}
}
qInfo("Address is ip V4");
info(DEBUGMACRO, "Address is ip V4");
return 4;
}
return 0;
}
void warning(QString message)
{
QMessageBox::warning(
NULL,
a.applicationName() + "",
message,
QMessageBox::Ok,
QMessageBox::Ok);
}
void error(QString message)
{
QMessageBox::warning(
NULL,
a.applicationName() + ":" + QTranslator::tr("Error"),
message,
QMessageBox::Ok,
QMessageBox::Ok);
}
void info(QString debugHeader, QString message)
{
qInfo("%s %s", debugHeader.toStdString().c_str(), message.toStdString().c_str());
}
//void error()