diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-01-22 18:49:06 +0100 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2016-01-22 17:56:42 +0000 |
commit | 938d1cd44b4af756094284609f3b7b6b87d59570 (patch) | |
tree | 6eb3e4c2d50aec956103d564d361ea23f48baec5 | |
parent | ed96957714f7e26cdcac988abacebc697412b792 (diff) |
Avoid starting tools without projects
This leads to crashes when the tools expect RunConfigurations.
Change-Id: I4960e7d189d92b6e81d4e5c069634c9111405e72
Reviewed-by: hjk <hjk@theqtcompany.com>
-rw-r--r-- | src/plugins/analyzerbase/ianalyzertool.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/analyzerbase/ianalyzertool.cpp b/src/plugins/analyzerbase/ianalyzertool.cpp index 93c22d0e13..6580fc80c8 100644 --- a/src/plugins/analyzerbase/ianalyzertool.cpp +++ b/src/plugins/analyzerbase/ianalyzertool.cpp @@ -104,7 +104,19 @@ void AnalyzerAction::startTool() // Custom start. if (m_customToolStarter) { - m_customToolStarter(rc); + if (rc) { + m_customToolStarter(rc); + } else { + const QString toolName = text(); + QMessageBox *errorDialog = new QMessageBox(ICore::mainWindow()); + errorDialog->setIcon(QMessageBox::Warning); + errorDialog->setWindowTitle(toolName); + errorDialog->setText(tr("Cannot start %1 without a project. Please open the project " + "and try again.").arg(toolName)); + errorDialog->setStandardButtons(QMessageBox::Ok); + errorDialog->setDefaultButton(QMessageBox::Ok); + errorDialog->show(); + } return; } |