summaryrefslogtreecommitdiff
path: root/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@nokia.com>2012-03-21 11:12:11 +0100
committerEike Ziller <eike.ziller@nokia.com>2012-03-21 11:31:50 +0100
commitdffbc4407a2cce7cc56b305fe29a3e0d9f2e10d4 (patch)
treec1dc2e8ba244e88c02498faca1e27c385734d223 /src/plugins/qtsupport/gettingstartedwelcomepage.cpp
parentd3e25481f94baee22cc8ec537804ddd9e4d80a4e (diff)
downloadqt-creator-dffbc4407a2cce7cc56b305fe29a3e0d9f2e10d4.tar.gz
Examples: Fix showing documentation in side bar.
Opening the project jumped to project mode, which doesn't have a help side bar. We now configure the example project and jump to edit mode before opening the documentation. Change-Id: Ic87d3fd0856862ac9297d43307037f994664acdc Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Diffstat (limited to 'src/plugins/qtsupport/gettingstartedwelcomepage.cpp')
-rw-r--r--src/plugins/qtsupport/gettingstartedwelcomepage.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
index 3f347cb3bc..0aae708872 100644
--- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
+++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
@@ -40,9 +40,11 @@
#include <utils/pathchooser.h>
#include <utils/fileutils.h>
+#include <coreplugin/coreconstants.h>
#include <coreplugin/coreplugin.h>
#include <coreplugin/icore.h>
#include <coreplugin/helpmanager.h>
+#include <coreplugin/modemanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/project.h>
@@ -406,23 +408,17 @@ void ExamplesWelcomePage::openProject(const QString &projectFile, const QStringL
// don't try to load help and files if loading the help request is being cancelled
QString errorMessage;
ProjectExplorer::ProjectExplorerPlugin *peplugin = ProjectExplorer::ProjectExplorerPlugin::instance();
- if (!proFile.isEmpty() && peplugin->openProject(proFile, &errorMessage)) {
+ if (proFile.isEmpty())
+ return;
+ if (ProjectExplorer::Project *project = peplugin->openProject(proFile, &errorMessage)) {
Core::ICore::openFiles(filesToOpen);
+ if (project->needsConfiguration())
+ project->configureAsExampleProject(platforms);
+ Core::ModeManager::activateModeType(QLatin1String(Core::Constants::MODE_EDIT_TYPE));
Core::ICore::helpManager()->handleHelpRequest(help.toString()+QLatin1String("?view=split"));
}
if (!errorMessage.isEmpty())
QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to open project"), errorMessage);
- // Configure project for building
- ProjectExplorer::Project *project = 0;
- foreach (ProjectExplorer::Project *pro, peplugin->session()->projects()) {
- if (pro->rootProjectNode()->path() == proFile) {
- project = pro;
- break;
- }
- }
- if (project && project->needsConfiguration())
- project->configureAsExampleProject(platforms);
-
}
void ExamplesWelcomePage::updateTagsModel()