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).