forked from qt-creator/qt-creator
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: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -580,13 +580,16 @@ QAction *AnalyzerManagerPrivate::actionFromToolAndMode(IAnalyzerTool *tool, Star
|
|||||||
void AnalyzerManagerPrivate::selectSavedTool()
|
void AnalyzerManagerPrivate::selectSavedTool()
|
||||||
{
|
{
|
||||||
const QSettings *settings = ICore::settings();
|
const QSettings *settings = ICore::settings();
|
||||||
const Id lastActiveAction(settings->value(QLatin1String(LAST_ACTIVE_TOOL)).toString());
|
|
||||||
foreach (QAction *action, m_actions) {
|
if (settings->contains(QLatin1String(LAST_ACTIVE_TOOL))) {
|
||||||
IAnalyzerTool *tool = m_toolFromAction.value(action);
|
const Id lastActiveAction(settings->value(QLatin1String(LAST_ACTIVE_TOOL)).toString());
|
||||||
StartMode mode = m_modeFromAction.value(action);
|
foreach (QAction *action, m_actions) {
|
||||||
if (tool->actionId(mode) == lastActiveAction) {
|
IAnalyzerTool *tool = m_toolFromAction.value(action);
|
||||||
selectTool(tool, mode);
|
StartMode mode = m_modeFromAction.value(action);
|
||||||
return;
|
if (tool->actionId(mode) == lastActiveAction) {
|
||||||
|
selectTool(tool, mode);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fallback to first available tool
|
// fallback to first available tool
|
||||||
|
|||||||
Reference in New Issue
Block a user