Commit 4f82c36a authored by Yuchen Deng's avatar Yuchen Deng Committed by Daniel Teske

Move QtVersionFactory to QtSupport module

After this is done, QbsProjectManager/CMakeProjectManager will be able to
have full Qt support work without having to depend on Qt4ProjectManager.
It's should belong here.

Change-Id: I577d47cb8a40eb697aa862fbec36c56ff05004f0
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent a9ca00bd
HEADERS += \
$$PWD/qt4runconfiguration.h \
$$PWD/desktopqtversionfactory.h \
$$PWD/simulatorqtversionfactory.h \
$$PWD/desktopqtversion.h \
$$PWD/simulatorqtversion.h
SOURCES += \
$$PWD/qt4runconfiguration.cpp \
$$PWD/desktopqtversionfactory.cpp \
$$PWD/simulatorqtversionfactory.cpp \
$$PWD/desktopqtversion.cpp \
$$PWD/simulatorqtversion.cpp
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "qt4buildconfiguration.h" #include "qt4buildconfiguration.h"
#include "qmakebuildinfo.h" #include "qmakebuildinfo.h"
#include "qmakekitinformation.h"
#include "qt4project.h" #include "qt4project.h"
#include "qt4projectconfigwidget.h" #include "qt4projectconfigwidget.h"
#include "qt4projectmanagerconstants.h" #include "qt4projectmanagerconstants.h"
...@@ -49,7 +50,6 @@ ...@@ -49,7 +50,6 @@
#include <projectexplorer/toolchainmanager.h> #include <projectexplorer/toolchainmanager.h>
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtversionmanager.h> #include <qtsupport/qtversionmanager.h>
#include <qt4projectmanager/qmakekitinformation.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QDebug> #include <QDebug>
......
...@@ -61,8 +61,7 @@ HEADERS += \ ...@@ -61,8 +61,7 @@ HEADERS += \
librarydetailscontroller.h \ librarydetailscontroller.h \
findqt4profiles.h \ findqt4profiles.h \
qt4projectmanager_global.h \ qt4projectmanager_global.h \
winceqtversionfactory.h \ qt4runconfiguration.h \
winceqtversion.h \
profilecompletionassist.h profilecompletionassist.h
SOURCES += \ SOURCES += \
...@@ -119,8 +118,7 @@ SOURCES += \ ...@@ -119,8 +118,7 @@ SOURCES += \
addlibrarywizard.cpp \ addlibrarywizard.cpp \
librarydetailscontroller.cpp \ librarydetailscontroller.cpp \
findqt4profiles.cpp \ findqt4profiles.cpp \
winceqtversionfactory.cpp \ qt4runconfiguration.cpp \
winceqtversion.cpp \
profilecompletionassist.cpp profilecompletionassist.cpp
FORMS += makestep.ui \ FORMS += makestep.ui \
...@@ -136,5 +134,4 @@ FORMS += makestep.ui \ ...@@ -136,5 +134,4 @@ FORMS += makestep.ui \
RESOURCES += qt4projectmanager.qrc \ RESOURCES += qt4projectmanager.qrc \
wizards/wizards.qrc wizards/wizards.qrc
include(qt-desktop/qt-desktop.pri)
include(customwidgetwizard/customwidgetwizard.pri) include(customwidgetwizard/customwidgetwizard.pri)
...@@ -51,8 +51,7 @@ QtcPlugin { ...@@ -51,8 +51,7 @@ QtcPlugin {
"qt4projectmanagerconstants.h", "qt4projectmanagerconstants.h",
"qt4projectmanagerplugin.cpp", "qt4projectmanagerplugin.h", "qt4projectmanagerplugin.cpp", "qt4projectmanagerplugin.h",
"qtmodulesinfo.cpp", "qtmodulesinfo.h", "qtmodulesinfo.cpp", "qtmodulesinfo.h",
"winceqtversion.cpp", "winceqtversion.h", "qt4runconfiguration.cpp", "qt4runconfiguration.h",
"winceqtversionfactory.cpp", "winceqtversionfactory.h"
] ]
} }
...@@ -84,18 +83,6 @@ QtcPlugin { ...@@ -84,18 +83,6 @@ QtcPlugin {
] ]
} }
Group {
name: "Qt/Desktop"
prefix: "qt-desktop/"
files: [
"desktopqtversion.cpp", "desktopqtversion.h",
"desktopqtversionfactory.cpp", "desktopqtversionfactory.h",
"qt4runconfiguration.cpp", "qt4runconfiguration.h",
"simulatorqtversion.cpp", "simulatorqtversion.h",
"simulatorqtversionfactory.cpp", "simulatorqtversionfactory.h"
]
}
Group { Group {
name: "Wizards" name: "Wizards"
prefix: "wizards/" prefix: "wizards/"
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "qmakestep.h" #include "qmakestep.h"
#include "makestep.h" #include "makestep.h"
#include "qt4buildconfiguration.h" #include "qt4buildconfiguration.h"
#include "qt4runconfiguration.h"
#include "wizards/consoleappwizard.h" #include "wizards/consoleappwizard.h"
#include "wizards/guiappwizard.h" #include "wizards/guiappwizard.h"
#include "wizards/librarywizard.h" #include "wizards/librarywizard.h"
...@@ -49,10 +50,6 @@ ...@@ -49,10 +50,6 @@
#include "qt4project.h" #include "qt4project.h"
#include "externaleditors.h" #include "externaleditors.h"
#include "profilecompletionassist.h" #include "profilecompletionassist.h"
#include "qt-desktop/qt4runconfiguration.h"
#include "qt-desktop/desktopqtversionfactory.h"
#include "qt-desktop/simulatorqtversionfactory.h"
#include "winceqtversionfactory.h"
#include "qmakekitinformation.h" #include "qmakekitinformation.h"
#include "profilehighlighterfactory.h" #include "profilehighlighterfactory.h"
...@@ -149,10 +146,6 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString * ...@@ -149,10 +146,6 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
addAutoReleasedObject(new DesignerExternalEditor); addAutoReleasedObject(new DesignerExternalEditor);
addAutoReleasedObject(new LinguistExternalEditor); addAutoReleasedObject(new LinguistExternalEditor);
addAutoReleasedObject(new DesktopQtVersionFactory);
addAutoReleasedObject(new SimulatorQtVersionFactory);
addAutoReleasedObject(new WinCeQtVersionFactory);
addAutoReleasedObject(new ProFileCompletionAssistProvider); addAutoReleasedObject(new ProFileCompletionAssistProvider);
addAutoReleasedObject(new ProFileHoverHandler(this)); addAutoReleasedObject(new ProFileHoverHandler(this));
addAutoReleasedObject(new ProFileHighlighterFactory); addAutoReleasedObject(new ProFileHighlighterFactory);
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
#include "qt4runconfiguration.h" #include "qt4runconfiguration.h"
#include "../qt4nodes.h" #include "qt4nodes.h"
#include "../qt4project.h" #include "qt4project.h"
#include "../qt4buildconfiguration.h" #include "qt4buildconfiguration.h"
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <projectexplorer/localenvironmentaspect.h> #include <projectexplorer/localenvironmentaspect.h>
......
...@@ -28,14 +28,14 @@ ...@@ -28,14 +28,14 @@
****************************************************************************/ ****************************************************************************/
#include "desktopqtversion.h" #include "desktopqtversion.h"
#include "qtsupportconstants.h"
#include <qtsupport/qtsupportconstants.h>
#include <coreplugin/featureprovider.h> #include <coreplugin/featureprovider.h>
#include <QCoreApplication> #include <QCoreApplication>
using namespace Qt4ProjectManager; using namespace QtSupport;
using namespace Qt4ProjectManager::Internal; using namespace QtSupport::Internal;
DesktopQtVersion::DesktopQtVersion() DesktopQtVersion::DesktopQtVersion()
: BaseQtVersion() : BaseQtVersion()
...@@ -61,15 +61,15 @@ DesktopQtVersion *DesktopQtVersion::clone() const ...@@ -61,15 +61,15 @@ DesktopQtVersion *DesktopQtVersion::clone() const
QString DesktopQtVersion::type() const QString DesktopQtVersion::type() const
{ {
return QLatin1String(QtSupport::Constants::DESKTOPQT); return QLatin1String(Constants::DESKTOPQT);
} }
QStringList DesktopQtVersion::warningReason() const QStringList DesktopQtVersion::warningReason() const
{ {
QStringList ret = BaseQtVersion::warningReason(); QStringList ret = BaseQtVersion::warningReason();
if (qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0) && qmlsceneCommand().isEmpty()) if (qtVersion() >= QtVersionNumber(5, 0, 0) && qmlsceneCommand().isEmpty())
ret << QCoreApplication::translate("QtVersion", "No qmlscene installed."); ret << QCoreApplication::translate("QtVersion", "No qmlscene installed.");
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty()) if (qtVersion() >= QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed."); ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
return ret; return ret;
} }
...@@ -86,18 +86,18 @@ QString DesktopQtVersion::description() const ...@@ -86,18 +86,18 @@ QString DesktopQtVersion::description() const
Core::FeatureSet DesktopQtVersion::availableFeatures() const Core::FeatureSet DesktopQtVersion::availableFeatures() const
{ {
Core::FeatureSet features = QtSupport::BaseQtVersion::availableFeatures(); Core::FeatureSet features = BaseQtVersion::availableFeatures();
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_DESKTOP); features |= Core::FeatureSet(Constants::FEATURE_DESKTOP);
features |= Core::Feature(QtSupport::Constants::FEATURE_QMLPROJECT); features |= Core::Feature(Constants::FEATURE_QMLPROJECT);
return features; return features;
} }
QString DesktopQtVersion::platformName() const QString DesktopQtVersion::platformName() const
{ {
return QLatin1String(QtSupport::Constants::DESKTOP_PLATFORM); return QLatin1String(Constants::DESKTOP_PLATFORM);
} }
QString DesktopQtVersion::platformDisplayName() const QString DesktopQtVersion::platformDisplayName() const
{ {
return QLatin1String(QtSupport::Constants::DESKTOP_PLATFORM_TR); return QLatin1String(Constants::DESKTOP_PLATFORM_TR);
} }
...@@ -30,13 +30,12 @@ ...@@ -30,13 +30,12 @@
#ifndef DESKTOPQTVERSION_H #ifndef DESKTOPQTVERSION_H
#define DESKTOPQTVERSION_H #define DESKTOPQTVERSION_H
#include <qtsupport/baseqtversion.h> #include "baseqtversion.h"
namespace Qt4ProjectManager {
namespace QtSupport {
namespace Internal { namespace Internal {
class DesktopQtVersion : public QtSupport::BaseQtVersion class DesktopQtVersion : public BaseQtVersion
{ {
public: public:
DesktopQtVersion(); DesktopQtVersion();
...@@ -57,7 +56,7 @@ public: ...@@ -57,7 +56,7 @@ public:
QString platformDisplayName() const; QString platformDisplayName() const;
}; };
} } // Internal
} } // QtSupport
#endif // DESKTOPQTVERSION_H #endif // DESKTOPQTVERSION_H
...@@ -32,11 +32,11 @@ ...@@ -32,11 +32,11 @@
#include <QFileInfo> #include <QFileInfo>
using namespace Qt4ProjectManager; using namespace QtSupport;
using namespace Qt4ProjectManager::Internal; using namespace QtSupport::Internal;
DesktopQtVersionFactory::DesktopQtVersionFactory(QObject *parent) DesktopQtVersionFactory::DesktopQtVersionFactory(QObject *parent)
: QtSupport::QtVersionFactory(parent) : QtVersionFactory(parent)
{ {
} }
...@@ -48,10 +48,10 @@ DesktopQtVersionFactory::~DesktopQtVersionFactory() ...@@ -48,10 +48,10 @@ DesktopQtVersionFactory::~DesktopQtVersionFactory()
bool DesktopQtVersionFactory::canRestore(const QString &type) bool DesktopQtVersionFactory::canRestore(const QString &type)
{ {
return type == QLatin1String(QtSupport::Constants::DESKTOPQT); return type == QLatin1String(Constants::DESKTOPQT);
} }
QtSupport::BaseQtVersion *DesktopQtVersionFactory::restore(const QString &type, const QVariantMap &data) BaseQtVersion *DesktopQtVersionFactory::restore(const QString &type, const QVariantMap &data)
{ {
if (!canRestore(type)) if (!canRestore(type))
return 0; return 0;
...@@ -66,7 +66,7 @@ int DesktopQtVersionFactory::priority() const ...@@ -66,7 +66,7 @@ int DesktopQtVersionFactory::priority() const
return 0; return 0;
} }
QtSupport::BaseQtVersion *DesktopQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource) BaseQtVersion *DesktopQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
{ {
Q_UNUSED(evaluator); Q_UNUSED(evaluator);
// we are the fallback :) so we don't care what kind of qt it is // we are the fallback :) so we don't care what kind of qt it is
......
...@@ -30,26 +30,25 @@ ...@@ -30,26 +30,25 @@
#ifndef DESKTOPQTVERSIONFACTORY_H #ifndef DESKTOPQTVERSIONFACTORY_H
#define DESKTOPQTVERSIONFACTORY_H #define DESKTOPQTVERSIONFACTORY_H
#include <qtsupport/qtversionfactory.h> #include "qtversionfactory.h"
namespace Qt4ProjectManager{ namespace QtSupport {
namespace Internal { namespace Internal {
class DesktopQtVersionFactory : public QtSupport::QtVersionFactory class DesktopQtVersionFactory : public QtVersionFactory
{ {
public: public:
explicit DesktopQtVersionFactory(QObject *parent = 0); explicit DesktopQtVersionFactory(QObject *parent = 0);
~DesktopQtVersionFactory(); ~DesktopQtVersionFactory();
virtual bool canRestore(const QString &type); virtual bool canRestore(const QString &type);
virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data); virtual BaseQtVersion *restore(const QString &type, const QVariantMap &data);
virtual int priority() const; virtual int priority() const;
virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString()); virtual BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
}; };
} // Internal } // Internal
} // Qt4ProjectManager } // QtSupport
#endif // DESKTOPQTVERSIONFACTORY_H #endif // DESKTOPQTVERSIONFACTORY_H
...@@ -30,7 +30,13 @@ HEADERS += \ ...@@ -30,7 +30,13 @@ HEADERS += \
exampleslistmodel.h \ exampleslistmodel.h \
screenshotcropper.h \ screenshotcropper.h \
qtconfigwidget.h \ qtconfigwidget.h \
qtfeatureprovider.h qtfeatureprovider.h \
desktopqtversionfactory.h \
simulatorqtversionfactory.h \
desktopqtversion.h \
simulatorqtversion.h \
winceqtversionfactory.h \
winceqtversion.h
SOURCES += \ SOURCES += \
qtsupportplugin.cpp \ qtsupportplugin.cpp \
...@@ -53,7 +59,13 @@ SOURCES += \ ...@@ -53,7 +59,13 @@ SOURCES += \
qtparser.cpp \ qtparser.cpp \
exampleslistmodel.cpp \ exampleslistmodel.cpp \
screenshotcropper.cpp \ screenshotcropper.cpp \
qtconfigwidget.cpp qtconfigwidget.cpp \
desktopqtversionfactory.cpp \
simulatorqtversionfactory.cpp \
desktopqtversion.cpp \
simulatorqtversion.cpp \
winceqtversionfactory.cpp \
winceqtversion.cpp
greaterThan(QT_MAJOR_VERSION, 4) { greaterThan(QT_MAJOR_VERSION, 4) {
QT += quick QT += quick
......
...@@ -112,6 +112,18 @@ QtcPlugin { ...@@ -112,6 +112,18 @@ QtcPlugin {
"images/qt_qrc.png", "images/qt_qrc.png",
] ]
Group {
name: "QtVersion"
files: [
"desktopqtversion.cpp", "desktopqtversion.h",
"desktopqtversionfactory.cpp", "desktopqtversionfactory.h",
"simulatorqtversion.cpp", "simulatorqtversion.h",
"simulatorqtversionfactory.cpp", "simulatorqtversionfactory.h",
"winceqtversion.cpp", "winceqtversion.h",
"winceqtversionfactory.cpp", "winceqtversionfactory.h",
]
}
Group { Group {
name: "Getting Started Welcome Page" name: "Getting Started Welcome Page"
condition: QtcFunctions.versionIsAtLeast(Qt.core.version, "5.1") condition: QtcFunctions.versionIsAtLeast(Qt.core.version, "5.1")
......
...@@ -30,11 +30,14 @@ ...@@ -30,11 +30,14 @@
#include "qtsupportplugin.h" #include "qtsupportplugin.h"
#include "customexecutablerunconfiguration.h" #include "customexecutablerunconfiguration.h"
#include "qtoptionspage.h" #include "desktopqtversionfactory.h"
#include "qtfeatureprovider.h"
#include "qtkitinformation.h" #include "qtkitinformation.h"
#include "qtoptionspage.h"
#include "qtversionmanager.h" #include "qtversionmanager.h"
#include "qtfeatureprovider.h" #include "simulatorqtversionfactory.h"
#include "uicodemodelsupport.h" #include "uicodemodelsupport.h"
#include "winceqtversionfactory.h"
#include "profilereader.h" #include "profilereader.h"
...@@ -70,6 +73,9 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes ...@@ -70,6 +73,9 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
return false; return false;
addAutoReleasedObject(new QtVersionManager); addAutoReleasedObject(new QtVersionManager);
addAutoReleasedObject(new DesktopQtVersionFactory);
addAutoReleasedObject(new SimulatorQtVersionFactory);
addAutoReleasedObject(new WinCeQtVersionFactory);
addAutoReleasedObject(new UiCodeModelManager); addAutoReleasedObject(new UiCodeModelManager);
QtFeatureProvider *featureMgr = new QtFeatureProvider; QtFeatureProvider *featureMgr = new QtFeatureProvider;
......
...@@ -28,23 +28,23 @@ ...@@ -28,23 +28,23 @@
****************************************************************************/ ****************************************************************************/
#include "simulatorqtversion.h" #include "simulatorqtversion.h"
#include "qtsupportconstants.h"
#include <qtsupport/qtsupportconstants.h>
#include <coreplugin/featureprovider.h> #include <coreplugin/featureprovider.h>
#include <QCoreApplication> #include <QCoreApplication>
using namespace Qt4ProjectManager; using namespace QtSupport;
using namespace Qt4ProjectManager::Internal; using namespace QtSupport::Internal;
SimulatorQtVersion::SimulatorQtVersion() SimulatorQtVersion::SimulatorQtVersion()
: QtSupport::BaseQtVersion() : BaseQtVersion()
{ {
} }
SimulatorQtVersion::SimulatorQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource) SimulatorQtVersion::SimulatorQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
: QtSupport::BaseQtVersion(path, isAutodetected, autodetectionSource) : BaseQtVersion(path, isAutodetected, autodetectionSource)
{ {
setDisplayName(defaultDisplayName(qtVersionString(), path, false)); setDisplayName(defaultDisplayName(qtVersionString(), path, false));
} }
...@@ -61,15 +61,15 @@ SimulatorQtVersion *SimulatorQtVersion::clone() const ...@@ -61,15 +61,15 @@ SimulatorQtVersion *SimulatorQtVersion::clone() const
QString SimulatorQtVersion::type() const QString SimulatorQtVersion::type() const
{ {
return QLatin1String(QtSupport::Constants::SIMULATORQT); return QLatin1String(Constants::SIMULATORQT);
} }
QStringList SimulatorQtVersion::warningReason() const QStringList SimulatorQtVersion::warningReason() const
{ {
QStringList ret = BaseQtVersion::warningReason(); QStringList ret = BaseQtVersion::warningReason();
if (qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0) && qmlsceneCommand().isEmpty()) if (qtVersion() >= QtVersionNumber(5, 0, 0) && qmlsceneCommand().isEmpty())
ret << QCoreApplication::translate("QtVersion", "No qmlscene installed."); ret << QCoreApplication::translate("QtVersion", "No qmlscene installed.");
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty()) if (qtVersion() >= QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed."); ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
return ret; return ret;
} }
...@@ -87,9 +87,8 @@ QString SimulatorQtVersion::description() const ...@@ -87,9 +87,8 @@ QString SimulatorQtVersion::description() const
Core::FeatureSet SimulatorQtVersion::availableFeatures() const Core::FeatureSet SimulatorQtVersion::availableFeatures() const
{ {
Core::FeatureSet features = QtSupport::BaseQtVersion::availableFeatures(); Core::FeatureSet features = BaseQtVersion::availableFeatures();
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE); features |= Core::FeatureSet(Constants::FEATURE_MOBILE);
return features; return features;
} }
......
...@@ -30,13 +30,12 @@ ...@@ -30,13 +30,12 @@
#ifndef SIMULATORQTVERSION_H #ifndef SIMULATORQTVERSION_H
#define SIMULATORQTVERSION_H #define SIMULATORQTVERSION_H
#include <qtsupport/baseqtversion.h> #include "baseqtversion.h"
namespace Qt4ProjectManager{
namespace QtSupport {
namespace Internal { namespace Internal {
class SimulatorQtVersion : public QtSupport::BaseQtVersion class SimulatorQtVersion : public BaseQtVersion
{ {
public: public:
SimulatorQtVersion(); SimulatorQtVersion();
...@@ -56,7 +55,7 @@ public: ...@@ -56,7 +55,7 @@ public:
bool supportsPlatform(const QString &platformName) const; bool supportsPlatform(const QString &platformName) const;
}; };