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 @@
#include "qt4buildconfiguration.h"
#include "qmakebuildinfo.h"
#include "qmakekitinformation.h"
#include "qt4project.h"
#include "qt4projectconfigwidget.h"
#include "qt4projectmanagerconstants.h"
......@@ -49,7 +50,6 @@
#include <projectexplorer/toolchainmanager.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtversionmanager.h>
#include <qt4projectmanager/qmakekitinformation.h>
#include <utils/qtcassert.h>
#include <QDebug>
......
......@@ -61,8 +61,7 @@ HEADERS += \
librarydetailscontroller.h \
findqt4profiles.h \
qt4projectmanager_global.h \
winceqtversionfactory.h \
winceqtversion.h \
qt4runconfiguration.h \
profilecompletionassist.h
SOURCES += \
......@@ -119,8 +118,7 @@ SOURCES += \
addlibrarywizard.cpp \
librarydetailscontroller.cpp \
findqt4profiles.cpp \
winceqtversionfactory.cpp \
winceqtversion.cpp \
qt4runconfiguration.cpp \
profilecompletionassist.cpp
FORMS += makestep.ui \
......@@ -136,5 +134,4 @@ FORMS += makestep.ui \
RESOURCES += qt4projectmanager.qrc \
wizards/wizards.qrc
include(qt-desktop/qt-desktop.pri)
include(customwidgetwizard/customwidgetwizard.pri)
......@@ -51,8 +51,7 @@ QtcPlugin {
"qt4projectmanagerconstants.h",
"qt4projectmanagerplugin.cpp", "qt4projectmanagerplugin.h",
"qtmodulesinfo.cpp", "qtmodulesinfo.h",
"winceqtversion.cpp", "winceqtversion.h",
"winceqtversionfactory.cpp", "winceqtversionfactory.h"
"qt4runconfiguration.cpp", "qt4runconfiguration.h",
]
}
......@@ -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 {
name: "Wizards"
prefix: "wizards/"
......
......@@ -34,6 +34,7 @@
#include "qmakestep.h"
#include "makestep.h"
#include "qt4buildconfiguration.h"
#include "qt4runconfiguration.h"
#include "wizards/consoleappwizard.h"
#include "wizards/guiappwizard.h"
#include "wizards/librarywizard.h"
......@@ -49,10 +50,6 @@
#include "qt4project.h"
#include "externaleditors.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 "profilehighlighterfactory.h"
......@@ -149,10 +146,6 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
addAutoReleasedObject(new DesignerExternalEditor);
addAutoReleasedObject(new LinguistExternalEditor);
addAutoReleasedObject(new DesktopQtVersionFactory);
addAutoReleasedObject(new SimulatorQtVersionFactory);
addAutoReleasedObject(new WinCeQtVersionFactory);
addAutoReleasedObject(new ProFileCompletionAssistProvider);
addAutoReleasedObject(new ProFileHoverHandler(this));
addAutoReleasedObject(new ProFileHighlighterFactory);
......
......@@ -29,9 +29,9 @@
#include "qt4runconfiguration.h"
#include "../qt4nodes.h"
#include "../qt4project.h"
#include "../qt4buildconfiguration.h"
#include "qt4nodes.h"
#include "qt4project.h"
#include "qt4buildconfiguration.h"
#include <coreplugin/coreconstants.h>
#include <projectexplorer/localenvironmentaspect.h>
......
......@@ -28,14 +28,14 @@
****************************************************************************/
#include "desktopqtversion.h"
#include "qtsupportconstants.h"
#include <qtsupport/qtsupportconstants.h>
#include <coreplugin/featureprovider.h>
#include <QCoreApplication>
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using namespace QtSupport;
using namespace QtSupport::Internal;
DesktopQtVersion::DesktopQtVersion()
: BaseQtVersion()
......@@ -61,15 +61,15 @@ DesktopQtVersion *DesktopQtVersion::clone() const
QString DesktopQtVersion::type() const
{
return QLatin1String(QtSupport::Constants::DESKTOPQT);
return QLatin1String(Constants::DESKTOPQT);
}
QStringList DesktopQtVersion::warningReason() const
{
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.");
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
if (qtVersion() >= QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
return ret;
}
......@@ -86,18 +86,18 @@ QString DesktopQtVersion::description() const
Core::FeatureSet DesktopQtVersion::availableFeatures() const
{
Core::FeatureSet features = QtSupport::BaseQtVersion::availableFeatures();
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_DESKTOP);
features |= Core::Feature(QtSupport::Constants::FEATURE_QMLPROJECT);
Core::FeatureSet features = BaseQtVersion::availableFeatures();
features |= Core::FeatureSet(Constants::FEATURE_DESKTOP);
features |= Core::Feature(Constants::FEATURE_QMLPROJECT);
return features;
}
QString DesktopQtVersion::platformName() const
{
return QLatin1String(QtSupport::Constants::DESKTOP_PLATFORM);
return QLatin1String(Constants::DESKTOP_PLATFORM);
}
QString DesktopQtVersion::platformDisplayName() const
{
return QLatin1String(QtSupport::Constants::DESKTOP_PLATFORM_TR);
return QLatin1String(Constants::DESKTOP_PLATFORM_TR);
}
......@@ -30,13 +30,12 @@
#ifndef DESKTOPQTVERSION_H
#define DESKTOPQTVERSION_H
#include <qtsupport/baseqtversion.h>
namespace Qt4ProjectManager {
#include "baseqtversion.h"
namespace QtSupport {
namespace Internal {
class DesktopQtVersion : public QtSupport::BaseQtVersion
class DesktopQtVersion : public BaseQtVersion
{
public:
DesktopQtVersion();
......@@ -57,7 +56,7 @@ public:
QString platformDisplayName() const;
};
}
}
} // Internal
} // QtSupport
#endif // DESKTOPQTVERSION_H
......@@ -32,11 +32,11 @@
#include <QFileInfo>
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using namespace QtSupport;
using namespace QtSupport::Internal;
DesktopQtVersionFactory::DesktopQtVersionFactory(QObject *parent)
: QtSupport::QtVersionFactory(parent)
: QtVersionFactory(parent)
{
}
......@@ -48,10 +48,10 @@ DesktopQtVersionFactory::~DesktopQtVersionFactory()
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))
return 0;
......@@ -66,7 +66,7 @@ int DesktopQtVersionFactory::priority() const
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);
// we are the fallback :) so we don't care what kind of qt it is
......
......@@ -30,26 +30,25 @@
#ifndef DESKTOPQTVERSIONFACTORY_H
#define DESKTOPQTVERSIONFACTORY_H
#include <qtsupport/qtversionfactory.h>
#include "qtversionfactory.h"
namespace Qt4ProjectManager{
namespace QtSupport {
namespace Internal {
class DesktopQtVersionFactory : public QtSupport::QtVersionFactory
class DesktopQtVersionFactory : public QtVersionFactory
{
public:
explicit DesktopQtVersionFactory(QObject *parent = 0);
~DesktopQtVersionFactory();
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 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
} // Qt4ProjectManager
} // QtSupport
#endif // DESKTOPQTVERSIONFACTORY_H
......@@ -30,7 +30,13 @@ HEADERS += \
exampleslistmodel.h \
screenshotcropper.h \
qtconfigwidget.h \
qtfeatureprovider.h
qtfeatureprovider.h \
desktopqtversionfactory.h \
simulatorqtversionfactory.h \
desktopqtversion.h \
simulatorqtversion.h \
winceqtversionfactory.h \
winceqtversion.h
SOURCES += \
qtsupportplugin.cpp \
......@@ -53,7 +59,13 @@ SOURCES += \
qtparser.cpp \
exampleslistmodel.cpp \
screenshotcropper.cpp \
qtconfigwidget.cpp
qtconfigwidget.cpp \
desktopqtversionfactory.cpp \
simulatorqtversionfactory.cpp \
desktopqtversion.cpp \
simulatorqtversion.cpp \
winceqtversionfactory.cpp \
winceqtversion.cpp
greaterThan(QT_MAJOR_VERSION, 4) {
QT += quick
......
......@@ -112,6 +112,18 @@ QtcPlugin {
"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 {
name: "Getting Started Welcome Page"
condition: QtcFunctions.versionIsAtLeast(Qt.core.version, "5.1")
......
......@@ -30,11 +30,14 @@
#include "qtsupportplugin.h"
#include "customexecutablerunconfiguration.h"
#include "qtoptionspage.h"
#include "desktopqtversionfactory.h"
#include "qtfeatureprovider.h"
#include "qtkitinformation.h"
#include "qtoptionspage.h"
#include "qtversionmanager.h"
#include "qtfeatureprovider.h"
#include "simulatorqtversionfactory.h"
#include "uicodemodelsupport.h"
#include "winceqtversionfactory.h"
#include "profilereader.h"
......@@ -70,6 +73,9 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
return false;
addAutoReleasedObject(new QtVersionManager);
addAutoReleasedObject(new DesktopQtVersionFactory);
addAutoReleasedObject(new SimulatorQtVersionFactory);
addAutoReleasedObject(new WinCeQtVersionFactory);
addAutoReleasedObject(new UiCodeModelManager);
QtFeatureProvider *featureMgr = new QtFeatureProvider;
......
......@@ -28,23 +28,23 @@
****************************************************************************/
#include "simulatorqtversion.h"
#include "qtsupportconstants.h"
#include <qtsupport/qtsupportconstants.h>
#include <coreplugin/featureprovider.h>
#include <QCoreApplication>
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using namespace QtSupport;
using namespace QtSupport::Internal;
SimulatorQtVersion::SimulatorQtVersion()
: QtSupport::BaseQtVersion()
: BaseQtVersion()
{
}
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));
}
......@@ -61,15 +61,15 @@ SimulatorQtVersion *SimulatorQtVersion::clone() const
QString SimulatorQtVersion::type() const
{
return QLatin1String(QtSupport::Constants::SIMULATORQT);
return QLatin1String(Constants::SIMULATORQT);
}
QStringList SimulatorQtVersion::warningReason() const
{
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.");
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
if (qtVersion() >= QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
return ret;
}
......@@ -87,9 +87,8 @@ QString SimulatorQtVersion::description() const
Core::FeatureSet SimulatorQtVersion::availableFeatures() const
{
Core::FeatureSet features = QtSupport::BaseQtVersion::availableFeatures();
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE);
Core::FeatureSet features = BaseQtVersion::availableFeatures();
features |= Core::FeatureSet(Constants::FEATURE_MOBILE);
return features;
}
......
......@@ -30,13 +30,12 @@
#ifndef SIMULATORQTVERSION_H
#define SIMULATORQTVERSION_H
#include <qtsupport/baseqtversion.h>
namespace Qt4ProjectManager{
#include "baseqtversion.h"
namespace QtSupport {
namespace Internal {
class SimulatorQtVersion : public QtSupport::BaseQtVersion
class SimulatorQtVersion : public BaseQtVersion
{
public:
SimulatorQtVersion();
......@@ -56,7 +55,7 @@ public:
bool supportsPlatform(const QString &platformName) const;
};
}
}
} // Internal
} // QtSupport
#endif // SIMULATORQTVERSION_H
......@@ -29,14 +29,13 @@
#include "simulatorqtversionfactory.h"
#include "simulatorqtversion.h"
#include <qtsupport/qtsupportconstants.h>
#include <qtsupport/profilereader.h>
#include "qtsupportconstants.h"
#include "profilereader.h"
#include <QFileInfo>
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using namespace QtSupport;
using namespace QtSupport::Internal;
SimulatorQtVersionFactory::SimulatorQtVersionFactory(QObject *parent)
: QtVersionFactory(parent)
......@@ -51,14 +50,14 @@ SimulatorQtVersionFactory::~SimulatorQtVersionFactory()
bool SimulatorQtVersionFactory::canRestore(const QString &type)
{
return type == QLatin1String(QtSupport::Constants::SIMULATORQT);
return type == QLatin1String(Constants::SIMULATORQT);
}
QtSupport::BaseQtVersion *SimulatorQtVersionFactory::restore(const QString &type, const QVariantMap &data)
BaseQtVersion *SimulatorQtVersionFactory::restore(const QString &type, const QVariantMap &data)
{
if (!canRestore(type))
return 0;
QtSupport::BaseQtVersion *v = new SimulatorQtVersion;
BaseQtVersion *v = new SimulatorQtVersion;
v->fromMap(data);
return v;
}
......@@ -69,7 +68,7 @@ int SimulatorQtVersionFactory::priority() const
return 50;
}
QtSupport::BaseQtVersion *SimulatorQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
BaseQtVersion *SimulatorQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
{
QFileInfo fi = qmakePath.toFileInfo();
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
......
......@@ -30,26 +30,25 @@
#ifndef SIMULATORQTVERSIONFACTORY_H
#define SIMULATORQTVERSIONFACTORY_H
#include <qtsupport/qtversionfactory.h>
#include "qtversionfactory.h"
namespace Qt4ProjectManager {
namespace QtSupport {
namespace Internal {
class SimulatorQtVersionFactory : public QtSupport::QtVersionFactory
class SimulatorQtVersionFactory : public QtVersionFactory
{
public:
explicit SimulatorQtVersionFactory(QObject *parent = 0);
~SimulatorQtVersionFactory();
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 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
} // Qt4ProjectManager
} // QtSupport
#endif // SIMULATORQTVERSIONFACTORY_H
......@@ -28,22 +28,23 @@
****************************************************************************/
#include "winceqtversion.h"
#include <qtsupport/qtsupportconstants.h>
#include "qtsupportconstants.h"
#include <QCoreApplication>
#include <QStringList>
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using namespace QtSupport;
using namespace QtSupport::Internal;
WinCeQtVersion::WinCeQtVersion()
: QtSupport::BaseQtVersion(),
: BaseQtVersion(),
m_archType(ProjectExplorer::Abi::ArmArchitecture)
{
}
WinCeQtVersion::WinCeQtVersion(const Utils::FileName &path, const QString &archType,
bool isAutodetected, const QString &autodetectionSource)
: QtSupport::BaseQtVersion(path, isAutodetected, autodetectionSource),
: BaseQtVersion(path, isAutodetected, autodetectionSource),
m_archType(ProjectExplorer::Abi::ArmArchitecture)
{
if (0 == archType.compare(QLatin1String("x86"), Qt::CaseInsensitive))
......@@ -64,7 +65,7 @@ WinCeQtVersion *WinCeQtVersion::clone() const
QString WinCeQtVersion::type() const
{
return QLatin1String(QtSupport::Constants::WINCEQT);
return QLatin1String(Constants::WINCEQT);
}
QList<ProjectExplorer::Abi> WinCeQtVersion::detectQtAbis() const
......@@ -104,10 +105,10 @@ void WinCeQtVersion::fromMap(const QVariantMap &map)
QString WinCeQtVersion::platformName() const
{
return QLatin1String(QtSupport::Constants::WINDOWS_CE_PLATFORM);
return QLatin1String(Constants::WINDOWS_CE_PLATFORM);
}
QString WinCeQtVersion::platformDisplayName() const
{
return QLatin1String(QtSupport::Constants::WINDOWS_CE_PLATFORM_TR);
return QLatin1String(Constants::WINDOWS_CE_PLATFORM_TR);
}
......@@ -30,12 +30,12 @@
#ifndef WINCEQTVERSION_H
#define WINCEQTVERSION_H
#include <qtsupport/baseqtversion.h>
#include "baseqtversion.h"
namespace Qt4ProjectManager {
namespace QtSupport {
namespace Internal {
class WinCeQtVersion : public QtSupport::BaseQtVersion
class WinCeQtVersion : public BaseQtVersion
{
public:
WinCeQtVersion();
......@@ -59,7 +59,7 @@ private:
ProjectExplorer::Abi::Architecture m_archType;
};
} // namespace Internal
} // namespace Qt4ProjectManager
} // Internal
} // QtSupport
#endif // WINCEQTVERSION_H
......@@ -29,12 +29,13 @@
#include "winceqtversionfactory.h"
#include "winceqtversion.h"
#include <qtsupport/qtsupportconstants.h>
#include <qtsupport/profilereader.h>
#include "qtsupportconstants.h"
#include "profilereader.h"
#include <QFileInfo>
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using namespace QtSupport;
using namespace QtSupport::Internal;
WinCeQtVersionFactory::WinCeQtVersionFactory(QObject *parent)
: QtVersionFactory(parent)
......@@ -49,10 +50,10 @@ WinCeQtVersionFactory::~WinCeQtVersionFactory()
bool WinCeQtVersionFactory::canRestore(const QString &type)