UpdateInfo: Fix wrong properties for progress info

It was no longer showing "No updates found." in the status bar if the
progress details are off, and the progress details were no longer
directly hidden if updates were found.

Amends 93401c9c81

Change-Id: I53c441a990c9cbda1a49969f57eb76128ab020c1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Eike Ziller
2022-11-25 10:36:10 +01:00
parent 2605639144
commit a0e74ce3e0

View File

@@ -124,14 +124,13 @@ void UpdateInfoPlugin::startCheckForUpdates()
return; // do not trigger while update task is already running return; // do not trigger while update task is already running
QFutureInterface<void> futureIf; QFutureInterface<void> futureIf;
FutureProgress *futureProgress d->m_progress = ProgressManager::addTimedTask(futureIf,
= ProgressManager::addTimedTask(futureIf,
tr("Checking for Updates"), tr("Checking for Updates"),
Id("UpdateInfo.CheckingForUpdates"), Id("UpdateInfo.CheckingForUpdates"),
60); 60);
futureProgress->setKeepOnFinish(FutureProgress::KeepOnFinishTillUserInteraction); d->m_progress->setKeepOnFinish(FutureProgress::KeepOnFinishTillUserInteraction);
futureProgress->setSubtitleVisibleInStatusBar(true); d->m_progress->setSubtitleVisibleInStatusBar(true);
connect(futureProgress, &FutureProgress::canceled, this, [this, futureIf]() mutable { connect(d->m_progress, &FutureProgress::canceled, this, [this, futureIf]() mutable {
futureIf.reportCanceled(); futureIf.reportCanceled();
futureIf.reportFinished(); futureIf.reportFinished();
stopCheckForUpdates(); stopCheckForUpdates();