forked from qt-creator/qt-creator
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:
@@ -439,7 +439,11 @@ FutureProgress *ProgressManagerPrivate::doAddTask(const QFuture<void> &future, c
|
|||||||
progress->setKeepOnFinish(FutureProgress::HideOnFinish);
|
progress->setKeepOnFinish(FutureProgress::HideOnFinish);
|
||||||
connect(progress, &FutureProgress::hasErrorChanged,
|
connect(progress, &FutureProgress::hasErrorChanged,
|
||||||
this, &ProgressManagerPrivate::updateSummaryProgressBar);
|
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,
|
connect(progress, &FutureProgress::fadeStarted,
|
||||||
this, &ProgressManagerPrivate::updateSummaryProgressBar);
|
this, &ProgressManagerPrivate::updateSummaryProgressBar);
|
||||||
connect(progress, &FutureProgress::statusBarWidgetChanged,
|
connect(progress, &FutureProgress::statusBarWidgetChanged,
|
||||||
@@ -548,15 +552,6 @@ bool ProgressManagerPrivate::isLastFading() const
|
|||||||
return true;
|
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)
|
void ProgressManagerPrivate::removeOldTasks(const Id type, bool keepOne)
|
||||||
{
|
{
|
||||||
bool firstFound = !keepOne; // start with false if we want to keep one
|
bool firstFound = !keepOne; // start with false if we want to keep one
|
||||||
|
@@ -81,7 +81,6 @@ private:
|
|||||||
void updateVisibilityWithDelay();
|
void updateVisibilityWithDelay();
|
||||||
void updateStatusDetailsWidget();
|
void updateStatusDetailsWidget();
|
||||||
|
|
||||||
void slotRemoveTask();
|
|
||||||
void readSettings();
|
void readSettings();
|
||||||
void initInternal();
|
void initInternal();
|
||||||
void stopFadeOfSummaryProgress();
|
void stopFadeOfSummaryProgress();
|
||||||
|
Reference in New Issue
Block a user