bug resolved

This commit is contained in:
2023-05-01 14:27:20 +02:00
parent c811f3db4f
commit f882ca5e42
6 changed files with 67 additions and 115 deletions
-36
View File
@@ -8,42 +8,6 @@ using namespace std;
extern QMap<int, QString> rsyncErrorStrings;
extern QApplication a;
//Take a string and explode it in array
// s => string to explode
// c => character separator
// n => number of results in array, the last is the rest of string to end
const vector<string> explode(const string& s, const char& c, int n = 0)
{
string buff;
vector<string> v;
size_t pos = 0;
size_t ppos = 0;
int i = 0;
while (i < n - 1)
{
pos = s.find(c, ppos);
if (pos != string::npos)
{
buff = s.substr(ppos, pos - ppos);
if (buff != "")
{
i++;
v.push_back(s.substr(ppos, pos - ppos));
}
ppos = pos + 1;
}else
{
break;
}
}
if (ppos < s.size())
{
v.push_back(s.substr(ppos));
}
return v;
}
// test return code of rsync
// return true in case of error
bool testRsyncReturn(MainWindow * w, QProcess * myProcess)