ProgressManager: Avoid using sender()

Change-Id: Ifb28b5b3d95e99c29e2a9b76a5fd73279a96f92f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-07-19 16:17:08 +02:00
parent 60a5f77ef2
commit 697df89178
2 changed files with 5 additions and 11 deletions

View File

@@ -439,7 +439,11 @@ FutureProgress *ProgressManagerPrivate::doAddTask(const QFuture<void> &future, c
progress->setKeepOnFinish(FutureProgress::HideOnFinish);
connect(progress, &FutureProgress::hasErrorChanged,
this, &ProgressManagerPrivate::updateSummaryProgressBar);
connect(progress, &FutureProgress::removeMe, this, &ProgressManagerPrivate::slotRemoveTask);
connect(progress, &FutureProgress::removeMe, this, [this, progress] {
const Id type = progress->type();
removeTask(progress);
removeOldTasks(type, true);
});
connect(progress, &FutureProgress::fadeStarted,
this, &ProgressManagerPrivate::updateSummaryProgressBar);
connect(progress, &FutureProgress::statusBarWidgetChanged,
@@ -548,15 +552,6 @@ bool ProgressManagerPrivate::isLastFading() const
return true;
}
void ProgressManagerPrivate::slotRemoveTask()
{
auto progress = qobject_cast<FutureProgress *>(sender());
QTC_ASSERT(progress, return);
Id type = progress->type();
removeTask(progress);
removeOldTasks(type, true);
}
void ProgressManagerPrivate::removeOldTasks(const Id type, bool keepOne)
{
bool firstFound = !keepOne; // start with false if we want to keep one

View File

@@ -81,7 +81,6 @@ private:
void updateVisibilityWithDelay();
void updateStatusDetailsWidget();
void slotRemoveTask();
void readSettings();
void initInternal();
void stopFadeOfSummaryProgress();