ProjectExplorerPlugin: Use expected_str for canRunStartupProject()

Change-Id: Iddc9abcb1b9ef02c6a8188d2eb82cc30a0ba4c22
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2023-07-06 18:16:59 +02:00
parent 714b5963f7
commit 9f1b56e91a
7 changed files with 58 additions and 80 deletions

View File

@@ -770,10 +770,10 @@ void CallgrindToolPrivate::updateRunActions()
m_startAction->setToolTip(Tr::tr("A Valgrind Callgrind analysis is still in progress."));
m_stopAction->setEnabled(true);
} else {
QString whyNot = Tr::tr("Start a Valgrind Callgrind analysis.");
bool canRun = ProjectExplorerPlugin::canRunStartupProject(CALLGRIND_RUN_MODE, &whyNot);
m_startAction->setToolTip(whyNot);
m_startAction->setEnabled(canRun);
const auto canRun = ProjectExplorerPlugin::canRunStartupProject(CALLGRIND_RUN_MODE);
m_startAction->setToolTip(canRun ? Tr::tr("Start a Valgrind Callgrind analysis.")
: canRun.error());
m_startAction->setEnabled(bool(canRun));
m_stopAction->setEnabled(false);
}
}