Commit 72b925d1 authored by Igor Kushnir's avatar Igor Kushnir Committed by Nicolás Alvarez
Browse files

Save user-selected current launch configuration

RunControllerPrivate::updateCurrentLaunchAction() reads the launch
configuration stored by RunControllerPrivate::saveCurrentLaunchAction()
and makes it current. updateCurrentLaunchAction() is called when a
project is opened or a project's configuration is changed.
saveCurrentLaunchAction() is called only in RunController::cleanup() at
KDevelop exit. When a user changes the current launch configuration,
then configures or opens a project, updateCurrentLaunchAction() reverts
the current launch configuration to the configuration stored in KConfig,
that is, to the one that was current at KDevelop start.

Save the current launch configuration selected by the user to prevent
these confusing and annoying automatic changes. The
KSelectAction::triggered signal is not emitted when the current action
is changed via QAction::setChecked(), hence saveCurrentLaunchAction() is
now called only when the user explicitly selects the current launch
configuration.

Keep the call to saveCurrentLaunchAction() in RunController::cleanup()
even though it is no longer necessary. RunController::cleanup() is
called before ProjectController::cleanup(), therefore the currently
saved current launch configuration is re-saved at exit most of the time.
But if the user closes the saved current launch configuration's project
before exiting KDevelop, the first element in the remaining launch
configuration list is saved as current at KDevelop exit. This is
reasonable because the no longer available launch configuration should
not remain saved as current (otherwise confusing to the user automatic
current launch configuration changes can occur).
parent a4e97dce
Pipeline #95977 passed with stage
in 34 minutes and 6 seconds
......@@ -483,6 +483,7 @@ void RunController::setupActions()
d->currentTargetAction = new KSelectAction( i18nc("@title:menu", "Current Launch Configuration"), this);
d->currentTargetAction->setToolTip(i18nc("@info:tooltip", "Current launch configuration"));
d->currentTargetAction->setWhatsThis(i18nc("@info:whatsthis", "Select which launch configuration to run when run is invoked."));
connect(d->currentTargetAction, qOverload<QAction*>(&KSelectAction::triggered), this, [d] { d->saveCurrentLaunchAction(); });
ac->addAction(QStringLiteral("run_default_target"), d->currentTargetAction);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment