pass correct args to startDownloadProcess

This commit is contained in:
uncor3
2026-04-10 21:29:40 +00:00
parent 0dc0b0ffe9
commit 34af199f3f
3 changed files with 14 additions and 10 deletions
+1 -1
View File
@@ -123,5 +123,5 @@ void AppDownloadDialog::onDownloadClicked()
m_actionButton->deleteLater();
qDebug() << "Starting download to" << m_outputDir;
qDebug() << "Bundle ID:" << m_bundleId;
startDownloadProcess(m_bundleId, m_outputDir, buttonIndex);
startDownloadProcess(m_bundleId, m_outputDir, buttonIndex, true, true);
}
+1 -1
View File
@@ -262,7 +262,7 @@ void AppInstallDialog::onInstallClicked()
}
startDownloadProcess(m_bundleId, m_tempDir->path(), buttonIndex, false,
true);
false);
connect(
this, &AppDownloadBaseDialog::downloadFinished, this,
+12 -8
View File
@@ -69,13 +69,14 @@ void AppDownloadBaseDialog::startDownloadProcess(const QString &bundleId,
bool promptToOpenDir,
bool close)
{
if (bundleId.isEmpty()) {
QMessageBox::critical(this, "Error", "Bundle ID not provided.");
reject();
return;
}
m_tries = 0;
addProgressBar(index);
if (m_actionButton)
m_actionButton->setEnabled(false);
@@ -117,10 +118,12 @@ void AppDownloadBaseDialog::tryToDownload(const QString &bundleId,
return;
}
safeThis->m_operationInProgress = false;
if (result == 0) { // Success
if (result == 0) {
emit safeThis->downloadFinished(true, "Success");
if (safeThis->m_progressBar)
safeThis->m_progressBar->setValue(100);
if (promptToOpenDir) {
if (QMessageBox::Yes ==
@@ -141,19 +144,20 @@ void AppDownloadBaseDialog::tryToDownload(const QString &bundleId,
}
}
}
if (close)
safeThis->accept();
} else { // Failure
// 3 attempts
} else {
if (safeThis->m_tries < 3) {
safeThis->m_tries++;
qDebug()
<< "Retrying download for" + safeThis->m_bundleId +
"Attempt:" + QString::number(safeThis->m_tries);
qDebug() << "Retrying download for" << safeThis->m_bundleId
<< "Attempt:" << safeThis->m_tries;
safeThis->tryToDownload(safeThis->m_bundleId, outputDir,
promptToOpenDir);
promptToOpenDir, close);
return;
}
emit safeThis->downloadFinished(false, "Failed");
// if (promptToOpenDir)
QMessageBox::critical(