bug correction: when stopping a dl an error when prompted
This commit is contained in:
parent
f40e4f9485
commit
e10558ff5b
@ -983,7 +983,7 @@ void MainWindow::downloadFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
||||
tr("Rsync process crashed"));
|
||||
}
|
||||
//test result code of command (if 20 then command stopped by user)
|
||||
if (exitCode != 0)
|
||||
if (exitCode != 0 and this->stopDlAsked != true)
|
||||
{
|
||||
if (exitCode == 20)
|
||||
{
|
||||
@ -1006,7 +1006,7 @@ void MainWindow::downloadFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
||||
retry = true;
|
||||
}
|
||||
}
|
||||
|
||||
this->stopDlAsked = false;
|
||||
this->trayIcon->showMessage(a.applicationName(), tr("Download ") + aborted + "\n" + this->downloading.path, QSystemTrayIcon::Information);
|
||||
|
||||
// disconnecting signals to slots
|
||||
@ -1080,6 +1080,7 @@ void MainWindow::on_listDownload_itemClicked(QListWidgetItem *item)
|
||||
if (reply == QMessageBox::Yes)
|
||||
{
|
||||
// stopping download
|
||||
this->stopDlAsked = true;
|
||||
emit (stopDownloading(this->downloading.process));
|
||||
}
|
||||
}else
|
||||
@ -1096,7 +1097,6 @@ void MainWindow::on_listDownload_itemClicked(QListWidgetItem *item)
|
||||
// removing line from download list
|
||||
ui->listDownload->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
}
|
||||
}
|
||||
if (config.autosaveCheckbox->checkState() == Qt::Checked)
|
||||
|
@ -120,6 +120,7 @@ class MainWindow : public QMainWindow
|
||||
QSystemTrayIcon * trayIcon;
|
||||
QString icon = "/usr/share/icons/RsyncUI.png";
|
||||
bool rescan = false;
|
||||
bool stopDlAsked;
|
||||
|
||||
QList<QString> UnitText {
|
||||
tr("B"),
|
||||
|
@ -48,7 +48,7 @@ const vector<string> explode(const string& s, const char& c, int n = 0)
|
||||
// return true in case of error
|
||||
bool testRsyncReturn(MainWindow * w, QProcess * myProcess)
|
||||
{
|
||||
if (myProcess->exitStatus() != 0)
|
||||
if (myProcess->exitStatus() != 0 and w->stopDlAsked != true)
|
||||
{
|
||||
QMessageBox::warning(
|
||||
w,
|
||||
@ -58,6 +58,7 @@ bool testRsyncReturn(MainWindow * w, QProcess * myProcess)
|
||||
QMessageBox::Ok);
|
||||
return true;
|
||||
}
|
||||
w->stopDlAsked = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user