Move a lot of qmake independent classes to a new plugin qtsupport

Also adjust qmldumptool to remove the dependency on qt4project/qmlproject, by
passing in the qtversion instead of figuring it out in qmldumptool.

Change-Id: Ie6ac582d36bfef290313c0716b33b62fcf42630c
Reviewed-on: http://codereview.qt.nokia.com/70
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
dt
2011-05-20 21:40:53 +02:00
committed by Daniel Teske
parent dcd34febab
commit 754be1bcfc
135 changed files with 1124 additions and 733 deletions

View File

@@ -18,6 +18,6 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<dependency name=\"TextEditor\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"QmlJSEditor\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"Debugger\" version=\"$$QTCREATOR_VERSION\" />
<dependency name=\"Qt4ProjectManager\" version=\"$$QTCREATOR_VERSION\" />
<dependency name=\"QtSupport\" version=\"$$QTCREATOR_VERSION\" />
</dependencyList>
</plugin>

View File

@@ -41,8 +41,9 @@
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
#include <extensionsystem/pluginmanager.h>
#include <qt4projectmanager/qmldumptool.h>
#include <qt4projectmanager/baseqtversion.h>
#include <qtsupport/qmldumptool.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtversionmanager.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <utils/fileutils.h>
@@ -142,7 +143,10 @@ void QmlProject::refresh(RefreshOptions options)
QmlJS::ModelManagerInterface::ProjectInfo pinfo(this);
pinfo.sourceFiles = files();
pinfo.importPaths = importPaths();
Qt4ProjectManager::QmlDumpTool::pathAndEnvironment(this, false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment);
QtSupport::BaseQtVersion *version = 0;
if (QmlProjectRunConfiguration *rc = qobject_cast<QmlProjectRunConfiguration *>(activeTarget()->activeRunConfiguration()))
version = rc->qtVersion();
QtSupport::QmlDumpTool::pathAndEnvironment(this, version, false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment);
m_modelManager->updateProjectInfo(pinfo);
}
@@ -192,7 +196,7 @@ QStringList QmlProject::importPaths() const
const QmlProjectRunConfiguration *runConfig =
qobject_cast<QmlProjectRunConfiguration*>(activeTarget()->activeRunConfiguration());
if (runConfig) {
const Qt4ProjectManager::BaseQtVersion *qtVersion = runConfig->qtVersion();
const QtSupport::BaseQtVersion *qtVersion = runConfig->qtVersion();
if (qtVersion && qtVersion->isValid()) {
const QString qtVersionImportPath = qtVersion->versionInfo().value("QT_INSTALL_IMPORTS");
if (!qtVersionImportPath.isEmpty())

View File

@@ -36,7 +36,7 @@
#include <coreplugin/coreconstants.h>
#include <projectexplorer/customwizard/customwizard.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qtsupport/qtsupportconstants.h>
#include <QtGui/QIcon>
@@ -67,7 +67,7 @@ QmlProjectApplicationWizard::~QmlProjectApplicationWizard()
Core::BaseFileWizardParameters QmlProjectApplicationWizard::parameters()
{
Core::BaseFileWizardParameters parameters(ProjectWizard);
parameters.setIcon(QIcon(QLatin1String(Qt4ProjectManager::Constants::QML_WIZARD_ICON)));
parameters.setIcon(QIcon(QLatin1String(QtSupport::Constants::QML_WIZARD_ICON)));
parameters.setDisplayName(tr("Qt Quick UI"));
parameters.setId(QLatin1String("QB.QML Application"));
@@ -76,9 +76,9 @@ Core::BaseFileWizardParameters QmlProjectApplicationWizard::parameters()
"You can review Qt Quick UI projects in the QML Viewer and you need not build them. "
"You do not need to have the development environment installed "
"on your computer to create and run this type of projects."));
parameters.setCategory(QLatin1String(Qt4ProjectManager::Constants::QML_WIZARD_CATEGORY));
parameters.setDisplayCategory(QCoreApplication::translate(Qt4ProjectManager::Constants::QML_WIZARD_TR_SCOPE,
Qt4ProjectManager::Constants::QML_WIZARD_TR_CATEGORY));
parameters.setCategory(QLatin1String(QtSupport::Constants::QML_WIZARD_CATEGORY));
parameters.setDisplayCategory(QCoreApplication::translate(QtSupport::Constants::QML_WIZARD_TR_SCOPE,
QtSupport::Constants::QML_WIZARD_TR_CATEGORY));
return parameters;
}

