diff options
author | Jarek Kobus <[email protected]> | 2023-07-06 18:16:59 +0200 |
---|---|---|
committer | Jarek Kobus <[email protected]> | 2023-07-07 08:23:29 +0000 |
commit | 9f1b56e91aa34bb706bf2887d1cd06ca5d5ed376 (patch) | |
tree | fba6f83f71b6c8560a4a6e93ed8fea5ecd216e8b /src/plugins/debugger/debuggerplugin.cpp | |
parent | 714b5963f79570b5dc10eb62aeb65bc8bb7bb4b4 (diff) |
ProjectExplorerPlugin: Use expected_str for canRunStartupProject()
Change-Id: Iddc9abcb1b9ef02c6a8188d2eb82cc30a0ba4c22
Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 6156d40b34a..2390096a3fb 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1393,9 +1393,8 @@ void DebuggerPluginPrivate::updatePresetState() RunConfiguration *startupRunConfig = ProjectManager::startupRunConfiguration(); DebuggerEngine *currentEngine = EngineManager::currentEngine(); - QString whyNot; - const bool canRun = - ProjectExplorerPlugin::canRunStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE, &whyNot); + const auto canRun = ProjectExplorerPlugin::canRunStartupProject( + ProjectExplorer::Constants::DEBUG_RUN_MODE); QString startupRunConfigName; if (startupRunConfig) @@ -1404,8 +1403,8 @@ void DebuggerPluginPrivate::updatePresetState() startupRunConfigName = startupProject->displayName(); // Restrict width, otherwise Creator gets too wide, see QTCREATORBUG-21885 - const QString startToolTip = - canRun ? Tr::tr("Start debugging of startup project") : whyNot; + const QString startToolTip = canRun ? Tr::tr("Start debugging of startup project") + : canRun.error(); m_startAction.setToolTip(startToolTip); m_startAction.setText(Tr::tr("Start Debugging of Startup Project")); @@ -1413,11 +1412,11 @@ void DebuggerPluginPrivate::updatePresetState() if (!currentEngine) { // No engine running -- or -- we have a running engine but it does not // correspond to the current start up project. - m_startAction.setEnabled(canRun); + m_startAction.setEnabled(bool(canRun)); m_startAction.setIcon(startIcon(true)); m_startAction.setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_startAction.setVisible(true); - m_debugWithoutDeployAction.setEnabled(canRun); + m_debugWithoutDeployAction.setEnabled(bool(canRun)); m_visibleStartAction.setAction(&m_startAction); m_hiddenStopAction.setAction(&m_undisturbableAction); return; @@ -1431,7 +1430,7 @@ void DebuggerPluginPrivate::updatePresetState() m_startAction.setEnabled(false); m_startAction.setVisible(false); - m_debugWithoutDeployAction.setEnabled(canRun); + m_debugWithoutDeployAction.setEnabled(bool(canRun)); const DebuggerState state = currentEngine->state(); @@ -1449,8 +1448,8 @@ void DebuggerPluginPrivate::updatePresetState() m_hiddenStopAction.setAction(ActionManager::command(Constants::INTERRUPT)->action()); } else if (state == DebuggerFinished) { // We don't want to do anything anymore. - m_startAction.setEnabled(canRun); - m_debugWithoutDeployAction.setEnabled(canRun); + m_startAction.setEnabled(bool(canRun)); + m_debugWithoutDeployAction.setEnabled(bool(canRun)); m_visibleStartAction.setAction(ActionManager::command(DEBUGGER_START)->action()); m_hiddenStopAction.setAction(&m_undisturbableAction); } else if (state == InferiorUnrunnable) { |