From 9b688d0ac79a89846daf4d63289f2833a869c50c Mon Sep 17 00:00:00 2001
From: Eike Ziller <eike.ziller@digia.com>
Date: Mon, 25 Mar 2013 11:24:00 +0100
Subject: [PATCH] Remove dependency of welcome plugin to project explorer.

The project explorer calls from welcome plugin were only used by the
project explorer provided welcome page anyhow.

Change-Id: I9fc0c6a2013c5b822a42efd13a9aa779e9d6f1a4
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
---
 share/qtcreator/welcomescreen/develop.qml         |  4 ++--
 src/plugins/plugins.pro                           |  1 -
 .../projectexplorer/projectwelcomepage.cpp        | 13 +++++++++++++
 src/plugins/projectexplorer/projectwelcomepage.h  |  5 +++++
 src/plugins/welcome/welcome_dependencies.pri      |  1 -
 src/plugins/welcome/welcomeplugin.cpp             | 15 +--------------
 6 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/share/qtcreator/welcomescreen/develop.qml b/share/qtcreator/welcomescreen/develop.qml
index 9646da98e69..c8f05a62688 100644
--- a/share/qtcreator/welcomescreen/develop.qml
+++ b/share/qtcreator/welcomescreen/develop.qml
@@ -145,7 +145,7 @@ Rectangle {
                 x: 51
                 y: 45
                 text: qsTr("Open Project")
-                onClicked: welcomeMode.openProject();
+                onClicked: projectWelcomePage.openProject();
             }
 
             LinkedText {
@@ -153,7 +153,7 @@ Rectangle {
                 x: 51
                 y: 13
                 text: qsTr("Create Project")
-                onClicked: welcomeMode.newProject();
+                onClicked: projectWelcomePage.newProject();
             }
 
             Image {
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 49b816b8f49..a6cba4d4993 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -94,7 +94,6 @@ plugin_updateinfo.depends = plugin_coreplugin
 
 plugin_welcome.subdir = welcome
 plugin_welcome.depends = plugin_coreplugin
-plugin_welcome.depends += plugin_projectexplorer
 
 plugin_find.subdir = find
 plugin_find.depends += plugin_coreplugin
diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp
index 1b4acb2fcd8..6f74e8b4eea 100644
--- a/src/plugins/projectexplorer/projectwelcomepage.cpp
+++ b/src/plugins/projectexplorer/projectwelcomepage.cpp
@@ -38,6 +38,8 @@
 #include <QFileInfo>
 #include <QDir>
 
+#include <coreplugin/icore.h>
+#include <coreplugin/dialogs/iwizard.h>
 #include <projectexplorer/session.h>
 #include <projectexplorer/projectexplorer.h>
 #include <sessiondialog.h>
@@ -245,5 +247,16 @@ void ProjectWelcomePage::reloadWelcomeScreenData()
         m_projectModel->resetProjects();
 }
 
+void ProjectWelcomePage::newProject()
+{
+    Core::ICore::showNewItemDialog(tr("New Project"),
+                                   Core::IWizard::wizardsOfKind(Core::IWizard::ProjectWizard));
+}
+
+void ProjectWelcomePage::openProject()
+{
+     ProjectExplorerPlugin::instance()->openOpenProjectDialog();
+}
+
 } // namespace Internal
 } // namespace ProjectExplorer
diff --git a/src/plugins/projectexplorer/projectwelcomepage.h b/src/plugins/projectexplorer/projectwelcomepage.h
index 4725d3b4da9..0918dbc2cfa 100644
--- a/src/plugins/projectexplorer/projectwelcomepage.h
+++ b/src/plugins/projectexplorer/projectwelcomepage.h
@@ -102,10 +102,15 @@ public:
 
     void reloadWelcomeScreenData();
 
+public slots:
+    void newProject();
+    void openProject();
+
 signals:
     void requestProject(const QString &project);
     void requestSession(const QString &session);
     void manageSessions();
+
 private:
     SessionModel *m_sessionModel;
     ProjectModel *m_projectModel;
diff --git a/src/plugins/welcome/welcome_dependencies.pri b/src/plugins/welcome/welcome_dependencies.pri
index 301ba69b4e4..7f369f6326a 100644
--- a/src/plugins/welcome/welcome_dependencies.pri
+++ b/src/plugins/welcome/welcome_dependencies.pri
@@ -1,3 +1,2 @@
-include(../../plugins/projectexplorer/projectexplorer.pri)
 include(../../plugins/coreplugin/coreplugin.pri)
 include(../../libs/utils/utils.pri)
diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp
index b3a80ae66db..bf8fdf9e946 100644
--- a/src/plugins/welcome/welcomeplugin.cpp
+++ b/src/plugins/welcome/welcomeplugin.cpp
@@ -104,10 +104,8 @@ public:
     Q_SCRIPTABLE QString platform() const;
 
     bool eventFilter(QObject *, QEvent *);
-public slots:
-    void newProject();
-    void openProject();
 
+public slots:
     void setActivePlugin(int pos)
     {
         if (m_activePlugin != pos) {
@@ -327,17 +325,6 @@ void WelcomeMode::welcomePluginAdded(QObject *obj)
     }
 }
 
-void WelcomeMode::newProject()
-{
-    Core::ICore::showNewItemDialog(tr("New Project"),
-                                               Core::IWizard::wizardsOfKind(Core::IWizard::ProjectWizard));
-}
-
-void WelcomeMode::openProject()
-{
-    ProjectExplorer::ProjectExplorerPlugin::instance()->openOpenProjectDialog();
-}
-
 WelcomePlugin::WelcomePlugin()
   : m_welcomeMode(0)
 {
-- 
GitLab