summaryrefslogtreecommitdiff
path: root/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@nokia.com>2012-03-06 13:14:42 +0100
committerhjk <qthjk@ovi.com>2012-03-09 15:28:28 +0100
commit6f45ec97f8c25fe94afbbd58380d9847b25c1462 (patch)
tree93dc4effd70575a9036798b176f5950f2c91d985 /src/plugins/qtsupport/gettingstartedwelcomepage.cpp
parent4415224f993db41f3d0be75c52df3ee9dfcbddf4 (diff)
downloadqt-creator-6f45ec97f8c25fe94afbbd58380d9847b25c1462.tar.gz
Automatically configure examples opened from the welcome page.
Each example can now provide a list of platforms by the examples manifest .xml file. This list can control the target configuration of the example when it is opened in the welcomepage. Change-Id: I893230fd2850b7a1272db71a7f589044d52041d1 Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/qtsupport/gettingstartedwelcomepage.cpp')
-rw-r--r--src/plugins/qtsupport/gettingstartedwelcomepage.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
index 496094ee92..1b49f3fd70 100644
--- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
+++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
@@ -44,6 +44,9 @@
#include <coreplugin/icore.h>
#include <coreplugin/helpmanager.h>
#include <projectexplorer/projectexplorer.h>
+#include <projectexplorer/session.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/projectnodes.h>
#include <QMutex>
#include <QThread>
@@ -389,7 +392,7 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
}
void ExamplesWelcomePage::openProject(const QString &projectFile, const QStringList &additionalFilesToOpen,
- const QUrl &help, const QStringList &dependencies)
+ const QUrl &help, const QStringList &dependencies, const QStringList &platforms)
{
QString proFile = projectFile;
if (proFile.isEmpty())
@@ -403,12 +406,24 @@ 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;
- if (!proFile.isEmpty() && ProjectExplorer::ProjectExplorerPlugin::instance()->openProject(proFile, &errorMessage)) {
+ ProjectExplorer::ProjectExplorerPlugin *peplugin = ProjectExplorer::ProjectExplorerPlugin::instance();
+ if (!proFile.isEmpty() && peplugin->openProject(proFile, &errorMessage)) {
Core::ICore::openFiles(filesToOpen);
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()