Commit ba71b3e9 authored by Kai Koehne's avatar Kai Koehne Committed by hjk

Analyzer: Fix soft assert on startup

Fix "SOFT ASSERT: str && *str" when using the analyzer for the
first time / with nuked settings.

Change-Id: Id6f0fc8031fc8d8a24d6d4c0badfbfbdc98974a9
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 0a556c2f
......@@ -580,13 +580,16 @@ QAction *AnalyzerManagerPrivate::actionFromToolAndMode(IAnalyzerTool *tool, Star
void AnalyzerManagerPrivate::selectSavedTool()
{
const QSettings *settings = ICore::settings();
const Id lastActiveAction(settings->value(QLatin1String(LAST_ACTIVE_TOOL)).toString());
foreach (QAction *action, m_actions) {
IAnalyzerTool *tool = m_toolFromAction.value(action);
StartMode mode = m_modeFromAction.value(action);
if (tool->actionId(mode) == lastActiveAction) {
selectTool(tool, mode);
return;
if (settings->contains(QLatin1String(LAST_ACTIVE_TOOL))) {
const Id lastActiveAction(settings->value(QLatin1String(LAST_ACTIVE_TOOL)).toString());
foreach (QAction *action, m_actions) {
IAnalyzerTool *tool = m_toolFromAction.value(action);
StartMode mode = m_modeFromAction.value(action);
if (tool->actionId(mode) == lastActiveAction) {
selectTool(tool, mode);
return;
}
}
}
// fallback to first available tool
......
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