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

@@ -276,11 +276,11 @@ void QmlProfilerTool::updateRunActions()
d->m_startAction->setToolTip(Tr::tr("A QML Profiler analysis is still in progress."));
d->m_stopAction->setEnabled(true);
} else {
QString tooltip = Tr::tr("Start QML Profiler analysis.");
bool canRun = ProjectExplorerPlugin::canRunStartupProject
(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, &tooltip);
d->m_startAction->setToolTip(tooltip);
d->m_startAction->setEnabled(canRun);
const auto canRun = ProjectExplorerPlugin::canRunStartupProject(
ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
d->m_startAction->setToolTip(canRun ? Tr::tr("Start QML Profiler analysis.")
: canRun.error());
d->m_startAction->setEnabled(bool(canRun));
d->m_stopAction->setEnabled(false);
}
}