Commit 8f224172 authored by dt's avatar dt

Refactoring: Move QtVersionManager to ProjectExplorer.

The Debugger, cmake and Qt4 plugin all need it. More refactoring to it
coming.
parent ef8e69d9
...@@ -21,6 +21,7 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> ...@@ -21,6 +21,7 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<dependencyList> <dependencyList>
<dependency name="Core" version="1.1.80"/> <dependency name="Core" version="1.1.80"/>
<dependency name="Find" version="1.1.80"/> <dependency name="Find" version="1.1.80"/>
<dependency name="Help" version="1.1.80"/>
<dependency name="QuickOpen" version="1.1.80"/> <dependency name="QuickOpen" version="1.1.80"/>
<dependency name="TextEditor" version="1.1.80"/> <dependency name="TextEditor" version="1.1.80"/>
</dependencyList> </dependencyList>
......
...@@ -58,7 +58,8 @@ HEADERS += projectexplorer.h \ ...@@ -58,7 +58,8 @@ HEADERS += projectexplorer.h \
buildparserfactory.h\ buildparserfactory.h\
gccparser.h\ gccparser.h\
msvcparser.h\ msvcparser.h\
filewatcher.h filewatcher.h\
qtversionmanager.h
SOURCES += projectexplorer.cpp \ SOURCES += projectexplorer.cpp \
projectwindow.cpp \ projectwindow.cpp \
buildmanager.cpp \ buildmanager.cpp \
...@@ -105,7 +106,8 @@ SOURCES += projectexplorer.cpp \ ...@@ -105,7 +106,8 @@ SOURCES += projectexplorer.cpp \
buildparserfactory.cpp \ buildparserfactory.cpp \
gccparser.cpp\ gccparser.cpp\
msvcparser.cpp\ msvcparser.cpp\
filewatcher.cpp filewatcher.cpp\
qtversionmanager.cpp
FORMS += dependenciespanel.ui \ FORMS += dependenciespanel.ui \
buildsettingspropertiespage.ui \ buildsettingspropertiespage.ui \
processstep.ui \ processstep.ui \
...@@ -114,7 +116,9 @@ FORMS += dependenciespanel.ui \ ...@@ -114,7 +116,9 @@ FORMS += dependenciespanel.ui \
sessiondialog.ui \ sessiondialog.ui \
projectwizardpage.ui \ projectwizardpage.ui \
buildstepspage.ui \ buildstepspage.ui \
removefiledialog.ui removefiledialog.ui\
qtversionmanager.ui\
showbuildlog.ui
win32 { win32 {
SOURCES += applicationlauncher_win.cpp \ SOURCES += applicationlauncher_win.cpp \
winguiprocess.cpp winguiprocess.cpp
......
...@@ -3,3 +3,4 @@ include(../../plugins/quickopen/quickopen.pri) ...@@ -3,3 +3,4 @@ include(../../plugins/quickopen/quickopen.pri)
include(../../plugins/find/find.pri) include(../../plugins/find/find.pri)
include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/texteditor/texteditor.pri) include(../../plugins/texteditor/texteditor.pri)
include(../../plugins/help/help.pri)
...@@ -177,7 +177,10 @@ const char * const RESOURCE_MIMETYPE = "application/vnd.nokia.xml.qt.resource"; ...@@ -177,7 +177,10 @@ const char * const RESOURCE_MIMETYPE = "application/vnd.nokia.xml.qt.resource";
const char * const BUILD_PARSER_MSVC = "BuildParser.MSVC"; const char * const BUILD_PARSER_MSVC = "BuildParser.MSVC";
const char * const BUILD_PARSER_GCC = "BuildParser.Gcc"; const char * const BUILD_PARSER_GCC = "BuildParser.Gcc";
//Qt4 settings pages
const char * const QT_CATEGORY = "Qt4";
const char * const QTVERSION_PAGE = "Qt Versions";
const char * const BUILD_ENVIRONMENT_PAGE = "Build Environments";
} // namespace Constants } // namespace Constants
} // namespace ProjectExplorer } // namespace ProjectExplorer
......
...@@ -30,22 +30,26 @@ ...@@ -30,22 +30,26 @@
#ifndef QTVERSIONMANAGER_H #ifndef QTVERSIONMANAGER_H
#define QTVERSIONMANAGER_H #define QTVERSIONMANAGER_H
#include "ui_qtversionmanager.h" #include "projectexplorer.h"
#include "toolchain.h"
#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/dialogs/ioptionspage.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/toolchain.h>
#include <QtCore/QPointer> #include <QtCore/QPointer>
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QPushButton> #include <QtGui/QPushButton>
namespace Qt4ProjectManager { namespace ProjectExplorer {
namespace Internal { namespace Internal {
namespace Ui {
class QtVersionManager;
}
}
class QtDirWidget; class QtDirWidget;
class QtVersion class PROJECTEXPLORER_EXPORT QtVersion
{ {
friend class QtDirWidget; //for changing name and path friend class QtDirWidget; //for changing name and path
friend class QtVersionManager; friend class QtVersionManager;
...@@ -141,7 +145,7 @@ private: ...@@ -141,7 +145,7 @@ private:
void showEnvironmentPage(QTreeWidgetItem * item); void showEnvironmentPage(QTreeWidgetItem * item);
void fixQtVersionName(int index); void fixQtVersionName(int index);
int indexForWidget(QWidget *debuggingHelperWidget) const; int indexForWidget(QWidget *debuggingHelperWidget) const;
Ui::QtVersionManager m_ui; Internal::Ui::QtVersionManager *m_ui;
QList<QtVersion *> m_versions; QList<QtVersion *> m_versions;
int m_defaultVersion; int m_defaultVersion;
QString m_specifyNameString; QString m_specifyNameString;
...@@ -164,7 +168,7 @@ private slots: ...@@ -164,7 +168,7 @@ private slots:
void showDebuggingBuildLog(); void showDebuggingBuildLog();
}; };
class QtVersionManager : public Core::IOptionsPage class PROJECTEXPLORER_EXPORT QtVersionManager : public Core::IOptionsPage
{ {
Q_OBJECT Q_OBJECT
...@@ -222,8 +226,6 @@ private: ...@@ -222,8 +226,6 @@ private:
QMap<int, int> m_uniqueIdToIndex; QMap<int, int> m_uniqueIdToIndex;
int m_idcount; int m_idcount;
}; };
} // namespace ProjectExplorer
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // QTVERSIONMANAGER_H #endif // QTVERSIONMANAGER_H
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Qt4ProjectManager::Internal::QtVersionManager</class> <class>ProjectExplorer::Internal::QtVersionManager</class>
<widget class="QWidget" name="Qt4ProjectManager::Internal::QtVersionManager"> <widget class="QWidget" name="ProjectExplorer::Internal::QtVersionManager">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
using ProjectExplorer::IBuildParserFactory; using ProjectExplorer::IBuildParserFactory;
using ProjectExplorer::BuildParserInterface; using ProjectExplorer::BuildParserInterface;
using ProjectExplorer::Environment; using ProjectExplorer::Environment;
using ProjectExplorer::QtVersion;
using ExtensionSystem::PluginManager; using ExtensionSystem::PluginManager;
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
...@@ -64,7 +65,7 @@ MakeStep::~MakeStep() ...@@ -64,7 +65,7 @@ MakeStep::~MakeStep()
m_buildParser = 0; m_buildParser = 0;
} }
ProjectExplorer::BuildParserInterface *MakeStep::buildParser(const QtVersion * const version) ProjectExplorer::BuildParserInterface *MakeStep::buildParser(const QtVersion *const version)
{ {
QString buildParser; QString buildParser;
ProjectExplorer::ToolChain::ToolChainType type = version->toolchainType(); ProjectExplorer::ToolChain::ToolChainType type = version->toolchainType();
......
...@@ -30,16 +30,17 @@ ...@@ -30,16 +30,17 @@
#ifndef MAKESTEP_H #ifndef MAKESTEP_H
#define MAKESTEP_H #define MAKESTEP_H
#include "qtversionmanager.h"
#include "ui_makestep.h" #include "ui_makestep.h"
#include <projectexplorer/abstractprocessstep.h> #include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/qtversionmanager.h>
namespace ProjectExplorer { namespace ProjectExplorer {
class BuildStep; class BuildStep;
class IBuildStepFactory; class IBuildStepFactory;
class Project; class Project;
class QtVersion;
} }
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
...@@ -81,7 +82,7 @@ private slots: ...@@ -81,7 +82,7 @@ private slots:
void addDirectory(const QString &dir); void addDirectory(const QString &dir);
void removeDirectory(const QString &dir); void removeDirectory(const QString &dir);
private: private:
ProjectExplorer::BuildParserInterface *buildParser(const Internal::QtVersion * const version); ProjectExplorer::BuildParserInterface *buildParser(const ProjectExplorer::QtVersion *const version);
Qt4Project *m_project; Qt4Project *m_project;
ProjectExplorer::BuildParserInterface *m_buildParser; ProjectExplorer::BuildParserInterface *m_buildParser;
bool m_skipMakeClean; bool m_skipMakeClean;
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::QtVersion;
ProFileReader::ProFileReader() ProFileReader::ProFileReader()
{ {
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define PROFILEREADER_H #define PROFILEREADER_H
#include "profileevaluator.h" #include "profileevaluator.h"
#include "qtversionmanager.h" #include <projectexplorer/qtversionmanager.h>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QMap> #include <QtCore/QMap>
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
class ProFileReader : public QObject, public ProFileEvaluator class ProFileReader : public QObject, public ProFileEvaluator
{ {
Q_OBJECT Q_OBJECT
...@@ -48,7 +47,7 @@ public: ...@@ -48,7 +47,7 @@ public:
ProFileReader(); ProFileReader();
~ProFileReader(); ~ProFileReader();
void setQtVersion(QtVersion *qtVersion); void setQtVersion(ProjectExplorer::QtVersion *qtVersion);
bool readProFile(const QString &fileName); bool readProFile(const QString &fileName);
QList<ProFile*> includeFiles() const; QList<ProFile*> includeFiles() const;
......
...@@ -43,10 +43,12 @@ ...@@ -43,10 +43,12 @@
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::QtVersion;
ProjectLoadWizard::ProjectLoadWizard(Qt4Project *project, QWidget *parent, Qt::WindowFlags flags) ProjectLoadWizard::ProjectLoadWizard(Qt4Project *project, QWidget *parent, Qt::WindowFlags flags)
: QWizard(parent, flags), m_project(project), m_importVersion(0), m_temporaryVersion(false) : QWizard(parent, flags), m_project(project), m_importVersion(0), m_temporaryVersion(false)
{ {
QtVersionManager * vm = project->qt4ProjectManager()->versionManager(); ProjectExplorer::QtVersionManager * vm = project->qt4ProjectManager()->versionManager();
QString directory = QFileInfo(project->file()->fileName()).absolutePath(); QString directory = QFileInfo(project->file()->fileName()).absolutePath();
QString importVersion = vm->findQtVersionFromMakefile(directory); QString importVersion = vm->findQtVersionFromMakefile(directory);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#ifndef PROJECTLOADWIZARD_H #ifndef PROJECTLOADWIZARD_H
#define PROJECTLOADWIZARD_H #define PROJECTLOADWIZARD_H
#include "qtversionmanager.h" #include <projectexplorer/qtversionmanager.h>
#include <QtGui/QWizard> #include <QtGui/QWizard>
...@@ -57,14 +57,14 @@ public: ...@@ -57,14 +57,14 @@ public:
void execDialog(); void execDialog();
private: private:
void addBuildConfiguration(QString name, QtVersion *qtversion, QtVersion::QmakeBuildConfig buildConfiguration); void addBuildConfiguration(QString name, ProjectExplorer::QtVersion *qtversion, ProjectExplorer::QtVersion::QmakeBuildConfig buildConfiguration);
void setupImportPage(QtVersion *version, QtVersion::QmakeBuildConfig buildConfig); void setupImportPage(ProjectExplorer::QtVersion *version, ProjectExplorer::QtVersion::QmakeBuildConfig buildConfig);
Qt4Project *m_project; Qt4Project *m_project;
// Only used for imported stuff // Only used for imported stuff
QtVersion *m_importVersion; ProjectExplorer::QtVersion *m_importVersion;
QtVersion::QmakeBuildConfig m_importBuildConfig; ProjectExplorer::QtVersion::QmakeBuildConfig m_importBuildConfig;
// Those that we might add // Those that we might add
bool m_temporaryVersion; bool m_temporaryVersion;
......
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
#include "qt4projectmanagerconstants.h" #include "qt4projectmanagerconstants.h"
#include "qt4projectmanager.h" #include "qt4projectmanager.h"
#include "makestep.h" #include "makestep.h"
#include "qtversionmanager.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <projectexplorer/qtversionmanager.h>
#include <QFileDialog> #include <QFileDialog>
#include <QDir> #include <QDir>
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::QtVersion;
namespace { namespace {
bool debug = false; bool debug = false;
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "qmakestep.h" #include "qmakestep.h"
#include "deployhelper.h" #include "deployhelper.h"
#include "qt4runconfiguration.h" #include "qt4runconfiguration.h"
#include "qtversionmanager.h"
#include "qt4nodes.h" #include "qt4nodes.h"
#include "qt4projectconfigwidget.h" #include "qt4projectconfigwidget.h"
#include "qt4buildenvironmentwidget.h" #include "qt4buildenvironmentwidget.h"
...@@ -51,6 +50,7 @@ ...@@ -51,6 +50,7 @@
#include <projectexplorer/nodesvisitor.h> #include <projectexplorer/nodesvisitor.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/customexecutablerunconfiguration.h> #include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/qtversionmanager.h>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QDir> #include <QtCore/QDir>
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#ifndef QT4PROJECT_H #ifndef QT4PROJECT_H
#define QT4PROJECT_H #define QT4PROJECT_H
#include "qtversionmanager.h"
#include "qt4nodes.h" #include "qt4nodes.h"
#include "qmakestep.h" #include "qmakestep.h"
#include "makestep.h" #include "makestep.h"
...@@ -39,6 +38,7 @@ ...@@ -39,6 +38,7 @@
#include <projectexplorer/applicationrunconfiguration.h> #include <projectexplorer/applicationrunconfiguration.h>
#include <projectexplorer/projectnodes.h> #include <projectexplorer/projectnodes.h>
#include <projectexplorer/toolchain.h> #include <projectexplorer/toolchain.h>
#include <projectexplorer/qtversionmanager.h>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QList> #include <QtCore/QList>
...@@ -148,7 +148,7 @@ public: ...@@ -148,7 +148,7 @@ public:
//returns the qtVersion, if the project is set to use the default qt version, then //returns the qtVersion, if the project is set to use the default qt version, then
// that is returned // that is returned
// to check wheter the project uses the default qt version use qtVersionId // to check wheter the project uses the default qt version use qtVersionId
Internal::QtVersion *qtVersion(const QString &buildConfiguration) const; ProjectExplorer::QtVersion *qtVersion(const QString &buildConfiguration) const;
// returns the id of the qt version, if the project is using the default qt version // returns the id of the qt version, if the project is using the default qt version
// this function returns 0 // this function returns 0
......
...@@ -38,9 +38,13 @@ ...@@ -38,9 +38,13 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/mainwindow.h> #include <coreplugin/mainwindow.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
using ProjectExplorer::QtVersionManager;
using ProjectExplorer::QtVersion;
namespace { namespace {
bool debug = false; bool debug = false;
} }
...@@ -91,7 +95,7 @@ Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget() ...@@ -91,7 +95,7 @@ Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget()
void Qt4ProjectConfigWidget::manageQtVersions() void Qt4ProjectConfigWidget::manageQtVersions()
{ {
Core::ICore *core = Core::ICore::instance(); Core::ICore *core = Core::ICore::instance();
core->showOptionsDialog(Constants::QT_CATEGORY, Constants::QTVERSION_PAGE); core->showOptionsDialog(ProjectExplorer::Constants::QT_CATEGORY, ProjectExplorer::Constants::QTVERSION_PAGE);
} }
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "qt4nodes.h" #include "qt4nodes.h"
#include "qt4project.h" #include "qt4project.h"
#include "profilereader.h" #include "profilereader.h"
#include "qtversionmanager.h"
#include "qmakestep.h" #include "qmakestep.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
...@@ -47,6 +46,7 @@ ...@@ -47,6 +46,7 @@
#include <projectexplorer/buildmanager.h> #include <projectexplorer/buildmanager.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/qtversionmanager.h>
#include <utils/listutils.h> #include <utils/listutils.h>
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
...@@ -68,6 +68,8 @@ using ProjectExplorer::SourceType; ...@@ -68,6 +68,8 @@ using ProjectExplorer::SourceType;
using ProjectExplorer::FormType; using ProjectExplorer::FormType;
using ProjectExplorer::ResourceType; using ProjectExplorer::ResourceType;
using ProjectExplorer::UnknownFileType; using ProjectExplorer::UnknownFileType;
using ProjectExplorer::QtVersion;
using ProjectExplorer::QtVersionManager;
// Known file types of a Qt 4 project // Known file types of a Qt 4 project
static const char* qt4FileTypes[] = { static const char* qt4FileTypes[] = {
......
...@@ -43,6 +43,7 @@ class PluginManager; ...@@ -43,6 +43,7 @@ class PluginManager;
namespace ProjectExplorer { namespace ProjectExplorer {
class Project; class Project;
class ProjectExplorerPlugin; class ProjectExplorerPlugin;
class QtVersionManager;
} }
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
...@@ -51,7 +52,6 @@ namespace Internal { ...@@ -51,7 +52,6 @@ namespace Internal {
class Qt4Builder; class Qt4Builder;
class ProFileEditor; class ProFileEditor;
class Qt4ProjectManagerPlugin; class Qt4ProjectManagerPlugin;
class QtVersionManager;
} }
class Qt4Project; class Qt4Project;
...@@ -85,7 +85,7 @@ public: ...@@ -85,7 +85,7 @@ public:
void setContextProject(ProjectExplorer::Project *project); void setContextProject(ProjectExplorer::Project *project);
ProjectExplorer::Project *contextProject() const; ProjectExplorer::Project *contextProject() const;
Internal::QtVersionManager *versionManager() const; ProjectExplorer::QtVersionManager *versionManager() const;
// Return the id string of a file // Return the id string of a file
static QString fileTypeId(ProjectExplorer::FileType type); static QString fileTypeId(ProjectExplorer::FileType type);
......
...@@ -5,7 +5,6 @@ include(../../qworkbenchplugin.pri) ...@@ -5,7 +5,6 @@ include(../../qworkbenchplugin.pri)
include(qt4projectmanager_dependencies.pri) include(qt4projectmanager_dependencies.pri)
HEADERS = qt4projectmanagerplugin.h \ HEADERS = qt4projectmanagerplugin.h \
qt4projectmanager.h \ qt4projectmanager.h \
qtversionmanager.h \
qt4project.h \ qt4project.h \
qt4nodes.h \ qt4nodes.h \
profileeditor.h \ profileeditor.h \
...@@ -36,7 +35,6 @@ HEADERS = qt4projectmanagerplugin.h \ ...@@ -36,7 +35,6 @@ HEADERS = qt4projectmanagerplugin.h \
projectloadwizard.h projectloadwizard.h
SOURCES = qt4projectmanagerplugin.cpp \ SOURCES = qt4projectmanagerplugin.cpp \
qt4projectmanager.cpp \ qt4projectmanager.cpp \
qtversionmanager.cpp \
qt4project.cpp \ qt4project.cpp \
qt4nodes.cpp \ qt4nodes.cpp \
profileeditor.cpp \ profileeditor.cpp \
...@@ -63,16 +61,14 @@ SOURCES = qt4projectmanagerplugin.cpp \ ...@@ -63,16 +61,14 @@ SOURCES = qt4projectmanagerplugin.cpp \
qt4projectconfigwidget.cpp \ qt4projectconfigwidget.cpp \
qt4buildenvironmentwidget.cpp \ qt4buildenvironmentwidget.cpp \
projectloadwizard.cpp projectloadwizard.cpp
FORMS = qtversionmanager.ui \ FORMS = envvariablespage.ui \
envvariablespage.ui \
enveditdialog.ui \ enveditdialog.ui \
proeditorcontainer.ui \ proeditorcontainer.ui \
makestep.ui \ makestep.ui \
qmakestep.ui \ qmakestep.ui \
qt4projectconfigwidget.ui \ qt4projectconfigwidget.ui \
embeddedpropertiespage.ui \