forked from qt-creator/qt-creator
QMakeProjectManager: Do not ask to rebuild too often
Due to the incomplete aspectification here, some of the connections are set up in createConfigWidget(). Config widgets are created and destroyed when the build configuration changes, and connections that did not directly depend on the widget or subwidgets accumulated. Use the the created widget as guard object to ensure connections live only as long as the widget. Task-number: QTCREATORBUG-24725 Change-Id: I4581f98e684ac92fd43ceba598d391c4dc8dbebe Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -81,6 +81,17 @@ QMakeStep::QMakeStep(BuildStepList *bsl, Utils::Id id)
|
|||||||
: AbstractProcessStep(bsl, id)
|
: AbstractProcessStep(bsl, id)
|
||||||
{
|
{
|
||||||
setLowPriority();
|
setLowPriority();
|
||||||
|
|
||||||
|
auto updateSummary = [this] {
|
||||||
|
BaseQtVersion *qtVersion = QtKitAspect::qtVersion(target()->kit());
|
||||||
|
if (!qtVersion)
|
||||||
|
return tr("<b>qmake:</b> No Qt version set. Cannot run qmake.");
|
||||||
|
const QString program = qtVersion->qmakeCommand().fileName();
|
||||||
|
return tr("<b>qmake:</b> %1 %2").arg(program, project()->projectFilePath().fileName());
|
||||||
|
};
|
||||||
|
setSummaryUpdater(updateSummary);
|
||||||
|
|
||||||
|
connect(target(), &Target::kitChanged, this, updateSummary);
|
||||||
}
|
}
|
||||||
|
|
||||||
QmakeBuildConfiguration *QMakeStep::qmakeBuildConfiguration() const
|
QmakeBuildConfiguration *QMakeStep::qmakeBuildConfiguration() const
|
||||||
@@ -540,15 +551,6 @@ BuildStepConfigWidget *QMakeStep::createConfigWidget()
|
|||||||
|
|
||||||
qmakeBuildConfigChanged();
|
qmakeBuildConfigChanged();
|
||||||
|
|
||||||
auto updateSummary = [this] {
|
|
||||||
BaseQtVersion *qtVersion = QtKitAspect::qtVersion(target()->kit());
|
|
||||||
if (!qtVersion)
|
|
||||||
return tr("<b>qmake:</b> No Qt version set. Cannot run qmake.");
|
|
||||||
const QString program = qtVersion->qmakeCommand().fileName();
|
|
||||||
return tr("<b>qmake:</b> %1 %2").arg(program, project()->projectFilePath().fileName());
|
|
||||||
};
|
|
||||||
setSummaryUpdater(updateSummary);
|
|
||||||
|
|
||||||
updateSummary();
|
updateSummary();
|
||||||
updateAbiWidgets();
|
updateAbiWidgets();
|
||||||
updateEffectiveQMakeCall();
|
updateEffectiveQMakeCall();
|
||||||
@@ -557,23 +559,26 @@ BuildStepConfigWidget *QMakeStep::createConfigWidget()
|
|||||||
this, &QMakeStep::qmakeArgumentsLineEdited);
|
this, &QMakeStep::qmakeArgumentsLineEdited);
|
||||||
connect(buildConfigurationComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
connect(buildConfigurationComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, &QMakeStep::buildConfigurationSelected);
|
this, &QMakeStep::buildConfigurationSelected);
|
||||||
|
|
||||||
connect(qmakeBuildConfiguration(), &QmakeBuildConfiguration::qmlDebuggingChanged,
|
connect(qmakeBuildConfiguration(), &QmakeBuildConfiguration::qmlDebuggingChanged,
|
||||||
this, [this] {
|
widget, [this] {
|
||||||
linkQmlDebuggingLibraryChanged();
|
linkQmlDebuggingLibraryChanged();
|
||||||
askForRebuild(tr("QML Debugging"));
|
askForRebuild(tr("QML Debugging"));
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(project(), &Project::projectLanguagesUpdated,
|
connect(project(), &Project::projectLanguagesUpdated,
|
||||||
this, &QMakeStep::linkQmlDebuggingLibraryChanged);
|
widget, [this] { linkQmlDebuggingLibraryChanged(); });
|
||||||
connect(target(), &Target::parsingFinished,
|
connect(target(), &Target::parsingFinished,
|
||||||
qmakeArgumentsEdit, [this]() { updateEffectiveQMakeCall(); });
|
widget, [this] { updateEffectiveQMakeCall(); });
|
||||||
connect(qmakeBuildConfiguration(), &QmakeBuildConfiguration::useQtQuickCompilerChanged,
|
connect(qmakeBuildConfiguration(), &QmakeBuildConfiguration::useQtQuickCompilerChanged,
|
||||||
this, &QMakeStep::useQtQuickCompilerChanged);
|
widget, [this] { useQtQuickCompilerChanged(); });
|
||||||
connect(qmakeBuildConfiguration(), &QmakeBuildConfiguration::separateDebugInfoChanged,
|
connect(qmakeBuildConfiguration(), &QmakeBuildConfiguration::separateDebugInfoChanged,
|
||||||
this, &QMakeStep::separateDebugInfoChanged);
|
widget, [this] { separateDebugInfoChanged(); });
|
||||||
connect(qmakeBuildConfiguration(), &QmakeBuildConfiguration::qmakeBuildConfigurationChanged,
|
connect(qmakeBuildConfiguration(), &QmakeBuildConfiguration::qmakeBuildConfigurationChanged,
|
||||||
this, &QMakeStep::qmakeBuildConfigChanged);
|
widget, [this] { qmakeBuildConfigChanged(); });
|
||||||
connect(target(), &Target::kitChanged, this, &QMakeStep::qtVersionChanged);
|
connect(target(), &Target::kitChanged,
|
||||||
connect(target(), &Target::kitChanged, this, updateSummary);
|
widget, [this] { qtVersionChanged(); });
|
||||||
|
|
||||||
connect(abisListWidget, &QListWidget::itemChanged, this, [this] {
|
connect(abisListWidget, &QListWidget::itemChanged, this, [this] {
|
||||||
abisChanged();
|
abisChanged();
|
||||||
if (QmakeBuildConfiguration *bc = qmakeBuildConfiguration())
|
if (QmakeBuildConfiguration *bc = qmakeBuildConfiguration())
|
||||||
|
|||||||
Reference in New Issue
Block a user