View File

@@ -2,4 +2,4 @@ include(../../plugins/projectexplorer/projectexplorer.pri)
include(../../plugins/texteditor/texteditor.pri)
include(../../plugins/qmljseditor/qmljseditor.pri)
include(../../plugins/debugger/debugger.pri)
include(../../plugins/qt4projectmanager/qt4projectmanager.pri)
include(../../plugins/qtsupport/qtsupport.pri)

View File

@@ -41,9 +41,9 @@
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <qt4projectmanager/qtversionmanager.h>
#include <qt4projectmanager/qtoutputformatter.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qtsupport/qtversionmanager.h>
#include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtsupportconstants.h>
#ifdef Q_OS_WIN
#include <utils/winutils.h>
@@ -52,7 +52,7 @@
using Core::EditorManager;
using Core::ICore;
using Core::IEditor;
using Qt4ProjectManager::QtVersionManager;
using QtSupport::QtVersionManager;
using namespace QmlProjectManager::Internal;
@@ -120,7 +120,7 @@ QmlProjectTarget *QmlProjectRunConfiguration::qmlTarget() const
QString QmlProjectRunConfiguration::viewerPath() const
{
Qt4ProjectManager::BaseQtVersion *version = qtVersion();
QtSupport::BaseQtVersion *version = qtVersion();
if (!version) {
return QString();
} else {
@@ -130,7 +130,7 @@ QString QmlProjectRunConfiguration::viewerPath() const
QString QmlProjectRunConfiguration::observerPath() const
{
Qt4ProjectManager::BaseQtVersion *version = qtVersion();
QtSupport::BaseQtVersion *version = qtVersion();
if (!version) {
return QString();
} else {
@@ -195,13 +195,13 @@ QString QmlProjectRunConfiguration::canonicalCapsPath(const QString &fileName)
}
Qt4ProjectManager::BaseQtVersion *QmlProjectRunConfiguration::qtVersion() const
QtSupport::BaseQtVersion *QmlProjectRunConfiguration::qtVersion() const
{
if (m_qtVersionId == -1)
return 0;
QtVersionManager *versionManager = QtVersionManager::instance();
Qt4ProjectManager::BaseQtVersion *version = versionManager->version(m_qtVersionId);
QtSupport::QtVersionManager *versionManager = QtSupport::QtVersionManager::instance();
QtSupport::BaseQtVersion *version = versionManager->version(m_qtVersionId);
QTC_ASSERT(version, return 0);
return version;
@@ -216,7 +216,7 @@ QWidget *QmlProjectRunConfiguration::createConfigurationWidget()
Utils::OutputFormatter *QmlProjectRunConfiguration::createOutputFormatter() const
{
return new Qt4ProjectManager::QtOutputFormatter(qmlTarget()->qmlProject());
return new QtSupport::QtOutputFormatter(qmlTarget()->qmlProject());
}
QmlProjectRunConfiguration::MainScriptSource QmlProjectRunConfiguration::mainScriptSource() const
@@ -383,7 +383,7 @@ void QmlProjectRunConfiguration::updateQtVersions()
|| !isValidVersion(qtVersions->version(m_qtVersionId))) {
int newVersionId = -1;
// take first one you find
foreach (Qt4ProjectManager::BaseQtVersion *version, qtVersions->validVersions()) {
foreach (QtSupport::BaseQtVersion *version, qtVersions->validVersions()) {
if (isValidVersion(version)) {
newVersionId = version->uniqueId();
break;
@@ -395,11 +395,11 @@ void QmlProjectRunConfiguration::updateQtVersions()
updateEnabled();
}
bool QmlProjectRunConfiguration::isValidVersion(Qt4ProjectManager::BaseQtVersion *version)
bool QmlProjectRunConfiguration::isValidVersion(QtSupport::BaseQtVersion *version)
{
if (version
&& (version->supportsTargetId(Qt4ProjectManager::Constants::DESKTOP_TARGET_ID)
|| version->supportsTargetId(Qt4ProjectManager::Constants::QT_SIMULATOR_TARGET_ID))
&& (version->type() == QtSupport::Constants::DESKTOPQT
|| version->type() == QtSupport::Constants::SIMULATORQT)
&& !version->qmlviewerCommand().isEmpty()) {
return true;
}

View File

@@ -50,7 +50,7 @@ namespace Utils {
class EnvironmentItem;
}
namespace Qt4ProjectManager {
namespace QtSupport {
class BaseQtVersion;
}
@@ -82,7 +82,7 @@ public:
QString viewerArguments() const;
QString workingDirectory() const;
int qtVersionId() const;
Qt4ProjectManager::BaseQtVersion *qtVersion() const;
QtSupport::BaseQtVersion *qtVersion() const;
enum MainScriptSource {
FileInEditor,
@@ -119,7 +119,7 @@ protected:
private:
void ctor();
static bool isValidVersion(Qt4ProjectManager::BaseQtVersion *version);
static bool isValidVersion(QtSupport::BaseQtVersion *version);
void setQtVersionId(int id);
static QString canonicalCapsPath(const QString &filePath);

View File

@@ -43,8 +43,8 @@
#include <utils/detailswidget.h>
#include <utils/environment.h>
#include <utils/qtcassert.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qt4projectmanager/qtversionmanager.h>
#include <qtsupport/qtsupportconstants.h>
#include <qtsupport/qtversionmanager.h>
#include <QtGui/QLineEdit>
#include <QtGui/QComboBox>
@@ -55,7 +55,7 @@
using Core::ICore;
using Utils::DebuggerLanguageChooser;
using Qt4ProjectManager::QtVersionManager;
using QtSupport::QtVersionManager;
namespace QmlProjectManager {
namespace Internal {
@@ -280,8 +280,8 @@ void QmlProjectRunConfigurationWidget::qmlDebugServerPortChanged(uint port)
void QmlProjectRunConfigurationWidget::manageQtVersions()
{
ICore *core = ICore::instance();
core->showOptionsDialog(Qt4ProjectManager::Constants::QT_SETTINGS_CATEGORY,
Qt4ProjectManager::Constants::QTVERSION_SETTINGS_PAGE_ID);
core->showOptionsDialog(QtSupport::Constants::QT_SETTINGS_CATEGORY,
QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID);
}
void QmlProjectRunConfigurationWidget::updateQtVersionComboBox()
@@ -289,7 +289,7 @@ void QmlProjectRunConfigurationWidget::updateQtVersionComboBox()
m_qtVersionComboBox->clear();
QtVersionManager *qtVersions = QtVersionManager::instance();
foreach (Qt4ProjectManager::BaseQtVersion *version, qtVersions->validVersions()) {
foreach (QtSupport::BaseQtVersion *version, qtVersions->validVersions()) {
if (m_runConfiguration->isValidVersion(version)) {
m_qtVersionComboBox->addItem(version->displayName(), version->uniqueId());
}

View File

@@ -39,7 +39,7 @@
#include <projectexplorer/applicationlauncher.h>
#include <projectexplorer/target.h>
#include <projectexplorer/project.h>
#include <qt4projectmanager/qtversionmanager.h>
#include <qtsupport/qtversionmanager.h>
#include <utils/environment.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
@@ -50,9 +50,9 @@
#include <debugger/debuggerengine.h>
#include <debugger/debuggerstartparameters.h>
#include <qmljsinspector/qmljsinspectorconstants.h>
#include <qt4projectmanager/qtversionmanager.h>
#include <qt4projectmanager/qmlobservertool.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qtsupport/qtversionmanager.h>
#include <qtsupport/qmlobservertool.h>
#include <qtsupport/qtsupportconstants.h>
#include <QtGui/QApplication>
#include <QtGui/QLabel>
@@ -163,7 +163,7 @@ bool QmlProjectRunControlFactory::canRun(RunConfiguration *runConfiguration,
if (!(config->qtVersion() && config->qtVersion()->needsQmlDebuggingLibrary())
|| !config->observerPath().isEmpty())
return true;
if (config->qtVersion() && Qt4ProjectManager::QmlObserverTool::canBuild(config->qtVersion()))
if (config->qtVersion() && QtSupport::QmlObserverTool::canBuild(config->qtVersion()))
return true;
}
@@ -236,8 +236,8 @@ void QmlProjectRunControlFactory::showQmlObserverToolWarning()
dialog.exec();
if (dialog.clickedButton() == qtPref) {
Core::ICore::instance()->showOptionsDialog(
Qt4ProjectManager::Constants::QT_SETTINGS_CATEGORY,
Qt4ProjectManager::Constants::QTVERSION_SETTINGS_PAGE_ID);
QtSupport::Constants::QT_SETTINGS_CATEGORY,
QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID);
}
}