mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-29 20:30:54 +00:00
Fixed: Infinite loop when clicking on OK in profiles dialog, see #279
--HG-- branch : develop
This commit is contained in:
parent
32f682d5dc
commit
5050a2bfa0
2 changed files with 24 additions and 4 deletions
|
@ -92,7 +92,7 @@ void COperationDialog::processNextStep()
|
|||
{
|
||||
if (operationShouldStop())
|
||||
{
|
||||
reject();
|
||||
rejectDelayed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ void COperationDialog::processInstallNextStep()
|
|||
break;
|
||||
|
||||
case Done:
|
||||
accept();
|
||||
acceptDelayed();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -253,6 +253,8 @@ void COperationDialog::updateAddRemoveComponents()
|
|||
|
||||
void COperationDialog::processUpdateProfilesNextStep()
|
||||
{
|
||||
m_currentOperation = tr("Update profiles");
|
||||
|
||||
// for "update profiles" operations, we set installer to false when components are updated,
|
||||
// since we're not using this variable
|
||||
if (m_addComponents.installer && m_removeComponents.installer)
|
||||
|
@ -344,6 +346,8 @@ void COperationDialog::processUpdateProfilesNextStep()
|
|||
}
|
||||
|
||||
updateAddRemoveEntry();
|
||||
|
||||
acceptDelayed();
|
||||
}
|
||||
|
||||
void COperationDialog::processUninstallNextStep()
|
||||
|
@ -369,7 +373,7 @@ void COperationDialog::processUninstallNextStep()
|
|||
else
|
||||
{
|
||||
// done
|
||||
accept();
|
||||
acceptDelayed();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -460,7 +464,7 @@ void COperationDialog::onProgressStop()
|
|||
m_button->progress()->hide();
|
||||
#endif
|
||||
|
||||
reject();
|
||||
rejectDelayed();
|
||||
}
|
||||
|
||||
void COperationDialog::onProgressProgress(qint64 current, const QString &filename)
|
||||
|
@ -1247,3 +1251,15 @@ void COperationDialog::renamePartFile()
|
|||
QFile::rename(partFile, finalFile);
|
||||
}
|
||||
}
|
||||
|
||||
void COperationDialog::acceptDelayed()
|
||||
{
|
||||
// wait 500ms before to call accept()
|
||||
QTimer::singleShot(500, this, SLOT(accept()));
|
||||
}
|
||||
|
||||
void COperationDialog::rejectDelayed()
|
||||
{
|
||||
// wait 500ms before to call reject()
|
||||
QTimer::singleShot(500, this, SLOT(reject()));
|
||||
}
|
||||
|
|
|
@ -133,6 +133,10 @@ protected:
|
|||
|
||||
void renamePartFile();
|
||||
|
||||
// hacks to prevent an infinite loop
|
||||
void acceptDelayed();
|
||||
void rejectDelayed();
|
||||
|
||||
QWinTaskbarButton *m_button;
|
||||
CDownloader *m_downloader;
|
||||
|
||||
|
|
Loading…
Reference in a new issue