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>
<dependencyList>
<dependency name="Core" 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="TextEditor" version="1.1.80"/>
</dependencyList>
......
......@@ -58,7 +58,8 @@ HEADERS += projectexplorer.h \
buildparserfactory.h\
gccparser.h\
msvcparser.h\
filewatcher.h
filewatcher.h\
qtversionmanager.h
SOURCES += projectexplorer.cpp \
projectwindow.cpp \
buildmanager.cpp \
......@@ -105,7 +106,8 @@ SOURCES += projectexplorer.cpp \
buildparserfactory.cpp \
gccparser.cpp\
msvcparser.cpp\
filewatcher.cpp
filewatcher.cpp\
qtversionmanager.cpp
FORMS += dependenciespanel.ui \
buildsettingspropertiespage.ui \
processstep.ui \
......@@ -114,7 +116,9 @@ FORMS += dependenciespanel.ui \
sessiondialog.ui \
projectwizardpage.ui \
buildstepspage.ui \
removefiledialog.ui
removefiledialog.ui\
qtversionmanager.ui\
showbuildlog.ui
win32 {
SOURCES += applicationlauncher_win.cpp \
winguiprocess.cpp
......
......@@ -3,3 +3,4 @@ include(../../plugins/quickopen/quickopen.pri)
include(../../plugins/find/find.pri)
include(../../plugins/coreplugin/coreplugin.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";
const char * const BUILD_PARSER_MSVC = "BuildParser.MSVC";
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 ProjectExplorer
......
......@@ -30,22 +30,26 @@
#ifndef QTVERSIONMANAGER_H
#define QTVERSIONMANAGER_H
#include "ui_qtversionmanager.h"
#include "projectexplorer.h"
#include "toolchain.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/toolchain.h>
#include <QtCore/QPointer>
#include <QtGui/QWidget>
#include <QtGui/QPushButton>
namespace Qt4ProjectManager {
namespace ProjectExplorer {
namespace Internal {
namespace Ui {
class QtVersionManager;
}
}
class QtDirWidget;
class QtVersion
class PROJECTEXPLORER_EXPORT QtVersion
{
friend class QtDirWidget; //for changing name and path
friend class QtVersionManager;
......@@ -141,7 +145,7 @@ private:
void showEnvironmentPage(QTreeWidgetItem * item);
void fixQtVersionName(int index);
int indexForWidget(QWidget *debuggingHelperWidget) const;
Ui::QtVersionManager m_ui;
Internal::Ui::QtVersionManager *m_ui;
QList<QtVersion *> m_versions;
int m_defaultVersion;
QString m_specifyNameString;
......@@ -164,7 +168,7 @@ private slots:
void showDebuggingBuildLog();
};
class QtVersionManager : public Core::IOptionsPage
class PROJECTEXPLORER_EXPORT QtVersionManager : public Core::IOptionsPage
{
Q_OBJECT
......@@ -222,8 +226,6 @@ private:
QMap<int, int> m_uniqueIdToIndex;
int m_idcount;
};
} // namespace Internal
} // namespace Qt4ProjectManager
} // namespace ProjectExplorer
#endif // QTVERSIONMANAGER_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Qt4ProjectManager::Internal::QtVersionManager</class>
<widget class="QWidget" name="Qt4ProjectManager::Internal::QtVersionManager">
<class>ProjectExplorer::Internal::QtVersionManager</class>
<widget class="QWidget" name="ProjectExplorer::Internal::QtVersionManager">
<property name="geometry">
<rect>
<x>0</x>
......
......@@ -43,6 +43,7 @@
using ProjectExplorer::IBuildParserFactory;
using ProjectExplorer::BuildParserInterface;
using ProjectExplorer::Environment;
using ProjectExplorer::QtVersion;
using ExtensionSystem::PluginManager;
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
......@@ -64,7 +65,7 @@ MakeStep::~MakeStep()
m_buildParser = 0;
}
ProjectExplorer::BuildParserInterface *MakeStep::buildParser(const QtVersion * const version)
ProjectExplorer::BuildParserInterface *MakeStep::buildParser(const QtVersion *const version)
{
QString buildParser;
ProjectExplorer::ToolChain::ToolChainType type = version->toolchainType();
......
......@@ -30,16 +30,17 @@
#ifndef MAKESTEP_H
#define MAKESTEP_H
#include "qtversionmanager.h"
#include "ui_makestep.h"
#include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/qtversionmanager.h>
namespace ProjectExplorer {
class BuildStep;
class IBuildStepFactory;
class Project;
class QtVersion;
}
namespace Qt4ProjectManager {
......@@ -81,7 +82,7 @@ private slots:
void addDirectory(const QString &dir);
void removeDirectory(const QString &dir);
private:
ProjectExplorer::BuildParserInterface *buildParser(const Internal::QtVersion * const version);
ProjectExplorer::BuildParserInterface *buildParser(const ProjectExplorer::QtVersion *const version);
Qt4Project *m_project;
ProjectExplorer::BuildParserInterface *m_buildParser;
bool m_skipMakeClean;
......
......@@ -35,6 +35,8 @@
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::QtVersion;
ProFileReader::ProFileReader()
{
}
......
......@@ -31,7 +31,7 @@
#define PROFILEREADER_H
#include "profileevaluator.h"
#include "qtversionmanager.h"
#include <projectexplorer/qtversionmanager.h>
#include <QtCore/QObject>
#include <QtCore/QMap>
......@@ -39,7 +39,6 @@
namespace Qt4ProjectManager {
namespace Internal {
class ProFileReader : public QObject, public ProFileEvaluator
{
Q_OBJECT
......@@ -48,7 +47,7 @@ public:
ProFileReader();
~ProFileReader();
void setQtVersion(QtVersion *qtVersion);
void setQtVersion(ProjectExplorer::QtVersion *qtVersion);
bool readProFile(const QString &fileName);
QList<ProFile*> includeFiles() const;
......
......@@ -43,10 +43,12 @@
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::QtVersion;
ProjectLoadWizard::ProjectLoadWizard(Qt4Project *project, QWidget *parent, Qt::WindowFlags flags)
: 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 importVersion = vm->findQtVersionFromMakefile(directory);
......
......@@ -30,7 +30,7 @@
#ifndef PROJECTLOADWIZARD_H
#define PROJECTLOADWIZARD_H
#include "qtversionmanager.h"
#include <projectexplorer/qtversionmanager.h>
#include <QtGui/QWizard>
......@@ -57,14 +57,14 @@ public:
void execDialog();
private:
void addBuildConfiguration(QString name, QtVersion *qtversion, QtVersion::QmakeBuildConfig buildConfiguration);
void setupImportPage(QtVersion *version, QtVersion::QmakeBuildConfig buildConfig);
void addBuildConfiguration(QString name, ProjectExplorer::QtVersion *qtversion, ProjectExplorer::QtVersion::QmakeBuildConfig buildConfiguration);
void setupImportPage(ProjectExplorer::QtVersion *version, ProjectExplorer::QtVersion::QmakeBuildConfig buildConfig);
Qt4Project *m_project;
// Only used for imported stuff
QtVersion *m_importVersion;
QtVersion::QmakeBuildConfig m_importBuildConfig;
ProjectExplorer::QtVersion *m_importVersion;
ProjectExplorer::QtVersion::QmakeBuildConfig m_importBuildConfig;
// Those that we might add
bool m_temporaryVersion;
......
......@@ -33,10 +33,10 @@
#include "qt4projectmanagerconstants.h"
#include "qt4projectmanager.h"
#include "makestep.h"
#include "qtversionmanager.h"
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
#include <projectexplorer/qtversionmanager.h>
#include <QFileDialog>
#include <QDir>
......
......@@ -64,6 +64,7 @@
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::QtVersion;
namespace {
bool debug = false;
......
......@@ -36,7 +36,6 @@
#include "qmakestep.h"
#include "deployhelper.h"
#include "qt4runconfiguration.h"
#include "qtversionmanager.h"
#include "qt4nodes.h"
#include "qt4projectconfigwidget.h"
#include "qt4buildenvironmentwidget.h"
......@@ -51,6 +50,7 @@
#include <projectexplorer/nodesvisitor.h>
#include <projectexplorer/project.h>
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/qtversionmanager.h>
#include <QtCore/QDebug>
#include <QtCore/QDir>
......
......@@ -30,7 +30,6 @@
#ifndef QT4PROJECT_H
#define QT4PROJECT_H
#include "qtversionmanager.h"
#include "qt4nodes.h"
#include "qmakestep.h"
#include "makestep.h"
......@@ -39,6 +38,7 @@
#include <projectexplorer/applicationrunconfiguration.h>
#include <projectexplorer/projectnodes.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/qtversionmanager.h>
#include <QtCore/QObject>
#include <QtCore/QList>
......@@ -148,7 +148,7 @@ public:
//returns the qtVersion, if the project is set to use the default qt version, then
// that is returned
// 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
// this function returns 0
......
......@@ -38,9 +38,13 @@
#include <coreplugin/icore.h>
#include <coreplugin/mainwindow.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QtGui/QFileDialog>
using ProjectExplorer::QtVersionManager;
using ProjectExplorer::QtVersion;
namespace {
bool debug = false;
}
......@@ -91,7 +95,7 @@ Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget()
void Qt4ProjectConfigWidget::manageQtVersions()
{
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 @@
#include "qt4nodes.h"
#include "qt4project.h"
#include "profilereader.h"
#include "qtversionmanager.h"
#include "qmakestep.h"
#include <coreplugin/icore.h>
......@@ -47,6 +46,7 @@
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/qtversionmanager.h>
#include <utils/listutils.h>
#include <QtCore/QCoreApplication>
......@@ -68,6 +68,8 @@ using ProjectExplorer::SourceType;
using ProjectExplorer::FormType;
using ProjectExplorer::ResourceType;
using ProjectExplorer::UnknownFileType;
using ProjectExplorer::QtVersion;
using ProjectExplorer::QtVersionManager;
// Known file types of a Qt 4 project
static const char* qt4FileTypes[] = {
......
......@@ -43,6 +43,7 @@ class PluginManager;
namespace ProjectExplorer {
class Project;
class ProjectExplorerPlugin;
class QtVersionManager;
}
namespace Qt4ProjectManager {
......@@ -51,7 +52,6 @@ namespace Internal {
class Qt4Builder;
class ProFileEditor;
class Qt4ProjectManagerPlugin;
class QtVersionManager;
}
class Qt4Project;
......@@ -85,7 +85,7 @@ public:
void setContextProject(ProjectExplorer::Project *project);
ProjectExplorer::Project *contextProject() const;
Internal::QtVersionManager *versionManager() const;
ProjectExplorer::QtVersionManager *versionManager() const;
// Return the id string of a file
static QString fileTypeId(ProjectExplorer::FileType type);
......
......@@ -5,7 +5,6 @@ include(../../qworkbenchplugin.pri)
include(qt4projectmanager_dependencies.pri)
HEADERS = qt4projectmanagerplugin.h \
qt4projectmanager.h \
qtversionmanager.h \
qt4project.h \
qt4nodes.h \
profileeditor.h \
......@@ -36,7 +35,6 @@ HEADERS = qt4projectmanagerplugin.h \
projectloadwizard.h
SOURCES = qt4projectmanagerplugin.cpp \
qt4projectmanager.cpp \
qtversionmanager.cpp \
qt4project.cpp \
qt4nodes.cpp \
profileeditor.cpp \
......@@ -63,16 +61,14 @@ SOURCES = qt4projectmanagerplugin.cpp \
qt4projectconfigwidget.cpp \
qt4buildenvironmentwidget.cpp \
projectloadwizard.cpp
FORMS = qtversionmanager.ui \
envvariablespage.ui \
FORMS = envvariablespage.ui \
enveditdialog.ui \
proeditorcontainer.ui \
makestep.ui \
qmakestep.ui \
qt4projectconfigwidget.ui \
embeddedpropertiespage.ui \
qt4buildenvironmentwidget.ui \
showbuildlog.ui
qt4buildenvironmentwidget.ui
RESOURCES = qt4projectmanager.qrc \
wizards/wizards.qrc
include(../../shared/proparser/proparser.pri)
......
......@@ -37,11 +37,6 @@ namespace Constants {
const char * const C_PROFILEEDITOR = ".pro File Editor";
const char * const C_PROFILEEDITOR_PANEL = ".pro File Editor (embedded)";
//settings pages
const char * const QT_CATEGORY = "Qt4";
const char * const QTVERSION_PAGE = "Qt Versions";
const char * const BUILD_ENVIRONMENT_PAGE = "Build Environments";
// kinds
const char * const PROJECT_KIND = "Qt4";
const char * const PROFILE_EDITOR = ".pro File Editor";
......
......@@ -36,7 +36,6 @@
#include "profileeditorfactory.h"
#include "qt4projectmanagerconstants.h"
#include "qt4project.h"
#include "qtversionmanager.h"
#include "embeddedpropertiespage.h"
#include "qt4runconfiguration.h"
#include "profilereader.h"
......@@ -48,6 +47,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectnodes.h>
#include <projectexplorer/qtversionmanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/actionmanager/actionmanager.h>
......@@ -64,6 +64,7 @@
using namespace Qt4ProjectManager::Internal;
using namespace Qt4ProjectManager;
using ProjectExplorer::Project;
using ProjectExplorer::QtVersionManager;
Qt4ProjectManagerPlugin::~Qt4ProjectManagerPlugin()
{
......
......@@ -33,6 +33,10 @@
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
namespace ProjectExplorer {
class QtVersionManager;
}
namespace Qt4ProjectManager {
class Qt4Manager;
......@@ -46,7 +50,6 @@ class QMakeStepFactory;
class MakeStepFactory;
class GccParserFactory;
class MsvcParserFactory;
class QtVersionManager;
class EmbeddedPropertiesPage;
class Qt4ProjectManagerPlugin : public ExtensionSystem::IPlugin
......@@ -59,7 +62,7 @@ public:
void extensionsInitialized();
int projectContext() const { return m_projectContext; }
QtVersionManager *versionManager() const;
ProjectExplorer::QtVersionManager *versionManager() const;
private slots:
......@@ -77,7 +80,7 @@ private:
ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer;
ProFileEditorFactory *m_proFileEditorFactory;
Qt4Manager *m_qt4ProjectManager;
QtVersionManager *m_qtVersionManager;
ProjectExplorer::QtVersionManager *m_qtVersionManager;
EmbeddedPropertiesPage *m_embeddedPropertiesPage;
int m_projectContext;
......
......@@ -51,6 +51,7 @@ using namespace Qt4ProjectManager;
using ProjectExplorer::ApplicationRunConfiguration;
using ProjectExplorer::PersistentSettingsReader;
using ProjectExplorer::PersistentSettingsWriter;
using ProjectExplorer::QtVersion;
Qt4RunConfiguration::Qt4RunConfiguration(Qt4Project *pro, const QString &proFilePath)
: ApplicationRunConfiguration(pro),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment