forked from qt-creator/qt-creator
Qt Version refactoring
Split up target specific code into subclasses. Also change Qt4BuildConfiguration to allow a null qtversion. Remove code that relied on always having a qt version. Also make it possible to remove all qt versions. Completly change the qt in path autodetection to be only a fall back if no configuration was found. Note: For now the old settings are not removed, as such 2.2 and master can coexist. Reviewed-By: hunger
This commit is contained in:
@@ -211,6 +211,7 @@ void BuildConfiguration::setToolChain(ProjectExplorer::ToolChain *tc)
|
||||
return;
|
||||
m_toolChain = tc;
|
||||
emit toolChainChanged();
|
||||
emit environmentChanged();
|
||||
}
|
||||
|
||||
Utils::Environment BuildConfiguration::baseEnvironment() const
|
||||
|
@@ -33,6 +33,8 @@
|
||||
#ifndef HEADERPATH_H
|
||||
#define HEADERPATH_H
|
||||
|
||||
#include <QtCore/QString>
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
@@ -42,7 +42,7 @@
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <qt4projectmanager/qmldumptool.h>
|
||||
#include <qt4projectmanager/qtversionmanager.h>
|
||||
#include <qt4projectmanager/baseqtversion.h>
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
@@ -192,7 +192,7 @@ QStringList QmlProject::importPaths() const
|
||||
const QmlProjectRunConfiguration *runConfig =
|
||||
qobject_cast<QmlProjectRunConfiguration*>(activeTarget()->activeRunConfiguration());
|
||||
if (runConfig) {
|
||||
const Qt4ProjectManager::QtVersion *qtVersion = runConfig->qtVersion();
|
||||
const Qt4ProjectManager::BaseQtVersion *qtVersion = runConfig->qtVersion();
|
||||
if (qtVersion && qtVersion->isValid()) {
|
||||
const QString qtVersionImportPath = qtVersion->versionInfo().value("QT_INSTALL_IMPORTS");
|
||||
if (!qtVersionImportPath.isEmpty())
|
||||
|
@@ -120,7 +120,7 @@ QmlProjectTarget *QmlProjectRunConfiguration::qmlTarget() const
|
||||
|
||||
QString QmlProjectRunConfiguration::viewerPath() const
|
||||
{
|
||||
Qt4ProjectManager::QtVersion *version = qtVersion();
|
||||
Qt4ProjectManager::BaseQtVersion *version = qtVersion();
|
||||
if (!version) {
|
||||
return QString();
|
||||
} else {
|
||||
@@ -130,7 +130,7 @@ QString QmlProjectRunConfiguration::viewerPath() const
|
||||
|
||||
QString QmlProjectRunConfiguration::observerPath() const
|
||||
{
|
||||
Qt4ProjectManager::QtVersion *version = qtVersion();
|
||||
Qt4ProjectManager::BaseQtVersion *version = qtVersion();
|
||||
if (!version) {
|
||||
return QString();
|
||||
} else {
|
||||
@@ -193,13 +193,13 @@ QString QmlProjectRunConfiguration::canonicalCapsPath(const QString &fileName)
|
||||
}
|
||||
|
||||
|
||||
Qt4ProjectManager::QtVersion *QmlProjectRunConfiguration::qtVersion() const
|
||||
Qt4ProjectManager::BaseQtVersion *QmlProjectRunConfiguration::qtVersion() const
|
||||
{
|
||||
if (m_qtVersionId == -1)
|
||||
return 0;
|
||||
|
||||
QtVersionManager *versionManager = QtVersionManager::instance();
|
||||
Qt4ProjectManager::QtVersion *version = versionManager->version(m_qtVersionId);
|
||||
Qt4ProjectManager::BaseQtVersion *version = versionManager->version(m_qtVersionId);
|
||||
QTC_ASSERT(version, return 0);
|
||||
|
||||
return version;
|
||||
@@ -381,7 +381,7 @@ void QmlProjectRunConfiguration::updateQtVersions()
|
||||
|| !isValidVersion(qtVersions->version(m_qtVersionId))) {
|
||||
int newVersionId = -1;
|
||||
// take first one you find
|
||||
foreach (Qt4ProjectManager::QtVersion *version, qtVersions->validVersions()) {
|
||||
foreach (Qt4ProjectManager::BaseQtVersion *version, qtVersions->validVersions()) {
|
||||
if (isValidVersion(version)) {
|
||||
newVersionId = version->uniqueId();
|
||||
break;
|
||||
@@ -393,7 +393,7 @@ void QmlProjectRunConfiguration::updateQtVersions()
|
||||
updateEnabled();
|
||||
}
|
||||
|
||||
bool QmlProjectRunConfiguration::isValidVersion(Qt4ProjectManager::QtVersion *version)
|
||||
bool QmlProjectRunConfiguration::isValidVersion(Qt4ProjectManager::BaseQtVersion *version)
|
||||
{
|
||||
if (version
|
||||
&& (version->supportsTargetId(Qt4ProjectManager::Constants::DESKTOP_TARGET_ID)
|
||||
|
@@ -51,7 +51,7 @@ namespace Utils {
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
}
|
||||
|
||||
namespace QmlProjectManager {
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
QString viewerArguments() const;
|
||||
QString workingDirectory() const;
|
||||
int qtVersionId() const;
|
||||
Qt4ProjectManager::QtVersion *qtVersion() const;
|
||||
Qt4ProjectManager::BaseQtVersion *qtVersion() const;
|
||||
|
||||
enum MainScriptSource {
|
||||
FileInEditor,
|
||||
@@ -119,7 +119,7 @@ protected:
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
static bool isValidVersion(Qt4ProjectManager::QtVersion *version);
|
||||
static bool isValidVersion(Qt4ProjectManager::BaseQtVersion *version);
|
||||
void setQtVersionId(int id);
|
||||
|
||||
static QString canonicalCapsPath(const QString &filePath);
|
||||
|
@@ -295,7 +295,7 @@ void QmlProjectRunConfigurationWidget::updateQtVersionComboBox()
|
||||
m_qtVersionComboBox->clear();
|
||||
|
||||
QtVersionManager *qtVersions = QtVersionManager::instance();
|
||||
foreach (Qt4ProjectManager::QtVersion *version, qtVersions->validVersions()) {
|
||||
foreach (Qt4ProjectManager::BaseQtVersion *version, qtVersions->validVersions()) {
|
||||
if (m_runConfiguration->isValidVersion(version)) {
|
||||
m_qtVersionComboBox->addItem(version->displayName(), version->uniqueId());
|
||||
}
|
||||
|
1124
src/plugins/qt4projectmanager/baseqtversion.cpp
Normal file
1124
src/plugins/qt4projectmanager/baseqtversion.cpp
Normal file
File diff suppressed because it is too large
Load Diff
245
src/plugins/qt4projectmanager/baseqtversion.h
Normal file
245
src/plugins/qt4projectmanager/baseqtversion.h
Normal file
@@ -0,0 +1,245 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef BASEQTVERSION_H
|
||||
#define BASEQTVERSION_H
|
||||
|
||||
#include "qt4projectmanager_global.h"
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/headerpath.h>
|
||||
#include <projectexplorer/task.h>
|
||||
#include <projectexplorer/ioutputparser.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
#include <QtCore/QVariantMap>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class ProFileEvaluator;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QT4PROJECTMANAGER_EXPORT QtVersionNumber
|
||||
{
|
||||
public:
|
||||
QtVersionNumber(int ma, int mi, int p);
|
||||
QtVersionNumber(const QString &versionString);
|
||||
QtVersionNumber();
|
||||
|
||||
int majorVersion;
|
||||
int minorVersion;
|
||||
int patchVersion;
|
||||
bool operator <(const QtVersionNumber &b) const;
|
||||
bool operator <=(const QtVersionNumber &b) const;
|
||||
bool operator >(const QtVersionNumber &b) const;
|
||||
bool operator >=(const QtVersionNumber &b) const;
|
||||
bool operator !=(const QtVersionNumber &b) const;
|
||||
bool operator ==(const QtVersionNumber &b) const;
|
||||
private:
|
||||
bool checkVersionString(const QString &version) const;
|
||||
};
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT QtConfigWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QtConfigWidget();
|
||||
signals:
|
||||
void changed();
|
||||
};
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT BaseQtVersion
|
||||
{
|
||||
friend class QtVersionManager;
|
||||
public:
|
||||
virtual ~BaseQtVersion();
|
||||
|
||||
virtual void fromMap(const QVariantMap &map);
|
||||
virtual BaseQtVersion *clone() const = 0;
|
||||
virtual bool equals(BaseQtVersion *other);
|
||||
|
||||
bool isAutodetected() const;
|
||||
QString autodetectionSource() const;
|
||||
|
||||
QString displayName() const;
|
||||
void setDisplayName(const QString &name);
|
||||
|
||||
// All valid Ids are >= 0
|
||||
int uniqueId() const;
|
||||
|
||||
virtual QString type() const = 0;
|
||||
|
||||
virtual QVariantMap toMap() const;
|
||||
virtual bool isValid() const;
|
||||
virtual QString invalidReason() const;
|
||||
|
||||
virtual bool toolChainAvailable(const QString &id) const;
|
||||
|
||||
virtual QString description() const = 0;
|
||||
virtual QString toHtml(bool verbose) const;
|
||||
|
||||
virtual bool supportsTargetId(const QString &id) const = 0;
|
||||
virtual QSet<QString> supportedTargetIds() const = 0;
|
||||
virtual QList<ProjectExplorer::Abi> qtAbis() const = 0;
|
||||
|
||||
// Returns the PREFIX, BINPREFIX, DOCPREFIX and similar information
|
||||
virtual QHash<QString,QString> versionInfo() const;
|
||||
virtual void addToEnvironment(Utils::Environment &env) const;
|
||||
|
||||
virtual QString sourcePath() const;
|
||||
// used by QtUiCodeModelSupport
|
||||
virtual QString uicCommand() const;
|
||||
virtual QString designerCommand() const;
|
||||
virtual QString linguistCommand() const;
|
||||
QString qmlviewerCommand() const;
|
||||
|
||||
virtual QString qtVersionString() const;
|
||||
virtual QtVersionNumber qtVersion() const;
|
||||
|
||||
bool hasExamples() const;
|
||||
QString examplesPath() const;
|
||||
|
||||
bool hasDocumentation() const;
|
||||
QString documentationPath() const;
|
||||
|
||||
bool hasDemos() const;
|
||||
QString demosPath() const;
|
||||
|
||||
virtual QList<ProjectExplorer::HeaderPath> systemHeaderPathes() const;
|
||||
virtual QString frameworkInstallPath() const;
|
||||
|
||||
// former local functions
|
||||
QString qmakeCommand() const;
|
||||
virtual QString systemRoot() const;
|
||||
|
||||
/// @returns the name of the mkspec
|
||||
QString mkspec() const;
|
||||
/// @returns the full path to the default directory
|
||||
/// specifally not the directory the symlink/ORIGINAL_QMAKESPEC points to
|
||||
QString mkspecPath() const;
|
||||
|
||||
enum QmakeBuildConfig
|
||||
{
|
||||
NoBuild = 1,
|
||||
DebugBuild = 2,
|
||||
BuildAll = 8
|
||||
};
|
||||
|
||||
Q_DECLARE_FLAGS(QmakeBuildConfigs, QmakeBuildConfig)
|
||||
|
||||
virtual QmakeBuildConfigs defaultBuildConfig() const;
|
||||
virtual void recheckDumper();
|
||||
virtual bool supportsShadowBuilds() const;
|
||||
|
||||
/// Check a .pro-file/Qt version combination on possible issues
|
||||
/// @return a list of tasks, ordered on severity (errors first, then
|
||||
/// warnings and finally info items.
|
||||
QList<ProjectExplorer::Task> reportIssues(const QString &proFile, const QString &buildDir, bool includeTargetSpecificErrors);
|
||||
|
||||
virtual ProjectExplorer::IOutputParser *createOutputParser() const;
|
||||
|
||||
static bool queryQMakeVariables(const QString &binary, QHash<QString, QString> *versionInfo);
|
||||
static QString mkspecFromVersionInfo(const QHash<QString, QString> &versionInfo);
|
||||
|
||||
|
||||
virtual bool supportsBinaryDebuggingHelper() const;
|
||||
virtual QString gdbDebuggingHelperLibrary() const;
|
||||
virtual QString qmlDebuggingHelperLibrary(bool debugVersion) const;
|
||||
virtual QString qmlDumpTool(bool debugVersion) const;
|
||||
virtual QString qmlObserverTool() const;
|
||||
virtual QStringList debuggingHelperLibraryLocations() const;
|
||||
|
||||
virtual bool hasGdbDebuggingHelper() const;
|
||||
virtual bool hasQmlDump() const;
|
||||
virtual bool hasQmlDebuggingLibrary() const;
|
||||
virtual bool hasQmlObserver() const;
|
||||
Utils::Environment qmlToolsEnvironment() const;
|
||||
|
||||
virtual QtConfigWidget *createConfigurationWidget() const;
|
||||
|
||||
protected:
|
||||
BaseQtVersion();
|
||||
BaseQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
|
||||
virtual QList<ProjectExplorer::Task> reportIssuesImpl(const QString &proFile, const QString &buildDir);
|
||||
|
||||
// helper function for desktop and simulator to figure out the supported abis based on the libraries
|
||||
static QString qtCorePath(const QHash<QString,QString> &versionInfo, const QString &versionString);
|
||||
static QList<ProjectExplorer::Abi> qtAbisFromLibrary(const QString &coreLibrary, bool mingw);
|
||||
|
||||
void ensureMkSpecParsed() const;
|
||||
virtual void parseMkSpec(ProFileEvaluator *) const;
|
||||
private:
|
||||
static int getUniqueId();
|
||||
void ctor(const QString &qmakePath);
|
||||
void updateSourcePath() const;
|
||||
void updateVersionInfo() const;
|
||||
QString findQtBinary(const QStringList &possibleName) const;
|
||||
void updateMkspec() const;
|
||||
void setId(int id); // used by the qtversionmanager for legacy restore
|
||||
QString m_displayName;
|
||||
int m_id;
|
||||
bool m_isAutodetected;
|
||||
QString m_autodetectionSource;
|
||||
|
||||
mutable QString m_sourcePath;
|
||||
mutable bool m_hasDebuggingHelper; // controlled by m_versionInfoUpToDate
|
||||
mutable bool m_hasQmlDump; // controlled by m_versionInfoUpToDate
|
||||
mutable bool m_hasQmlDebuggingLibrary; // controlled by m_versionInfoUpdate
|
||||
mutable bool m_hasQmlObserver; // controlled by m_versionInfoUpToDate
|
||||
|
||||
mutable bool m_mkspecUpToDate;
|
||||
mutable QString m_mkspec;
|
||||
mutable QString m_mkspecFullPath;
|
||||
|
||||
mutable bool m_mkspecReadUpToDate;
|
||||
mutable bool m_defaultConfigIsDebug;
|
||||
mutable bool m_defaultConfigIsDebugAndRelease;
|
||||
|
||||
mutable bool m_versionInfoUpToDate;
|
||||
mutable QHash<QString,QString> m_versionInfo;
|
||||
mutable bool m_notInstalled;
|
||||
mutable bool m_hasExamples;
|
||||
mutable bool m_hasDemos;
|
||||
mutable bool m_hasDocumentation;
|
||||
|
||||
mutable QString m_qmakeCommand;
|
||||
mutable QString m_qtVersionString;
|
||||
mutable QString m_uicCommand;
|
||||
mutable QString m_designerCommand;
|
||||
mutable QString m_linguistCommand;
|
||||
mutable QString m_qmlviewerCommand;
|
||||
|
||||
mutable bool m_qmakeIsExecutable;
|
||||
};
|
||||
}
|
||||
#endif // BASEQTVERSION_H
|
@@ -38,10 +38,10 @@
|
||||
namespace Qt4ProjectManager {
|
||||
struct QT4PROJECTMANAGER_EXPORT BuildConfigurationInfo {
|
||||
explicit BuildConfigurationInfo()
|
||||
: version(0), buildConfig(QtVersion::QmakeBuildConfig(0)), importing(false), temporaryQtVersion(false)
|
||||
: version(0), buildConfig(BaseQtVersion::QmakeBuildConfig(0)), importing(false), temporaryQtVersion(false)
|
||||
{}
|
||||
|
||||
explicit BuildConfigurationInfo(QtVersion *v, QtVersion::QmakeBuildConfigs bc,
|
||||
explicit BuildConfigurationInfo(BaseQtVersion *v, BaseQtVersion::QmakeBuildConfigs bc,
|
||||
const QString &aa, const QString &d, bool importing_ = false, bool temporaryQtVersion_ = false) :
|
||||
version(v), buildConfig(bc), additionalArguments(aa), directory(d), importing(importing_), temporaryQtVersion(temporaryQtVersion_)
|
||||
{ }
|
||||
@@ -51,8 +51,8 @@ struct QT4PROJECTMANAGER_EXPORT BuildConfigurationInfo {
|
||||
return version != 0;
|
||||
}
|
||||
|
||||
QtVersion *version;
|
||||
QtVersion::QmakeBuildConfigs buildConfig;
|
||||
BaseQtVersion *version;
|
||||
BaseQtVersion::QmakeBuildConfigs buildConfig;
|
||||
QString additionalArguments;
|
||||
QString directory;
|
||||
bool importing;
|
||||
|
@@ -34,8 +34,8 @@
|
||||
#include "qmldumptool.h"
|
||||
#include "qmlobservertool.h"
|
||||
#include "qmldebugginglibrary.h"
|
||||
#include <qt4projectmanager/baseqtversion.h>
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <qt4projectmanager/qtversionmanager.h>
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
#include <projectexplorer/debugginghelper.h>
|
||||
#include <projectexplorer/abi.h>
|
||||
@@ -47,8 +47,7 @@ using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
using ProjectExplorer::DebuggingHelperLibrary;
|
||||
|
||||
|
||||
DebuggingHelperBuildTask::DebuggingHelperBuildTask(const QtVersion *version, Tools tools) :
|
||||
DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version, Tools tools) :
|
||||
m_tools(tools & availableTools(version))
|
||||
{
|
||||
if (!version || !version->isValid())
|
||||
@@ -98,7 +97,7 @@ DebuggingHelperBuildTask::~DebuggingHelperBuildTask()
|
||||
{
|
||||
}
|
||||
|
||||
DebuggingHelperBuildTask::Tools DebuggingHelperBuildTask::availableTools(const QtVersion *version)
|
||||
DebuggingHelperBuildTask::Tools DebuggingHelperBuildTask::availableTools(const BaseQtVersion *version)
|
||||
{
|
||||
QTC_ASSERT(version, return 0; )
|
||||
// Check the build requirements of the tools
|
||||
|
@@ -40,7 +40,7 @@
|
||||
#include <QtCore/QMetaType>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
namespace Internal {
|
||||
|
||||
class DebuggingHelperBuildTask : public QObject {
|
||||
@@ -56,12 +56,12 @@ public:
|
||||
};
|
||||
Q_DECLARE_FLAGS(Tools, DebuggingHelper)
|
||||
|
||||
explicit DebuggingHelperBuildTask(const QtVersion *version, Tools tools = AllTools);
|
||||
explicit DebuggingHelperBuildTask(const BaseQtVersion *version, Tools tools = AllTools);
|
||||
virtual ~DebuggingHelperBuildTask();
|
||||
|
||||
void run(QFutureInterface<void> &future);
|
||||
|
||||
static Tools availableTools(const QtVersion *version);
|
||||
static Tools availableTools(const BaseQtVersion *version);
|
||||
|
||||
signals:
|
||||
void finished(int qtVersionId, const QString &output, DebuggingHelperBuildTask::Tools tools);
|
||||
|
@@ -146,7 +146,10 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName,
|
||||
!project->activeTarget()->activeBuildConfiguration())
|
||||
return false;
|
||||
Qt4BuildConfiguration *qt4bc = project->activeTarget()->activeBuildConfiguration();
|
||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
BaseQtVersion *qtVersion = qt4bc->qtVersion();
|
||||
if (!qtVersion)
|
||||
return false;
|
||||
|
||||
data->binary = (qtVersion->*commandAccessor)();
|
||||
data->workingDirectory = project->projectDirectory();
|
||||
} else {
|
||||
@@ -195,7 +198,7 @@ LinguistExternalEditor::LinguistExternalEditor(QObject *parent) :
|
||||
bool LinguistExternalEditor::startEditor(const QString &fileName, QString *errorMessage)
|
||||
{
|
||||
EditorLaunchData data;
|
||||
return getEditorLaunchData(fileName, &QtVersion::linguistCommand,
|
||||
return getEditorLaunchData(fileName, &BaseQtVersion::linguistCommand,
|
||||
QLatin1String(linguistBinaryC),
|
||||
QStringList(), true, &data, errorMessage)
|
||||
&& startEditorProcess(data, errorMessage);
|
||||
@@ -213,7 +216,7 @@ MacDesignerExternalEditor::MacDesignerExternalEditor(QObject *parent) :
|
||||
bool MacDesignerExternalEditor::startEditor(const QString &fileName, QString *errorMessage)
|
||||
{
|
||||
EditorLaunchData data;
|
||||
return getEditorLaunchData(fileName, &QtVersion::designerCommand,
|
||||
return getEditorLaunchData(fileName, &BaseQtVersion::designerCommand,
|
||||
QLatin1String(designerBinaryC),
|
||||
QStringList(), true, &data, errorMessage)
|
||||
&& startEditorProcess(data, errorMessage);
|
||||
@@ -249,7 +252,7 @@ bool DesignerExternalEditor::startEditor(const QString &fileName, QString *error
|
||||
{
|
||||
EditorLaunchData data;
|
||||
// Find the editor binary
|
||||
if (!getEditorLaunchData(fileName, &QtVersion::designerCommand,
|
||||
if (!getEditorLaunchData(fileName, &BaseQtVersion::designerCommand,
|
||||
QLatin1String(designerBinaryC),
|
||||
QStringList(), false, &data, errorMessage)) {
|
||||
return false;
|
||||
|
@@ -46,7 +46,7 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
protected:
|
||||
// Method pointer for a QtVersion method return a string (command)
|
||||
typedef QString (QtVersion::*QtVersionCommandAccessor)() const;
|
||||
typedef QString (BaseQtVersion::*QtVersionCommandAccessor)() const;
|
||||
|
||||
// Data required to launch the editor
|
||||
struct EditorLaunchData {
|
||||
|
@@ -203,9 +203,13 @@ bool MakeStep::init()
|
||||
setEnabled(true);
|
||||
pp->setArguments(args);
|
||||
|
||||
ProjectExplorer::IOutputParser *parser = bc->qtVersion()->createOutputParser();
|
||||
Q_ASSERT(parser);
|
||||
parser->appendOutputParser(new QtParser);
|
||||
ProjectExplorer::IOutputParser *parser = 0;
|
||||
if (bc->qtVersion())
|
||||
parser = bc->qtVersion()->createOutputParser();
|
||||
if (parser)
|
||||
parser->appendOutputParser(new QtParser);
|
||||
else
|
||||
parser = new QtParser;
|
||||
if (toolchain)
|
||||
parser->appendOutputParser(toolchain->outputParser());
|
||||
|
||||
|
@@ -133,7 +133,8 @@ QString QMakeStep::allArguments(bool shorted)
|
||||
for (Utils::QtcProcess::ArgIterator ait(&additonalArguments); ait.next(); )
|
||||
if (ait.value() == QLatin1String("-spec"))
|
||||
goto haveSpec;
|
||||
arguments << "-spec" << bc->qtVersion()->mkspec();
|
||||
if (bc->qtVersion())
|
||||
arguments << "-spec" << bc->qtVersion()->mkspec();
|
||||
haveSpec:
|
||||
|
||||
// Find out what flags we pass on to qmake
|
||||
@@ -163,7 +164,7 @@ QStringList QMakeStep::moreArguments()
|
||||
#endif
|
||||
|
||||
if (m_linkQmlDebuggingLibrary
|
||||
&& !bc->qtVersion()->qmlDebuggingHelperLibrary(true).isEmpty()) {
|
||||
&& bc->qtVersion() && !bc->qtVersion()->qmlDebuggingHelperLibrary(true).isEmpty()) {
|
||||
// Do not turn debugger path into native path separators: Qmake does not like that!
|
||||
const QString debuggingHelperPath
|
||||
= QFileInfo(bc->qtVersion()->qmlDebuggingHelperLibrary(true)).dir().path();
|
||||
@@ -172,7 +173,7 @@ QStringList QMakeStep::moreArguments()
|
||||
+ QLatin1Char('=') + debuggingHelperPath;
|
||||
}
|
||||
|
||||
if (!bc->qtVersion()->supportsShadowBuilds()) {
|
||||
if (bc->qtVersion() && !bc->qtVersion()->supportsShadowBuilds()) {
|
||||
// We have a target which does not allow shadow building.
|
||||
// But we really don't want to have the build artefacts in the source dir
|
||||
// so we try to hack around it, to make the common cases work.
|
||||
@@ -190,7 +191,10 @@ QStringList QMakeStep::moreArguments()
|
||||
bool QMakeStep::init()
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = qt4BuildConfiguration();
|
||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
const BaseQtVersion *qtVersion = qt4bc->qtVersion();
|
||||
|
||||
if (!qtVersion)
|
||||
return false;
|
||||
|
||||
QString args = allArguments();
|
||||
QString workingDirectory;
|
||||
@@ -329,10 +333,16 @@ void QMakeStep::setUserArguments(const QString &arguments)
|
||||
|
||||
bool QMakeStep::isQmlDebuggingLibrarySupported(QString *reason) const
|
||||
{
|
||||
if (qt4BuildConfiguration()->qtVersion()->hasQmlDebuggingLibrary())
|
||||
BaseQtVersion *version = qt4BuildConfiguration()->qtVersion();
|
||||
if (!version) {
|
||||
if (reason)
|
||||
*reason = tr("No Qt version.");
|
||||
return false;
|
||||
}
|
||||
if (version->hasQmlDebuggingLibrary())
|
||||
return true;
|
||||
|
||||
if (!qt4BuildConfiguration()->qtVersion()->qtAbis().isEmpty()) {
|
||||
if (!version->qtAbis().isEmpty()) {
|
||||
ProjectExplorer::Abi abi = qt4BuildConfiguration()->qtVersion()->qtAbis().first();
|
||||
if (abi.osFlavor() == ProjectExplorer::Abi::MaemoLinuxFlavor) {
|
||||
if (reason)
|
||||
@@ -342,13 +352,13 @@ bool QMakeStep::isQmlDebuggingLibrarySupported(QString *reason) const
|
||||
}
|
||||
}
|
||||
|
||||
if (!qt4BuildConfiguration()->qtVersion()->isValid()) {
|
||||
if (!version->isValid()) {
|
||||
if (reason)
|
||||
*reason = tr("Invalid Qt version.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (qt4BuildConfiguration()->qtVersion()->qtVersion() < QtVersionNumber(4, 7, 1)) {
|
||||
if (version->qtVersion() < QtVersionNumber(4, 7, 1)) {
|
||||
if (reason)
|
||||
*reason = tr("Requires Qt 4.7.1 or newer.");
|
||||
return false;
|
||||
@@ -467,9 +477,9 @@ void QMakeStepConfigWidget::qtVersionChanged()
|
||||
void QMakeStepConfigWidget::qmakeBuildConfigChanged()
|
||||
{
|
||||
Qt4BuildConfiguration *bc = m_step->qt4BuildConfiguration();
|
||||
bool debug = bc->qmakeBuildConfiguration() & QtVersion::DebugBuild;
|
||||
bool debug = bc->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild;
|
||||
int index = debug ? 0 : 1;
|
||||
if (bc->qmakeBuildConfiguration() & QtVersion::BuildAll)
|
||||
if (bc->qmakeBuildConfiguration() & BaseQtVersion::BuildAll)
|
||||
index = 2;
|
||||
m_ignoreChange = true;
|
||||
m_ui.buildConfigurationComboBox->setCurrentIndex(index);
|
||||
@@ -515,16 +525,16 @@ void QMakeStepConfigWidget::buildConfigurationSelected()
|
||||
if (m_ignoreChange)
|
||||
return;
|
||||
Qt4BuildConfiguration *bc = m_step->qt4BuildConfiguration();
|
||||
QtVersion::QmakeBuildConfigs buildConfiguration = bc->qmakeBuildConfiguration();
|
||||
BaseQtVersion::QmakeBuildConfigs buildConfiguration = bc->qmakeBuildConfiguration();
|
||||
switch (m_ui.buildConfigurationComboBox->currentIndex()) {
|
||||
case 0:
|
||||
buildConfiguration = QtVersion::DebugBuild;
|
||||
buildConfiguration = BaseQtVersion::DebugBuild;
|
||||
break;
|
||||
case 1:
|
||||
buildConfiguration = 0;
|
||||
break;
|
||||
case 2:
|
||||
buildConfiguration = QtVersion::BuildAll;
|
||||
buildConfiguration = BaseQtVersion::BuildAll;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -552,7 +562,9 @@ void QMakeStepConfigWidget::linkQmlDebuggingLibraryChecked(bool checked)
|
||||
|
||||
void QMakeStepConfigWidget::buildQmlDebuggingHelper()
|
||||
{
|
||||
QtVersion *version = m_step->qt4BuildConfiguration()->qtVersion();
|
||||
BaseQtVersion *version = m_step->qt4BuildConfiguration()->qtVersion();
|
||||
if (!version)
|
||||
return;
|
||||
DebuggingHelperBuildTask *buildTask = new DebuggingHelperBuildTask(version,
|
||||
DebuggingHelperBuildTask::QmlDebugging);
|
||||
|
||||
@@ -568,10 +580,10 @@ void QMakeStepConfigWidget::buildQmlDebuggingHelper()
|
||||
|
||||
void QMakeStepConfigWidget::debuggingHelperBuildFinished(int qtVersionId, const QString &output)
|
||||
{
|
||||
QtVersion *version = QtVersionManager::instance()->version(qtVersionId);
|
||||
BaseQtVersion *version = QtVersionManager::instance()->version(qtVersionId);
|
||||
if (!version) // qt version got deleted in between
|
||||
return;
|
||||
version->invalidateCache();
|
||||
version->recheckDumper();
|
||||
|
||||
if (version == m_step->qt4BuildConfiguration()->qtVersion()) {
|
||||
m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
|
||||
@@ -591,7 +603,7 @@ void QMakeStepConfigWidget::debuggingHelperBuildFinished(int qtVersionId, const
|
||||
void QMakeStepConfigWidget::updateSummaryLabel()
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
BaseQtVersion *qtVersion = qt4bc->qtVersion();
|
||||
if (!qtVersion) {
|
||||
m_summaryText = tr("<b>qmake:</b> No Qt version set. Cannot run qmake.");
|
||||
emit updateSummary();
|
||||
@@ -627,8 +639,10 @@ void QMakeStepConfigWidget::updateQmlDebuggingWarningsLabel()
|
||||
void QMakeStepConfigWidget::updateEffectiveQMakeCall()
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
||||
BaseQtVersion *qtVersion = qt4bc->qtVersion();
|
||||
QString program = tr("<No qtversion>");
|
||||
if (qtVersion)
|
||||
program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
||||
m_ui.qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + m_step->allArguments());
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "qmldebugginglibrary.h"
|
||||
|
||||
#include "qt4project.h"
|
||||
#include "baseqtversion.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -66,7 +66,7 @@ QString QmlDebuggingLibrary::libraryByInstallData(const QString &qtInstallData,
|
||||
return byInstallDataHelper(sourcePath(), sourceFileNames(), directories, binFilenames, false);
|
||||
}
|
||||
|
||||
bool QmlDebuggingLibrary::canBuild(const QtVersion *qtVersion)
|
||||
bool QmlDebuggingLibrary::canBuild(const BaseQtVersion *qtVersion)
|
||||
{
|
||||
return qtVersion->qtVersion() >= QtVersionNumber(4, 7, 1);
|
||||
}
|
||||
|
@@ -48,15 +48,16 @@ namespace ProjectExplorer {
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
|
||||
class QmlDebuggingLibrary : public Utils::BuildableHelperLibrary
|
||||
{
|
||||
public:
|
||||
static QString libraryByInstallData(const QString &qtInstallData, bool debugBuild);
|
||||
|
||||
static bool canBuild(const QtVersion *qtVersion);
|
||||
static bool canBuild(const BaseQtVersion *qtVersion);
|
||||
static bool build(BuildHelperArguments arguments, QString *log, QString *errorMessage);
|
||||
|
||||
static QString copy(const QString &qtInstallData, QString *errorMessage);
|
||||
|
||||
private:
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qtversionmanager.h"
|
||||
#include "debugginghelperbuildtask.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
|
||||
@@ -66,7 +67,7 @@ class QmlDumpBuildTask : public QObject {
|
||||
Q_DISABLE_COPY(QmlDumpBuildTask)
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QmlDumpBuildTask(QtVersion *version)
|
||||
explicit QmlDumpBuildTask(BaseQtVersion *version)
|
||||
: m_buildTask(new DebuggingHelperBuildTask(version, DebuggingHelperBuildTask::QmlDump))
|
||||
, m_failed(false)
|
||||
{
|
||||
@@ -103,7 +104,7 @@ public:
|
||||
private slots:
|
||||
void finish(int qtId, const QString &output, DebuggingHelperBuildTask::Tools tools)
|
||||
{
|
||||
QtVersion *version = QtVersionManager::instance()->version(qtId);
|
||||
BaseQtVersion *version = QtVersionManager::instance()->version(qtId);
|
||||
|
||||
QTC_ASSERT(tools == DebuggingHelperBuildTask::QmlDump, return);
|
||||
QString errorMessage;
|
||||
@@ -111,7 +112,7 @@ private slots:
|
||||
m_failed = true;
|
||||
errorMessage = QString::fromLatin1("Qt version became invalid");
|
||||
} else {
|
||||
version->invalidateCache();
|
||||
version->recheckDumper();
|
||||
|
||||
if (!version->hasQmlDump()) {
|
||||
m_failed = true;
|
||||
@@ -181,7 +182,7 @@ static bool hasPrivateHeaders(const QString &qtInstallHeaders) {
|
||||
return QFile::exists(header);
|
||||
}
|
||||
|
||||
bool QmlDumpTool::canBuild(const QtVersion *qtVersion)
|
||||
bool QmlDumpTool::canBuild(const BaseQtVersion *qtVersion)
|
||||
{
|
||||
const QString installHeaders = qtVersion->versionInfo().value("QT_INSTALL_HEADERS");
|
||||
|
||||
@@ -191,14 +192,14 @@ bool QmlDumpTool::canBuild(const QtVersion *qtVersion)
|
||||
&& hasPrivateHeaders(installHeaders);
|
||||
}
|
||||
|
||||
static QtVersion *qtVersionForProject(ProjectExplorer::Project *project)
|
||||
static BaseQtVersion *qtVersionForProject(ProjectExplorer::Project *project)
|
||||
{
|
||||
if (project && project->id() == Qt4ProjectManager::Constants::QT4PROJECT_ID) {
|
||||
Qt4Project *qt4Project = static_cast<Qt4Project*>(project);
|
||||
if (qt4Project && qt4Project->activeTarget()
|
||||
&& qt4Project->activeTarget()->activeBuildConfiguration()) {
|
||||
QtVersion *version = qt4Project->activeTarget()->activeBuildConfiguration()->qtVersion();
|
||||
if (version->isValid())
|
||||
BaseQtVersion *version = qt4Project->activeTarget()->activeBuildConfiguration()->qtVersion();
|
||||
if (version && version->isValid())
|
||||
return version;
|
||||
}
|
||||
return 0;
|
||||
@@ -210,17 +211,18 @@ static QtVersion *qtVersionForProject(ProjectExplorer::Project *project)
|
||||
return 0;
|
||||
QVariant variant = project->activeTarget()->activeRunConfiguration()->property("qtVersionId");
|
||||
QTC_ASSERT(variant.isValid() && variant.canConvert(QVariant::Int), return 0);
|
||||
QtVersion *version = QtVersionManager::instance()->version(variant.toInt());
|
||||
if (version && version->isValid())
|
||||
BaseQtVersion *version = QtVersionManager::instance()->version(variant.toInt());
|
||||
if (version && version->isValid()) {
|
||||
return version;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// else, find any desktop or simulator Qt version that has qmldump, or
|
||||
// - if there isn't any - one that could build it
|
||||
QtVersion *canBuildQmlDump = 0;
|
||||
BaseQtVersion *canBuildQmlDump = 0;
|
||||
QtVersionManager *qtVersions = QtVersionManager::instance();
|
||||
foreach (QtVersion *version, qtVersions->validVersions()) {
|
||||
foreach (BaseQtVersion *version, qtVersions->validVersions()) {
|
||||
if (version->supportsTargetId(Constants::DESKTOP_TARGET_ID)
|
||||
|| version->supportsTargetId(Constants::QT_SIMULATOR_TARGET_ID)) {
|
||||
if (version->hasQmlDump())
|
||||
@@ -237,7 +239,7 @@ static QtVersion *qtVersionForProject(ProjectExplorer::Project *project)
|
||||
|
||||
QString QmlDumpTool::toolForProject(ProjectExplorer::Project *project, bool debugDump)
|
||||
{
|
||||
QtVersion *version = qtVersionForProject(project);
|
||||
BaseQtVersion *version = qtVersionForProject(project);
|
||||
if (version) {
|
||||
QString qtInstallData = version->versionInfo().value("QT_INSTALL_DATA");
|
||||
QString qtInstallHeaders = version->versionInfo().value("QT_INSTALL_HEADERS");
|
||||
@@ -330,7 +332,7 @@ void QmlDumpTool::pathAndEnvironment(ProjectExplorer::Project *project, bool pre
|
||||
{
|
||||
QString path;
|
||||
|
||||
QtVersion *version = qtVersionForProject(project);
|
||||
BaseQtVersion *version = qtVersionForProject(project);
|
||||
if (version && !version->hasQmlDump() && QmlDumpTool::canBuild(version)) {
|
||||
QmlDumpBuildTask *qmlDumpBuildTask = qmlDumpBuilds()->value(version->uniqueId());
|
||||
if (qmlDumpBuildTask) {
|
||||
|
@@ -46,12 +46,12 @@ namespace ProjectExplorer {
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT QmlDumpTool : public Utils::BuildableHelperLibrary
|
||||
{
|
||||
public:
|
||||
static bool canBuild(const QtVersion *qtVersion);
|
||||
static bool canBuild(const BaseQtVersion *qtVersion);
|
||||
static QString toolForProject(ProjectExplorer::Project *project, bool debugDump);
|
||||
static QString toolByInstallData(const QString &qtInstallData, const QString &qtInstallHeaders,
|
||||
bool debugDump);
|
||||
|
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "qt4project.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "baseqtversion.h"
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -54,7 +55,7 @@ static inline QStringList validBinaryFilenames()
|
||||
<< QLatin1String("QMLObserver.app/Contents/MacOS/QMLObserver");
|
||||
}
|
||||
|
||||
bool QmlObserverTool::canBuild(const QtVersion *qtVersion)
|
||||
bool QmlObserverTool::canBuild(const BaseQtVersion *qtVersion)
|
||||
{
|
||||
return (qtVersion->supportsTargetId(Constants::DESKTOP_TARGET_ID)
|
||||
|| qtVersion->supportsTargetId(Constants::QT_SIMULATOR_TARGET_ID))
|
||||
@@ -67,8 +68,8 @@ QString QmlObserverTool::toolForProject(ProjectExplorer::Project *project)
|
||||
Qt4Project *qt4Project = static_cast<Qt4Project*>(project);
|
||||
if (qt4Project && qt4Project->activeTarget()
|
||||
&& qt4Project->activeTarget()->activeBuildConfiguration()) {
|
||||
QtVersion *version = qt4Project->activeTarget()->activeBuildConfiguration()->qtVersion();
|
||||
if (version->isValid()) {
|
||||
BaseQtVersion *version = qt4Project->activeTarget()->activeBuildConfiguration()->qtVersion();
|
||||
if (version && version->isValid()) {
|
||||
QString qtInstallData = version->versionInfo().value("QT_INSTALL_DATA");
|
||||
QString toolPath = toolByInstallData(qtInstallData);
|
||||
return toolPath;
|
||||
|
@@ -48,12 +48,12 @@ namespace ProjectExplorer {
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT QmlObserverTool : public Utils::BuildableHelperLibrary
|
||||
{
|
||||
public:
|
||||
static bool canBuild(const QtVersion *qtVersion);
|
||||
static bool canBuild(const BaseQtVersion *qtVersion);
|
||||
static QString toolForProject(ProjectExplorer::Project *project);
|
||||
static QString toolByInstallData(const QString &qtInstallData);
|
||||
static QStringList locationsByInstallData(const QString &qtInstallData);
|
||||
|
119
src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp
Normal file
119
src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp
Normal file
@@ -0,0 +1,119 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "desktopqtversion.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "profileevaluator.h"
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfoList>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
DesktopQtVersion::DesktopQtVersion()
|
||||
: BaseQtVersion(),
|
||||
m_qtAbisUpToDate(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
DesktopQtVersion::DesktopQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
|
||||
: BaseQtVersion(path, isAutodetected, autodetectionSource),
|
||||
m_qtAbisUpToDate(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
DesktopQtVersion::~DesktopQtVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
DesktopQtVersion *DesktopQtVersion::clone() const
|
||||
{
|
||||
return new DesktopQtVersion(*this);
|
||||
}
|
||||
|
||||
QString DesktopQtVersion::type() const
|
||||
{
|
||||
return Constants::DESKTOPQT;
|
||||
}
|
||||
|
||||
bool DesktopQtVersion::isValid() const
|
||||
{
|
||||
if (!BaseQtVersion::isValid())
|
||||
return false;
|
||||
if (qtAbis().isEmpty())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
QString DesktopQtVersion::invalidReason() const
|
||||
{
|
||||
QString tmp = BaseQtVersion::invalidReason();
|
||||
if (tmp.isEmpty() && qtAbis().isEmpty())
|
||||
return QCoreApplication::translate("QtVersion", "Failed to detect the ABI(s) used by the Qt version.");
|
||||
return QString();
|
||||
}
|
||||
|
||||
void DesktopQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
|
||||
{
|
||||
m_mingw = (evaluator->value("MAKEFILE_GENERATOR") == "MINGW");
|
||||
BaseQtVersion::parseMkSpec(evaluator);
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Abi> DesktopQtVersion::qtAbis() const
|
||||
{
|
||||
if (!m_qtAbisUpToDate) {
|
||||
m_qtAbisUpToDate = true;
|
||||
ensureMkSpecParsed();
|
||||
m_qtAbis = qtAbisFromLibrary(qtCorePath(versionInfo(), qtVersionString()), m_mingw);
|
||||
}
|
||||
return m_qtAbis;
|
||||
}
|
||||
|
||||
bool DesktopQtVersion::supportsTargetId(const QString &id) const
|
||||
{
|
||||
return id == QLatin1String(Constants::DESKTOP_TARGET_ID);
|
||||
}
|
||||
|
||||
QSet<QString> DesktopQtVersion::supportedTargetIds() const
|
||||
{
|
||||
return QSet<QString>() << QLatin1String(Constants::DESKTOP_TARGET_ID);
|
||||
}
|
||||
|
||||
QString DesktopQtVersion::description() const
|
||||
{
|
||||
return QCoreApplication::translate("QtVersion", "Desktop", "Qt Version is meant for the desktop");
|
||||
}
|
72
src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h
Normal file
72
src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef DESKTOPQTVERSION_H
|
||||
#define DESKTOPQTVERSION_H
|
||||
|
||||
#include "baseqtversion.h"
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class DesktopQtVersion : public BaseQtVersion
|
||||
{
|
||||
public:
|
||||
DesktopQtVersion();
|
||||
DesktopQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
~DesktopQtVersion();
|
||||
DesktopQtVersion *clone() const;
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
virtual bool isValid() const;
|
||||
virtual QString invalidReason() const;
|
||||
|
||||
virtual QList<ProjectExplorer::Abi> qtAbis() const;
|
||||
|
||||
virtual bool supportsTargetId(const QString &id) const;
|
||||
virtual QSet<QString> supportedTargetIds() const;
|
||||
|
||||
QString description() const;
|
||||
protected:
|
||||
void parseMkSpec(ProFileEvaluator *) const;
|
||||
private:
|
||||
mutable bool m_qtAbisUpToDate;
|
||||
mutable QList<ProjectExplorer::Abi> m_qtAbis;
|
||||
mutable bool m_mingw;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DESKTOPQTVERSION_H
|
@@ -0,0 +1,81 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
#include "desktopqtversionfactory.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "desktopqtversion.h"
|
||||
#include "qtversionmanager.h"
|
||||
|
||||
#include <projectexplorer/debugginghelper.h>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
DesktopQtVersionFactory::DesktopQtVersionFactory(QObject *parent)
|
||||
: QtVersionFactory(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
DesktopQtVersionFactory::~DesktopQtVersionFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool DesktopQtVersionFactory::canRestore(const QString &type)
|
||||
{
|
||||
return type == QLatin1String(Constants::DESKTOPQT);
|
||||
}
|
||||
|
||||
BaseQtVersion *DesktopQtVersionFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
DesktopQtVersion *v = new DesktopQtVersion;
|
||||
v->fromMap(data);
|
||||
return v;
|
||||
}
|
||||
|
||||
int DesktopQtVersionFactory::priority() const
|
||||
{
|
||||
// Lowest of all, we want to be the fallback
|
||||
return 0;
|
||||
}
|
||||
|
||||
BaseQtVersion *DesktopQtVersionFactory::create(const QString &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
|
||||
QFileInfo fi(qmakePath);
|
||||
if (fi.exists() && fi.isExecutable() && fi.isFile())
|
||||
return new DesktopQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
|
||||
return 0;
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef DESKTOPQTVERSIONFACTORY_H
|
||||
#define DESKTOPQTVERSIONFACTORY_H
|
||||
|
||||
#include "qtversionfactory.h"
|
||||
|
||||
namespace Qt4ProjectManager{
|
||||
namespace Internal {
|
||||
|
||||
class DesktopQtVersionFactory : public QtVersionFactory
|
||||
{
|
||||
public:
|
||||
explicit DesktopQtVersionFactory(QObject *parent = 0);
|
||||
~DesktopQtVersionFactory();
|
||||
|
||||
virtual bool canRestore(const QString &type);
|
||||
virtual BaseQtVersion *restore(const QVariantMap &data);
|
||||
|
||||
virtual int priority() const;
|
||||
virtual BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
|
||||
};
|
||||
|
||||
} // Internal
|
||||
} // Qt4ProjectManager
|
||||
|
||||
|
||||
#endif // DESKTOPQTVERSIONFACTORY_H
|
@@ -4,11 +4,19 @@ HEADERS += \
|
||||
$$PWD/qt4desktoptargetfactory.h \
|
||||
$$PWD/qt4simulatortargetfactory.h \
|
||||
$$PWD/qt4desktoptarget.h \
|
||||
$$PWD/qt4simulatortarget.h
|
||||
$$PWD/qt4simulatortarget.h \
|
||||
$$PWD/desktopqtversionfactory.h \
|
||||
$$PWD/simulatorqtversionfactory.h \
|
||||
$$PWD/desktopqtversion.h \
|
||||
$$PWD/simulatorqtversion.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/qt4runconfiguration.cpp \
|
||||
$$PWD/qt4desktoptargetfactory.cpp \
|
||||
$$PWD/qt4simulatortargetfactory.cpp \
|
||||
$$PWD/qt4desktoptarget.cpp \
|
||||
$$PWD/qt4simulatortarget.cpp
|
||||
$$PWD/qt4simulatortarget.cpp \
|
||||
$$PWD/desktopqtversionfactory.cpp \
|
||||
$$PWD/simulatorqtversionfactory.cpp \
|
||||
$$PWD/desktopqtversion.cpp \
|
||||
$$PWD/simulatorqtversion.cpp
|
||||
|
@@ -142,16 +142,16 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::create(ProjectExplorer::Projec
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
|
||||
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id);
|
||||
QList<BaseQtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id);
|
||||
if (knownVersions.isEmpty())
|
||||
return 0;
|
||||
|
||||
QtVersion *qtVersion = knownVersions.first();
|
||||
QtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig();
|
||||
BaseQtVersion *qtVersion = knownVersions.first();
|
||||
BaseQtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig();
|
||||
|
||||
QList<BuildConfigurationInfo> infos;
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString()));
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config ^ QtVersion::DebugBuild, QString(), QString()));
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config ^ BaseQtVersion::DebugBuild, QString(), QString()));
|
||||
|
||||
return create(parent, id, infos);
|
||||
}
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "qtoutputformatter.h"
|
||||
#include "qt4desktoptarget.h"
|
||||
#include "qmakestep.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -660,7 +661,7 @@ QString Qt4RunConfiguration::proFilePath() const
|
||||
|
||||
QString Qt4RunConfiguration::dumperLibrary() const
|
||||
{
|
||||
QtVersion *version = qt4Target()->activeBuildConfiguration()->qtVersion();
|
||||
BaseQtVersion *version = qt4Target()->activeBuildConfiguration()->qtVersion();
|
||||
if (version)
|
||||
return version->gdbDebuggingHelperLibrary();
|
||||
return QString();
|
||||
@@ -668,7 +669,7 @@ QString Qt4RunConfiguration::dumperLibrary() const
|
||||
|
||||
QStringList Qt4RunConfiguration::dumperLibraryLocations() const
|
||||
{
|
||||
QtVersion *version = qt4Target()->activeBuildConfiguration()->qtVersion();
|
||||
BaseQtVersion *version = qt4Target()->activeBuildConfiguration()->qtVersion();
|
||||
if (version)
|
||||
return version->debuggingHelperLibraryLocations();
|
||||
return QStringList();
|
||||
|
@@ -140,15 +140,15 @@ ProjectExplorer::Target *Qt4SimulatorTargetFactory::create(ProjectExplorer::Proj
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
|
||||
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id);
|
||||
QList<BaseQtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id);
|
||||
if (knownVersions.isEmpty())
|
||||
return 0;
|
||||
|
||||
QtVersion *qtVersion = knownVersions.first();
|
||||
QtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig();
|
||||
BaseQtVersion *qtVersion = knownVersions.first();
|
||||
BaseQtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig();
|
||||
QList<BuildConfigurationInfo> infos;
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString()));
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config ^ QtVersion::DebugBuild, QString(), QString()));
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config ^ BaseQtVersion::DebugBuild, QString(), QString()));
|
||||
|
||||
return create(parent, id, infos);
|
||||
}
|
||||
|
120
src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp
Normal file
120
src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp
Normal file
@@ -0,0 +1,120 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "simulatorqtversion.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "profileevaluator.h"
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfoList>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
SimulatorQtVersion::SimulatorQtVersion()
|
||||
: BaseQtVersion(),
|
||||
m_qtAbisUpToDate(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SimulatorQtVersion::SimulatorQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
|
||||
: BaseQtVersion(path, isAutodetected, autodetectionSource),
|
||||
m_qtAbisUpToDate(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SimulatorQtVersion::~SimulatorQtVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SimulatorQtVersion *SimulatorQtVersion::clone() const
|
||||
{
|
||||
return new SimulatorQtVersion(*this);
|
||||
}
|
||||
|
||||
QString SimulatorQtVersion::type() const
|
||||
{
|
||||
return Constants::SIMULATORQT;
|
||||
}
|
||||
|
||||
bool SimulatorQtVersion::isValid() const
|
||||
{
|
||||
if (!BaseQtVersion::isValid())
|
||||
return false;
|
||||
if (qtAbis().isEmpty())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
QString SimulatorQtVersion::invalidReason() const
|
||||
{
|
||||
QString tmp = BaseQtVersion::invalidReason();
|
||||
if (tmp.isEmpty() && qtAbis().isEmpty())
|
||||
return QCoreApplication::translate("QtVersion", "Failed to detect the ABI(s) used by the Qt version.");
|
||||
return QString();
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Abi> SimulatorQtVersion::qtAbis() const
|
||||
{
|
||||
if (!m_qtAbisUpToDate) {
|
||||
m_qtAbisUpToDate = true;
|
||||
ensureMkSpecParsed();
|
||||
m_qtAbis = qtAbisFromLibrary(qtCorePath(versionInfo(), qtVersionString()), m_mingw);
|
||||
}
|
||||
return m_qtAbis;
|
||||
}
|
||||
|
||||
void SimulatorQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
|
||||
{
|
||||
m_mingw = (evaluator->value("MAKEFILE_GENERATOR") == "MINGW");
|
||||
BaseQtVersion::parseMkSpec(evaluator);
|
||||
}
|
||||
|
||||
bool SimulatorQtVersion::supportsTargetId(const QString &id) const
|
||||
{
|
||||
return id == QLatin1String(Constants::QT_SIMULATOR_TARGET_ID);
|
||||
}
|
||||
|
||||
QSet<QString> SimulatorQtVersion::supportedTargetIds() const
|
||||
{
|
||||
return QSet<QString>() << QLatin1String(Constants::QT_SIMULATOR_TARGET_ID);
|
||||
}
|
||||
|
||||
QString SimulatorQtVersion::description() const
|
||||
{
|
||||
return QCoreApplication::translate("QtVersion", "Qt Simulator", "Qt Version is meant for Qt Simulator");
|
||||
}
|
||||
|
@@ -0,0 +1,72 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef SIMULATORQTVERSION_H
|
||||
#define SIMULATORQTVERSION_H
|
||||
|
||||
#include "baseqtversion.h"
|
||||
|
||||
namespace Qt4ProjectManager{
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class SimulatorQtVersion : public BaseQtVersion
|
||||
{
|
||||
public:
|
||||
SimulatorQtVersion();
|
||||
SimulatorQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
~SimulatorQtVersion();
|
||||
SimulatorQtVersion *clone() const;
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
virtual bool isValid() const;
|
||||
virtual QString invalidReason() const;
|
||||
|
||||
virtual QList<ProjectExplorer::Abi> qtAbis() const;
|
||||
|
||||
virtual bool supportsTargetId(const QString &id) const;
|
||||
virtual QSet<QString> supportedTargetIds() const;
|
||||
|
||||
QString description() const;
|
||||
protected:
|
||||
void parseMkSpec(ProFileEvaluator *evaluator) const;
|
||||
private:
|
||||
mutable bool m_qtAbisUpToDate;
|
||||
mutable QList<ProjectExplorer::Abi> m_qtAbis;
|
||||
mutable bool m_mingw;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SIMULATORQTVERSION_H
|
@@ -0,0 +1,82 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "simulatorqtversionfactory.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "simulatorqtversion.h"
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
SimulatorQtVersionFactory::SimulatorQtVersionFactory(QObject *parent)
|
||||
: QtVersionFactory(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SimulatorQtVersionFactory::~SimulatorQtVersionFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool SimulatorQtVersionFactory::canRestore(const QString &type)
|
||||
{
|
||||
return type == QLatin1String(Constants::SIMULATORQT);
|
||||
}
|
||||
|
||||
BaseQtVersion *SimulatorQtVersionFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
BaseQtVersion *v = new SimulatorQtVersion;
|
||||
v->fromMap(data);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
int SimulatorQtVersionFactory::priority() const
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
|
||||
BaseQtVersion *SimulatorQtVersionFactory::create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
|
||||
{
|
||||
QFileInfo fi(qmakePath);
|
||||
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
|
||||
return 0;
|
||||
|
||||
QStringList configValues = evaluator->values("CONFIG");
|
||||
if (!configValues.contains(QLatin1String("simulator")))
|
||||
return 0;
|
||||
|
||||
return new SimulatorQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef SIMULATORQTVERSIONFACTORY_H
|
||||
#define SIMULATORQTVERSIONFACTORY_H
|
||||
|
||||
#include "qtversionfactory.h"
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class SimulatorQtVersionFactory : public QtVersionFactory
|
||||
{
|
||||
public:
|
||||
explicit SimulatorQtVersionFactory(QObject *parent = 0);
|
||||
~SimulatorQtVersionFactory();
|
||||
|
||||
virtual bool canRestore(const QString &type);
|
||||
virtual BaseQtVersion *restore(const QVariantMap &data);
|
||||
|
||||
virtual int priority() const;
|
||||
virtual BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
|
||||
};
|
||||
|
||||
} // Internal
|
||||
} // Qt4ProjectManager
|
||||
|
||||
|
||||
#endif // SIMULATORQTVERSIONFACTORY_H
|
@@ -68,7 +68,8 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
|
||||
}
|
||||
if (debuggingType != MaemoRunConfiguration::DebugQmlOnly) {
|
||||
params.processArgs = runConfig->arguments();
|
||||
params.sysRoot = runConfig->activeQt4BuildConfiguration()->qtVersion()->systemRoot();
|
||||
if (runConfig->activeQt4BuildConfiguration()->qtVersion())
|
||||
params.sysRoot = runConfig->activeQt4BuildConfiguration()->qtVersion()->systemRoot();
|
||||
params.toolChainAbi = runConfig->abi();
|
||||
if (runConfig->useRemoteGdb()) {
|
||||
params.startMode = StartRemoteGdb;
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include <projectexplorer/session.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4target.h>
|
||||
#include <qt4projectmanager/baseqtversion.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/fileutils.h>
|
||||
@@ -244,10 +245,10 @@ bool MaemoDeployableListModel::addDesktopFile()
|
||||
return false;
|
||||
}
|
||||
|
||||
const QtVersion * const version = qtVersion();
|
||||
const BaseQtVersion * const version = qtVersion();
|
||||
QTC_ASSERT(version, return false);
|
||||
QString remoteDir = QLatin1String("/usr/share/applications");
|
||||
if (MaemoGlobal::version(version) == MaemoDeviceConfig::Maemo5)
|
||||
if (MaemoGlobal::version(version->qmakeCommand()) == MaemoDeviceConfig::Maemo5)
|
||||
remoteDir += QLatin1String("/hildon");
|
||||
const QLatin1String filesLine("desktopfile.files = $${TARGET}.desktop");
|
||||
const QString pathLine = QLatin1String("desktopfile.path = ") + remoteDir;
|
||||
@@ -311,7 +312,7 @@ bool MaemoDeployableListModel::addLinesToProFile(const QStringList &lines)
|
||||
return saver.finalize(Core::ICore::instance()->mainWindow());
|
||||
}
|
||||
|
||||
const QtVersion *MaemoDeployableListModel::qtVersion() const
|
||||
const BaseQtVersion *MaemoDeployableListModel::qtVersion() const
|
||||
{
|
||||
const ProjectExplorer::Project *const activeProject
|
||||
= ProjectExplorer::ProjectExplorerPlugin::instance()->session()->startupProject();
|
||||
@@ -327,9 +328,9 @@ const QtVersion *MaemoDeployableListModel::qtVersion() const
|
||||
|
||||
QString MaemoDeployableListModel::proFileScope() const
|
||||
{
|
||||
const QtVersion *const qv = qtVersion();
|
||||
const BaseQtVersion *const qv = qtVersion();
|
||||
QTC_ASSERT(qv, return QString());
|
||||
return QLatin1String(MaemoGlobal::version(qv) == MaemoDeviceConfig::Maemo5
|
||||
return QLatin1String(MaemoGlobal::version(qv->qmakeCommand()) == MaemoDeviceConfig::Maemo5
|
||||
? "maemo5" : "unix:!symbian:!maemo5");
|
||||
}
|
||||
|
||||
@@ -340,10 +341,10 @@ QString MaemoDeployableListModel::installPrefix() const
|
||||
|
||||
QString MaemoDeployableListModel::remoteIconDir() const
|
||||
{
|
||||
const QtVersion *const qv = qtVersion();
|
||||
const BaseQtVersion *const qv = qtVersion();
|
||||
QTC_ASSERT(qv, return QString());
|
||||
return QString::fromLocal8Bit("/usr/share/icons/hicolor/%1x%1/apps")
|
||||
.arg(MaemoGlobal::applicationIconSize(MaemoGlobal::version(qv)));
|
||||
.arg(MaemoGlobal::applicationIconSize(MaemoGlobal::version(qv->qmakeCommand())));
|
||||
}
|
||||
|
||||
} // namespace Qt4ProjectManager
|
||||
|
@@ -44,7 +44,7 @@
|
||||
#include <QtCore/QString>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
namespace Internal {
|
||||
|
||||
class MaemoDeployableListModel : public QAbstractTableModel
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
MaemoDeployable deployableAt(int row) const;
|
||||
bool isModified() const { return m_modified; }
|
||||
void setUnModified() { m_modified = false; }
|
||||
const QtVersion *qtVersion() const;
|
||||
const BaseQtVersion *qtVersion() const;
|
||||
QString localExecutableFilePath() const;
|
||||
QString remoteExecutableFilePath() const;
|
||||
QString projectName() const { return m_projectName; }
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "maemodeployables.h"
|
||||
#include "qt4maemodeployconfiguration.h"
|
||||
|
||||
#include <qt4projectmanager/qtversionmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtGui/QFileDialog>
|
||||
@@ -137,7 +138,7 @@ void MaemoDeployConfigurationWidget::addIcon()
|
||||
|
||||
MaemoDeployableListModel *const model
|
||||
= m_deployConfig->deployables()->modelAt(modelRow);
|
||||
const int iconDim = MaemoGlobal::applicationIconSize(MaemoGlobal::version(model->qtVersion()));
|
||||
const int iconDim = MaemoGlobal::applicationIconSize(MaemoGlobal::version(model->qtVersion()->qmakeCommand()));
|
||||
const QString origFilePath = QFileDialog::getOpenFileName(this,
|
||||
tr("Choose Icon (will be scaled to %1x%1 pixels, if necessary)").arg(iconDim),
|
||||
model->projectDir(), QLatin1String("(*.png)"));
|
||||
|
@@ -76,35 +76,35 @@ bool MaemoGlobal::isMeegoTargetId(const QString &id)
|
||||
return id == QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID);
|
||||
}
|
||||
|
||||
bool MaemoGlobal::isValidMaemo5QtVersion(const QtVersion *version)
|
||||
bool MaemoGlobal::isValidMaemo5QtVersion(const QString &qmakePath)
|
||||
{
|
||||
return isValidMaemoQtVersion(version, MaemoDeviceConfig::Maemo5);
|
||||
return isValidMaemoQtVersion(qmakePath, MaemoDeviceConfig::Maemo5);
|
||||
}
|
||||
|
||||
bool MaemoGlobal::isValidHarmattanQtVersion(const QtVersion *version)
|
||||
bool MaemoGlobal::isValidHarmattanQtVersion(const QString &qmakePath)
|
||||
{
|
||||
return isValidMaemoQtVersion(version, MaemoDeviceConfig::Maemo6);
|
||||
return isValidMaemoQtVersion(qmakePath, MaemoDeviceConfig::Maemo6);
|
||||
}
|
||||
|
||||
bool MaemoGlobal::isValidMeegoQtVersion(const Qt4ProjectManager::QtVersion *version)
|
||||
bool MaemoGlobal::isValidMeegoQtVersion(const QString &qmakePath)
|
||||
{
|
||||
return isValidMaemoQtVersion(version, MaemoDeviceConfig::Meego);
|
||||
return isValidMaemoQtVersion(qmakePath, MaemoDeviceConfig::Meego);
|
||||
}
|
||||
|
||||
bool MaemoGlobal::isValidMaemoQtVersion(const QtVersion *qtVersion,
|
||||
bool MaemoGlobal::isValidMaemoQtVersion(const QString &qmakePath,
|
||||
MaemoDeviceConfig::OsVersion maemoVersion)
|
||||
{
|
||||
if (version(qtVersion) != maemoVersion)
|
||||
if (version(qmakePath) != maemoVersion)
|
||||
return false;
|
||||
QProcess madAdminProc;
|
||||
const QStringList arguments(QLatin1String("list"));
|
||||
if (!callMadAdmin(madAdminProc, arguments, qtVersion, false))
|
||||
if (!callMadAdmin(madAdminProc, arguments, qmakePath, false))
|
||||
return false;
|
||||
if (!madAdminProc.waitForStarted() || !madAdminProc.waitForFinished())
|
||||
return false;
|
||||
|
||||
madAdminProc.setReadChannel(QProcess::StandardOutput);
|
||||
const QByteArray tgtName = targetName(qtVersion).toAscii();
|
||||
const QByteArray tgtName = targetName(qmakePath).toAscii();
|
||||
while (madAdminProc.canReadLine()) {
|
||||
const QByteArray &line = madAdminProc.readLine();
|
||||
if (line.contains(tgtName)
|
||||
@@ -199,9 +199,9 @@ QString MaemoGlobal::deviceConfigurationName(const MaemoDeviceConfig::ConstPtr &
|
||||
}
|
||||
|
||||
MaemoPortList MaemoGlobal::freePorts(const MaemoDeviceConfig::ConstPtr &devConf,
|
||||
const QtVersion *qtVersion)
|
||||
const BaseQtVersion *qtVersion)
|
||||
{
|
||||
if (!devConf)
|
||||
if (!devConf || !qtVersion)
|
||||
return MaemoPortList();
|
||||
if (devConf->type() == MaemoDeviceConfig::Emulator) {
|
||||
MaemoQemuRuntime rt;
|
||||
@@ -212,31 +212,31 @@ MaemoPortList MaemoGlobal::freePorts(const MaemoDeviceConfig::ConstPtr &devConf,
|
||||
return devConf->freePorts();
|
||||
}
|
||||
|
||||
QString MaemoGlobal::maddeRoot(const QtVersion *qtVersion)
|
||||
QString MaemoGlobal::maddeRoot(const QString &qmakePath)
|
||||
{
|
||||
QDir dir(targetRoot(qtVersion));
|
||||
QDir dir(targetRoot(qmakePath));
|
||||
dir.cdUp(); dir.cdUp();
|
||||
return dir.absolutePath();
|
||||
}
|
||||
|
||||
QString MaemoGlobal::targetRoot(const QtVersion *qtVersion)
|
||||
QString MaemoGlobal::targetRoot(const QString &qmakePath)
|
||||
{
|
||||
return QDir::cleanPath(qtVersion->qmakeCommand()).remove(binQmake);
|
||||
return QDir::cleanPath(qmakePath).remove(binQmake);
|
||||
}
|
||||
|
||||
QString MaemoGlobal::targetName(const QtVersion *qtVersion)
|
||||
QString MaemoGlobal::targetName(const QString &qmakePath)
|
||||
{
|
||||
return QDir(targetRoot(qtVersion)).dirName();
|
||||
return QDir(targetRoot(qmakePath)).dirName();
|
||||
}
|
||||
|
||||
QString MaemoGlobal::madAdminCommand(const QtVersion *qtVersion)
|
||||
QString MaemoGlobal::madAdminCommand(const QString &qmakePath)
|
||||
{
|
||||
return maddeRoot(qtVersion) + QLatin1String("/bin/mad-admin");
|
||||
return maddeRoot(qmakePath) + QLatin1String("/bin/mad-admin");
|
||||
}
|
||||
|
||||
QString MaemoGlobal::madCommand(const QtVersion *qtVersion)
|
||||
QString MaemoGlobal::madCommand(const QString &qmakePath)
|
||||
{
|
||||
return maddeRoot(qtVersion) + QLatin1String("/bin/mad");
|
||||
return maddeRoot(qmakePath) + QLatin1String("/bin/mad");
|
||||
}
|
||||
|
||||
QString MaemoGlobal::madDeveloperUiName(MaemoDeviceConfig::OsVersion osVersion)
|
||||
@@ -245,9 +245,9 @@ QString MaemoGlobal::madDeveloperUiName(MaemoDeviceConfig::OsVersion osVersion)
|
||||
? tr("SDK Connectivity") : tr("Mad Developer");
|
||||
}
|
||||
|
||||
MaemoDeviceConfig::OsVersion MaemoGlobal::version(const QtVersion *qtVersion)
|
||||
MaemoDeviceConfig::OsVersion MaemoGlobal::version(const QString &qmakePath)
|
||||
{
|
||||
const QString &name = targetName(qtVersion);
|
||||
const QString &name = targetName(qmakePath);
|
||||
if (name.startsWith(QLatin1String("fremantle")))
|
||||
return MaemoDeviceConfig::Maemo5;
|
||||
if (name.startsWith(QLatin1String("harmattan")))
|
||||
@@ -257,12 +257,12 @@ MaemoDeviceConfig::OsVersion MaemoGlobal::version(const QtVersion *qtVersion)
|
||||
return static_cast<MaemoDeviceConfig::OsVersion>(-1);
|
||||
}
|
||||
|
||||
QString MaemoGlobal::architecture(const QtVersion *qtVersion)
|
||||
QString MaemoGlobal::architecture(const QString &qmakePath)
|
||||
{
|
||||
QProcess proc;
|
||||
const QStringList args = QStringList() << QLatin1String("uname")
|
||||
<< QLatin1String("-m");
|
||||
if (!callMad(proc, args, qtVersion, true))
|
||||
if (!callMad(proc, args, qmakePath, true))
|
||||
return QString();
|
||||
if (!proc.waitForFinished())
|
||||
return QString();
|
||||
@@ -359,30 +359,30 @@ bool MaemoGlobal::isFileNewerThan(const QString &filePath,
|
||||
}
|
||||
|
||||
bool MaemoGlobal::callMad(QProcess &proc, const QStringList &args,
|
||||
const QtVersion *qtVersion, bool useTarget)
|
||||
const QString &qmakePath, bool useTarget)
|
||||
{
|
||||
return callMaddeShellScript(proc, qtVersion, madCommand(qtVersion), args,
|
||||
return callMaddeShellScript(proc, qmakePath, madCommand(qmakePath), args,
|
||||
useTarget);
|
||||
}
|
||||
|
||||
bool MaemoGlobal::callMadAdmin(QProcess &proc, const QStringList &args,
|
||||
const QtVersion *qtVersion, bool useTarget)
|
||||
const QString &qmakePath, bool useTarget)
|
||||
{
|
||||
return callMaddeShellScript(proc, qtVersion, madAdminCommand(qtVersion),
|
||||
return callMaddeShellScript(proc, qmakePath, madAdminCommand(qmakePath),
|
||||
args, useTarget);
|
||||
}
|
||||
|
||||
bool MaemoGlobal::callMaddeShellScript(QProcess &proc,
|
||||
const QtVersion *qtVersion, const QString &command, const QStringList &args,
|
||||
const QString &qmakePath, const QString &command, const QStringList &args,
|
||||
bool useTarget)
|
||||
{
|
||||
if (!QFileInfo(command).exists())
|
||||
return false;
|
||||
QString actualCommand = command;
|
||||
QStringList actualArgs = targetArgs(qtVersion, useTarget) + args;
|
||||
QStringList actualArgs = targetArgs(qmakePath, useTarget) + args;
|
||||
#ifdef Q_OS_WIN
|
||||
Utils::Environment env(proc.systemEnvironment());
|
||||
const QString root = maddeRoot(qtVersion);
|
||||
const QString root = maddeRoot(qmakePath);
|
||||
env.prependOrSetPath(root + QLatin1String("/bin"));
|
||||
env.prependOrSet(QLatin1String("HOME"),
|
||||
QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
|
||||
@@ -394,11 +394,11 @@ bool MaemoGlobal::callMaddeShellScript(QProcess &proc,
|
||||
return true;
|
||||
}
|
||||
|
||||
QStringList MaemoGlobal::targetArgs(const QtVersion *qtVersion, bool useTarget)
|
||||
QStringList MaemoGlobal::targetArgs(const QString &qmakePath, bool useTarget)
|
||||
{
|
||||
QStringList args;
|
||||
if (useTarget) {
|
||||
args << QLatin1String("-t") << targetName(qtVersion);
|
||||
args << QLatin1String("-t") << targetName(qmakePath);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class SshConnection; }
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
namespace Internal {
|
||||
|
||||
class MaemoGlobal
|
||||
@@ -69,9 +69,9 @@ public:
|
||||
static bool isFremantleTargetId(const QString &id);
|
||||
static bool isHarmattanTargetId(const QString &id);
|
||||
static bool isMeegoTargetId(const QString &id);
|
||||
static bool isValidMaemo5QtVersion(const Qt4ProjectManager::QtVersion *version);
|
||||
static bool isValidHarmattanQtVersion(const Qt4ProjectManager::QtVersion *version);
|
||||
static bool isValidMeegoQtVersion(const Qt4ProjectManager::QtVersion *version);
|
||||
static bool isValidMaemo5QtVersion(const QString &qmakePath);
|
||||
static bool isValidHarmattanQtVersion(const QString &qmakePath);
|
||||
static bool isValidMeegoQtVersion(const QString &qmakePath);
|
||||
|
||||
static QString homeDirOnDevice(const QString &uname);
|
||||
static QString devrootshPath();
|
||||
@@ -86,22 +86,22 @@ public:
|
||||
const QSharedPointer<const MaemoDeviceConfig> &deviceConfig);
|
||||
static QString deviceConfigurationName(const QSharedPointer<const MaemoDeviceConfig> &devConf);
|
||||
static MaemoPortList freePorts(const QSharedPointer<const MaemoDeviceConfig> &devConf,
|
||||
const QtVersion *qtVersion);
|
||||
const BaseQtVersion *qtVersion);
|
||||
|
||||
static QString maddeRoot(const QtVersion *qtVersion);
|
||||
static QString targetRoot(const QtVersion *qtVersion);
|
||||
static QString targetName(const QtVersion *qtVersion);
|
||||
static QString madCommand(const QtVersion *qtVersion);
|
||||
static QString maddeRoot(const QString &qmakePath);
|
||||
static QString targetRoot(const QString &qmakePath);
|
||||
static QString targetName(const QString &qmakePath);
|
||||
static QString madCommand(const QString &qmakePath);
|
||||
static QString madDeveloperUiName(MaemoDeviceConfig::OsVersion maemoVersion);
|
||||
static MaemoDeviceConfig::OsVersion version(const QtVersion *qtVersion);
|
||||
static MaemoDeviceConfig::OsVersion version(const QString &qmakePath);
|
||||
|
||||
// TODO: IS this still needed with Qt Version having an Abi?
|
||||
static QString architecture(const QtVersion *version);
|
||||
static QString architecture(const QString &qmakePath);
|
||||
|
||||
static bool callMad(QProcess &proc, const QStringList &args,
|
||||
const QtVersion *qtVersion, bool useTarget);
|
||||
const QString &qmakePath, bool useTarget);
|
||||
static bool callMadAdmin(QProcess &proc, const QStringList &args,
|
||||
const QtVersion *qtVersion, bool useTarget);
|
||||
const QString &qmakePath, bool useTarget);
|
||||
|
||||
static QString osVersionToString(MaemoDeviceConfig::OsVersion version);
|
||||
|
||||
@@ -146,12 +146,12 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
static bool isValidMaemoQtVersion(const Qt4ProjectManager::QtVersion *qtVersion,
|
||||
static bool isValidMaemoQtVersion(const QString &qmakePath,
|
||||
MaemoDeviceConfig::OsVersion maemoVersion);
|
||||
static QString madAdminCommand(const QtVersion *qtVersion);
|
||||
static bool callMaddeShellScript(QProcess &proc, const QtVersion *qtVersion,
|
||||
static QString madAdminCommand(const QString &qmakePath);
|
||||
static bool callMaddeShellScript(QProcess &proc, const QString &qmakePath,
|
||||
const QString &command, const QStringList &args, bool useTarget);
|
||||
static QStringList targetArgs(const QtVersion *qtVersion, bool useTarget);
|
||||
static QStringList targetArgs(const QString &qmakePath, bool useTarget);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "maemopackagecreationstep.h"
|
||||
#include "maemotoolchain.h"
|
||||
#include "qt4maemodeployconfiguration.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4target.h>
|
||||
@@ -166,6 +167,13 @@ void AbstractMaemoInstallPackageToSysrootStep::run(QFutureInterface<bool> &fi)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!bc->qtVersion()) {
|
||||
addOutput(tr("Can't install package to sysroot without a qt version."),
|
||||
ErrorMessageOutput);
|
||||
fi.reportResult(false);
|
||||
return;
|
||||
}
|
||||
|
||||
m_installerProcess = new QProcess;
|
||||
connect(m_installerProcess, SIGNAL(readyReadStandardOutput()),
|
||||
SLOT(handleInstallerStdout()));
|
||||
@@ -173,11 +181,11 @@ void AbstractMaemoInstallPackageToSysrootStep::run(QFutureInterface<bool> &fi)
|
||||
SLOT(handleInstallerStderr()));
|
||||
|
||||
emit addOutput(tr("Installing package to sysroot ..."), MessageOutput);
|
||||
const QtVersion * const qtVersion = bc->qtVersion();
|
||||
const BaseQtVersion * const qtVersion = bc->qtVersion();
|
||||
const QString packageFilePath = pStep->packageFilePath();
|
||||
const int packageFileSize = QFileInfo(packageFilePath).size() / (1024*1024);
|
||||
const QStringList args = madArguments() << packageFilePath;
|
||||
MaemoGlobal::callMadAdmin(*m_installerProcess, args, qtVersion, true);
|
||||
MaemoGlobal::callMadAdmin(*m_installerProcess, args, qtVersion->qmakeCommand(), true);
|
||||
if (!m_installerProcess->waitForFinished((2*packageFileSize + 10)*1000)
|
||||
|| m_installerProcess->exitStatus() != QProcess::NormalExit
|
||||
|| m_installerProcess->exitCode() != 0) {
|
||||
@@ -362,16 +370,16 @@ bool MaemoMakeInstallToSysrootStep::init()
|
||||
ErrorMessageOutput);
|
||||
return false;
|
||||
}
|
||||
const QtVersion * const qtVersion = bc->qtVersion();
|
||||
const BaseQtVersion * const qtVersion = bc->qtVersion();
|
||||
if (!qtVersion) {
|
||||
addOutput("Can't deploy: Unusable build configuration.",
|
||||
ErrorMessageOutput);
|
||||
return false;
|
||||
|
||||
}
|
||||
processParameters()->setCommand(MaemoGlobal::madCommand(qtVersion));
|
||||
processParameters()->setCommand(MaemoGlobal::madCommand(qtVersion->qmakeCommand()));
|
||||
const QStringList args = QStringList() << QLatin1String("-t")
|
||||
<< MaemoGlobal::targetName(qtVersion) << QLatin1String("make")
|
||||
<< MaemoGlobal::targetName(qtVersion->qmakeCommand()) << QLatin1String("make")
|
||||
<< QLatin1String("install")
|
||||
<< (QLatin1String("INSTALL_ROOT=") + qtVersion->systemRoot());
|
||||
processParameters()->setArguments(args.join(QLatin1String(" ")));
|
||||
|
@@ -44,6 +44,7 @@
|
||||
#include "maemosettingspages.h"
|
||||
#include "maemotoolchain.h"
|
||||
#include "qt4maemodeployconfiguration.h"
|
||||
#include "maemoqtversionfactory.h"
|
||||
#include "qt4maemotargetfactory.h"
|
||||
#include "qt4projectmanager/qtversionmanager.h"
|
||||
#include "qt4projectmanager/qt4projectmanagerconstants.h"
|
||||
@@ -74,6 +75,7 @@ MaemoManager::MaemoManager()
|
||||
, m_publishingFactoryFremantleFree(new MaemoPublishingWizardFactoryFremantleFree(this))
|
||||
, m_maemoTargetFactory(new Qt4MaemoTargetFactory(this))
|
||||
, m_toolChainFactory(new MaemoToolChainFactory)
|
||||
, m_maemoQtVersionFactory(new MaemoQtVersionFactory(this))
|
||||
{
|
||||
Q_ASSERT(!m_instance);
|
||||
|
||||
@@ -92,6 +94,7 @@ MaemoManager::MaemoManager()
|
||||
pluginManager->addObject(m_qemuSettingsPage);
|
||||
pluginManager->addObject(m_publishingFactoryFremantleFree);
|
||||
pluginManager->addObject(m_maemoTargetFactory);
|
||||
pluginManager->addObject(m_maemoQtVersionFactory);
|
||||
|
||||
qRegisterMetaType<MaemoDeployable>("MaemoDeployable");
|
||||
}
|
||||
@@ -99,6 +102,7 @@ MaemoManager::MaemoManager()
|
||||
MaemoManager::~MaemoManager()
|
||||
{
|
||||
PluginManager *pluginManager = PluginManager::instance();
|
||||
pluginManager->removeObject(m_maemoQtVersionFactory);
|
||||
pluginManager->removeObject(m_maemoTargetFactory);
|
||||
pluginManager->removeObject(m_publishingFactoryFremantleFree);
|
||||
pluginManager->removeObject(m_qemuSettingsPage);
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include <QtCore/QObject>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
namespace Internal {
|
||||
|
||||
class MaemoDeployStepFactory;
|
||||
@@ -50,6 +49,7 @@ class MaemoQemuSettingsPage;
|
||||
class Qt4MaemoDeployConfigurationFactory;
|
||||
class Qt4MaemoTargetFactory;
|
||||
class MaemoToolChainFactory;
|
||||
class MaemoQtVersionFactory;
|
||||
|
||||
class MaemoManager : public QObject
|
||||
{
|
||||
@@ -77,6 +77,7 @@ private:
|
||||
MaemoPublishingWizardFactoryFremantleFree *m_publishingFactoryFremantleFree;
|
||||
Qt4MaemoTargetFactory *m_maemoTargetFactory;
|
||||
MaemoToolChainFactory *m_toolChainFactory;
|
||||
MaemoQtVersionFactory *m_maemoQtVersionFactory;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -255,13 +255,17 @@ bool AbstractMaemoPackageCreationStep::callPackagingCommand(QProcess *proc,
|
||||
const QStringList &arguments)
|
||||
{
|
||||
preparePackagingProcess(proc, qt4BuildConfiguration(), buildDirectory());
|
||||
const QtVersion * const qtVersion = qt4BuildConfiguration()->qtVersion();
|
||||
const QString madCommand = MaemoGlobal::madCommand(qtVersion);
|
||||
const BaseQtVersion * const qtVersion = qt4BuildConfiguration()->qtVersion();
|
||||
if (!qtVersion) {
|
||||
raiseError(tr("Packaging failed."), tr("Packaging error: No qt version."));
|
||||
return false;
|
||||
}
|
||||
const QString madCommand = MaemoGlobal::madCommand(qtVersion->qmakeCommand());
|
||||
const QString cmdLine = madCommand + QLatin1Char(' ')
|
||||
+ arguments.join(QLatin1String(" "));
|
||||
emit addOutput(tr("Package Creation: Running command '%1'.").arg(cmdLine),
|
||||
BuildStep::MessageOutput);
|
||||
MaemoGlobal::callMad(*proc, arguments, qtVersion, true);
|
||||
MaemoGlobal::callMad(*proc, arguments, qtVersion->qmakeCommand(), true);
|
||||
if (!proc->waitForStarted()) {
|
||||
raiseError(tr("Packaging failed."),
|
||||
tr("Packaging error: Could not start command '%1'. Reason: %2")
|
||||
@@ -287,7 +291,7 @@ void AbstractMaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
|
||||
const Qt4BuildConfiguration *bc, const QString &workingDir)
|
||||
{
|
||||
Utils::Environment env = bc->environment();
|
||||
if (bc->qmakeBuildConfiguration() & QtVersion::DebugBuild) {
|
||||
if (bc->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild) {
|
||||
env.appendOrSet(QLatin1String("DEB_BUILD_OPTIONS"),
|
||||
QLatin1String("nostrip"), QLatin1String(" "));
|
||||
}
|
||||
@@ -466,7 +470,8 @@ QString MaemoDebianPackageCreationStep::packagingCommand(const Qt4BuildConfigura
|
||||
const QString &commandName)
|
||||
{
|
||||
QString perl;
|
||||
const QString maddeRoot = MaemoGlobal::maddeRoot(bc->qtVersion());
|
||||
BaseQtVersion *v = bc->qtVersion();
|
||||
const QString maddeRoot = MaemoGlobal::maddeRoot(v->qmakeCommand());
|
||||
#ifdef Q_OS_WIN
|
||||
perl = maddeRoot + QLatin1String("/bin/perl.exe ");
|
||||
#endif
|
||||
@@ -504,8 +509,12 @@ bool MaemoDebianPackageCreationStep::adaptRulesFile(
|
||||
+ QLatin1Char('/') + maemoTarget()->packageName()
|
||||
+ QLatin1String("/usr/share/applications/");
|
||||
const Qt4BuildConfiguration * const bc = qt4BuildConfiguration();
|
||||
|
||||
const BaseQtVersion *const lqt = bc->qtVersion();
|
||||
if (!lqt)
|
||||
return false;
|
||||
const MaemoDeviceConfig::OsVersion version
|
||||
= MaemoGlobal::version(bc->qtVersion());
|
||||
= MaemoGlobal::version(lqt->qmakeCommand());
|
||||
if (version == MaemoDeviceConfig::Maemo5)
|
||||
desktopFileDir += QLatin1String("hildon/");
|
||||
#ifdef Q_OS_WIN
|
||||
@@ -537,7 +546,7 @@ bool MaemoDebianPackageCreationStep::adaptRulesFile(
|
||||
}
|
||||
|
||||
// Always check for dependencies in release builds.
|
||||
if (!(bc->qmakeBuildConfiguration() & QtVersion::DebugBuild))
|
||||
if (!(bc->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild))
|
||||
ensureShlibdeps(content);
|
||||
|
||||
Utils::FileSaver saver(rulesFilePath);
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "maemopublishingfileselectiondialog.h"
|
||||
#include "qt4maemodeployconfiguration.h"
|
||||
#include "qt4maemotarget.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
#include <coreplugin/ifile.h>
|
||||
#include <projectexplorer/project.h>
|
||||
@@ -363,13 +364,17 @@ void MaemoPublisherFremantleFree::runDpkgBuildPackage()
|
||||
}
|
||||
}
|
||||
|
||||
BaseQtVersion *lqt = m_buildConfig->qtVersion();
|
||||
if (!lqt)
|
||||
finishWithFailure(QString(), tr("No qt version set"));
|
||||
|
||||
if (m_state == Inactive)
|
||||
return;
|
||||
setState(BuildingPackage);
|
||||
emit progressReport(tr("Building source package..."));
|
||||
const QStringList args = QStringList() << QLatin1String("dpkg-buildpackage")
|
||||
<< QLatin1String("-S") << QLatin1String("-us") << QLatin1String("-uc");
|
||||
MaemoGlobal::callMad(*m_process, args, m_buildConfig->qtVersion(), true);
|
||||
MaemoGlobal::callMad(*m_process, args, lqt->qmakeCommand(), true);
|
||||
}
|
||||
|
||||
// We have to implement the SCP protocol, because the maemo.org
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <qt4projectmanager/baseqtversion.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
@@ -79,7 +80,11 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c
|
||||
= qobject_cast<Qt4BuildConfiguration *>(bc);
|
||||
if (!qt4Bc)
|
||||
continue;
|
||||
if (MaemoGlobal::version(qt4Bc->qtVersion()) == MaemoDeviceConfig::Maemo5)
|
||||
|
||||
BaseQtVersion *lqt = qt4Bc->qtVersion();
|
||||
if (!lqt)
|
||||
continue;
|
||||
if (MaemoGlobal::version(lqt->qmakeCommand()) == MaemoDeviceConfig::Maemo5)
|
||||
m_buildConfigs << qt4Bc;
|
||||
}
|
||||
break;
|
||||
|
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "maemoglobal.h"
|
||||
#include "maemopublishingwizardfremantlefree.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qmakestep.h>
|
||||
@@ -76,7 +77,11 @@ bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *p
|
||||
= qobject_cast<const Qt4BuildConfiguration *>(bc);
|
||||
if (!qt4Bc)
|
||||
continue;
|
||||
if (MaemoGlobal::version(qt4Bc->qtVersion()) == MaemoDeviceConfig::Maemo5)
|
||||
|
||||
BaseQtVersion *qt = qt4Bc->qtVersion();
|
||||
if (!qt)
|
||||
continue;
|
||||
if (MaemoGlobal::version(qt->qmakeCommand()) == MaemoDeviceConfig::Maemo5)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include "qt4project.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4maemotarget.h"
|
||||
#include "maemoqtversion.h"
|
||||
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
@@ -180,10 +181,9 @@ void MaemoQemuManager::qtVersionsChanged(const QList<int> &uniqueIds)
|
||||
QtVersionManager *manager = QtVersionManager::instance();
|
||||
foreach (int uniqueId, uniqueIds) {
|
||||
if (manager->isValidId(uniqueId)) {
|
||||
QtVersion *version = manager->version(uniqueId);
|
||||
if (version->supportsTargetId(Constants::MAEMO5_DEVICE_TARGET_ID)
|
||||
|| version->supportsTargetId(Constants::HARMATTAN_DEVICE_TARGET_ID)
|
||||
|| version->supportsTargetId(Constants::MEEGO_DEVICE_TARGET_ID)) {
|
||||
MaemoQtVersion *version = dynamic_cast<MaemoQtVersion *>(manager->version(uniqueId));
|
||||
|
||||
if (version) {
|
||||
MaemoQemuRuntime runtime
|
||||
= MaemoQemuRuntimeParser::parseRuntime(version);
|
||||
if (runtime.isValid()) {
|
||||
@@ -370,7 +370,7 @@ void MaemoQemuManager::startRuntime()
|
||||
Project *p = ProjectExplorerPlugin::instance()->session()->startupProject();
|
||||
if (!p)
|
||||
return;
|
||||
QtVersion *version;
|
||||
BaseQtVersion *version;
|
||||
if (!targetUsesMatchingRuntimeConfig(p->activeTarget(), &version)) {
|
||||
qWarning("Strange: Qemu button was enabled, but target does not match.");
|
||||
return;
|
||||
@@ -530,7 +530,7 @@ void MaemoQemuManager::toggleStarterButton(Target *target)
|
||||
if (target) {
|
||||
if (AbstractQt4MaemoTarget *qt4Target = qobject_cast<AbstractQt4MaemoTarget*>(target)) {
|
||||
if (Qt4BuildConfiguration *bc = qt4Target->activeBuildConfiguration()) {
|
||||
if (QtVersion *version = bc->qtVersion())
|
||||
if (BaseQtVersion *version = bc->qtVersion())
|
||||
uniqueId = version->uniqueId();
|
||||
}
|
||||
}
|
||||
@@ -567,7 +567,7 @@ bool MaemoQemuManager::sessionHasMaemoTarget() const
|
||||
}
|
||||
|
||||
bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
|
||||
QtVersion **qtVersion)
|
||||
BaseQtVersion **qtVersion)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
@@ -582,7 +582,7 @@ bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
|
||||
= qobject_cast<Qt4BuildConfiguration *>(target->activeBuildConfiguration());
|
||||
if (!bc)
|
||||
return false;
|
||||
QtVersion *version = bc->qtVersion();
|
||||
BaseQtVersion *version = bc->qtVersion();
|
||||
if (!version || !m_runtimes.value(version->uniqueId(), MaemoQemuRuntime()).isValid())
|
||||
return false;
|
||||
|
||||
|
@@ -57,7 +57,7 @@ namespace ProjectExplorer {
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
namespace Internal {
|
||||
class MaemoRunConfiguration;
|
||||
|
||||
@@ -117,7 +117,7 @@ private:
|
||||
void updateStarterIcon(bool running);
|
||||
void toggleStarterButton(ProjectExplorer::Target *target);
|
||||
bool targetUsesMatchingRuntimeConfig(ProjectExplorer::Target *target,
|
||||
QtVersion **qtVersion = 0);
|
||||
BaseQtVersion **qtVersion = 0);
|
||||
|
||||
void notify(const QList<int> uniqueIds);
|
||||
void toggleDeviceConnections(MaemoRunConfiguration *mrc, bool connect);
|
||||
|
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "maemoglobal.h"
|
||||
#include "maemoqemusettings.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
#include <qt4projectmanager/qtversionmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -88,17 +89,17 @@ MaemoQemuRuntimeParser::MaemoQemuRuntimeParser(const QString &madInfoOutput,
|
||||
{
|
||||
}
|
||||
|
||||
MaemoQemuRuntime MaemoQemuRuntimeParser::parseRuntime(const QtVersion *qtVersion)
|
||||
MaemoQemuRuntime MaemoQemuRuntimeParser::parseRuntime(const BaseQtVersion *qtVersion)
|
||||
{
|
||||
MaemoQemuRuntime runtime;
|
||||
const QString maddeRootPath = MaemoGlobal::maddeRoot(qtVersion);
|
||||
const QString maddeRootPath = MaemoGlobal::maddeRoot(qtVersion->qmakeCommand());
|
||||
QProcess madProc;
|
||||
if (!MaemoGlobal::callMad(madProc, QStringList() << QLatin1String("info"), qtVersion, false))
|
||||
if (!MaemoGlobal::callMad(madProc, QStringList() << QLatin1String("info"), qtVersion->qmakeCommand(), false))
|
||||
return runtime;
|
||||
if (!madProc.waitForStarted() || !madProc.waitForFinished())
|
||||
return runtime;
|
||||
const QByteArray &madInfoOutput = madProc.readAllStandardOutput();
|
||||
const QString &targetName = MaemoGlobal::targetName(qtVersion);
|
||||
const QString &targetName = MaemoGlobal::targetName(qtVersion->qmakeCommand());
|
||||
runtime = MaemoQemuRuntimeParserV2(madInfoOutput, targetName, maddeRootPath)
|
||||
.parseRuntime();
|
||||
if (!runtime.m_name.isEmpty()) {
|
||||
|
@@ -38,13 +38,13 @@
|
||||
#include <QtXml/QXmlStreamReader>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
namespace Internal {
|
||||
|
||||
class MaemoQemuRuntimeParser
|
||||
{
|
||||
public:
|
||||
static MaemoQemuRuntime parseRuntime(const QtVersion *qtVersion);
|
||||
static MaemoQemuRuntime parseRuntime(const BaseQtVersion *qtVersion);
|
||||
|
||||
protected:
|
||||
MaemoQemuRuntimeParser(const QString &madInfoOutput,
|
||||
|
148
src/plugins/qt4projectmanager/qt-maemo/maemoqtversion.cpp
Normal file
148
src/plugins/qt4projectmanager/qt-maemo/maemoqtversion.cpp
Normal file
@@ -0,0 +1,148 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "maemoqtversion.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt-maemo/maemoglobal.h"
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QDir>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
MaemoQtVersion::MaemoQtVersion()
|
||||
: BaseQtVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MaemoQtVersion::MaemoQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
|
||||
: BaseQtVersion(path, isAutodetected, autodetectionSource)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MaemoQtVersion::~MaemoQtVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString MaemoQtVersion::type() const
|
||||
{
|
||||
return Constants::MAEMOQT;
|
||||
}
|
||||
|
||||
MaemoQtVersion *MaemoQtVersion::clone() const
|
||||
{
|
||||
return new MaemoQtVersion(*this);
|
||||
}
|
||||
|
||||
QString MaemoQtVersion::systemRoot() const
|
||||
{
|
||||
if (m_systemRoot.isNull()) {
|
||||
QFile file(QDir::cleanPath(MaemoGlobal::targetRoot(qmakeCommand()))
|
||||
+ QLatin1String("/information"));
|
||||
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream stream(&file);
|
||||
while (!stream.atEnd()) {
|
||||
const QString &line = stream.readLine().trimmed();
|
||||
const QStringList &list = line.split(QLatin1Char(' '));
|
||||
if (list.count() <= 1)
|
||||
continue;
|
||||
if (list.at(0) == QLatin1String("sysroot")) {
|
||||
m_systemRoot = MaemoGlobal::maddeRoot(qmakeCommand())
|
||||
+ QLatin1String("/sysroots/") + list.at(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return m_systemRoot;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Abi> MaemoQtVersion::qtAbis() const
|
||||
{
|
||||
QList<ProjectExplorer::Abi> result;
|
||||
if (MaemoGlobal::isValidMaemo5QtVersion(qmakeCommand())) {
|
||||
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
|
||||
ProjectExplorer::Abi::MaemoLinuxFlavor, ProjectExplorer::Abi::ElfFormat,
|
||||
32));
|
||||
} else if (MaemoGlobal::isValidHarmattanQtVersion(qmakeCommand())) {
|
||||
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
|
||||
ProjectExplorer::Abi::HarmattanLinuxFlavor,
|
||||
ProjectExplorer::Abi::ElfFormat,
|
||||
32));
|
||||
} else if (MaemoGlobal::isValidMeegoQtVersion(qmakeCommand())) {
|
||||
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
|
||||
ProjectExplorer::Abi::MeegoLinuxFlavor,
|
||||
ProjectExplorer::Abi::ElfFormat, 32));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool MaemoQtVersion::supportsTargetId(const QString &id) const
|
||||
{
|
||||
return supportedTargetIds().contains(id);
|
||||
}
|
||||
|
||||
QSet<QString> MaemoQtVersion::supportedTargetIds() const
|
||||
{
|
||||
QSet<QString> result;
|
||||
if (MaemoGlobal::isValidMaemo5QtVersion(qmakeCommand())) {
|
||||
result.insert(QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID));
|
||||
} else if (MaemoGlobal::isValidHarmattanQtVersion(qmakeCommand())) {
|
||||
result.insert(QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID));
|
||||
} else if (MaemoGlobal::isValidMeegoQtVersion(qmakeCommand())) {
|
||||
result.insert(QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QString MaemoQtVersion::description() const
|
||||
{
|
||||
if (MaemoGlobal::isValidMaemo5QtVersion(qmakeCommand()))
|
||||
return QCoreApplication::translate("QtVersion", "Maemo", "Qt Version is meant for Maemo5");
|
||||
else if (MaemoGlobal::isValidHarmattanQtVersion(qmakeCommand()))
|
||||
return QCoreApplication::translate("QtVersion", "Harmattan ", "Qt Version is meant for Harmattan");
|
||||
else if (MaemoGlobal::isValidMeegoQtVersion(qmakeCommand()))
|
||||
return QCoreApplication::translate("QtVersion", "Meego", "Qt Version is meant for Meego");
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool MaemoQtVersion::supportsShadowBuilds() const
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return false;
|
||||
#endif
|
||||
return true;
|
||||
}
|
67
src/plugins/qt4projectmanager/qt-maemo/maemoqtversion.h
Normal file
67
src/plugins/qt4projectmanager/qt-maemo/maemoqtversion.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
#ifndef MAEMOQTVERSION_H
|
||||
#define MAEMOQTVERSION_H
|
||||
|
||||
#include "baseqtversion.h"
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class MaemoQtVersion : public BaseQtVersion
|
||||
{
|
||||
public:
|
||||
MaemoQtVersion();
|
||||
MaemoQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
~MaemoQtVersion();
|
||||
MaemoQtVersion *clone() const;
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QString systemRoot() const;
|
||||
virtual QList<ProjectExplorer::Abi> qtAbis() const;
|
||||
|
||||
virtual bool supportsTargetId(const QString &id) const;
|
||||
virtual QSet<QString> supportedTargetIds() const;
|
||||
|
||||
virtual QString description() const;
|
||||
|
||||
virtual bool supportsShadowBuilds() const;
|
||||
private:
|
||||
mutable QString m_systemRoot;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // MAEMOQTVERSION_H
|
@@ -0,0 +1,84 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "maemoqtversionfactory.h"
|
||||
#include "maemoglobal.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "maemoqtversion.h"
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
MaemoQtVersionFactory::MaemoQtVersionFactory(QObject *parent)
|
||||
: QtVersionFactory(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MaemoQtVersionFactory::~MaemoQtVersionFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool MaemoQtVersionFactory::canRestore(const QString &type)
|
||||
{
|
||||
return type == QLatin1String(Constants::MAEMOQT);
|
||||
}
|
||||
|
||||
BaseQtVersion *MaemoQtVersionFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
MaemoQtVersion *v = new MaemoQtVersion;
|
||||
v->fromMap(data);
|
||||
return v;
|
||||
}
|
||||
|
||||
int MaemoQtVersionFactory::priority() const
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
|
||||
BaseQtVersion *MaemoQtVersionFactory::create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
|
||||
{
|
||||
Q_UNUSED(evaluator);
|
||||
// we are the fallback :) so we don't care what kinf of qt it is
|
||||
QFileInfo fi(qmakePath);
|
||||
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
|
||||
return 0;
|
||||
|
||||
if (MaemoGlobal::isValidMaemo5QtVersion(qmakePath)
|
||||
|| MaemoGlobal::isValidHarmattanQtVersion(qmakePath)
|
||||
|| MaemoGlobal::isValidMeegoQtVersion(qmakePath))
|
||||
return new MaemoQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
|
||||
return 0;
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef MAEMOQTVERSIONFACTORY_H
|
||||
#define MAEMOQTVERSIONFACTORY_H
|
||||
|
||||
#include "qtversionfactory.h"
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class MaemoQtVersionFactory : public QtVersionFactory
|
||||
{
|
||||
public:
|
||||
explicit MaemoQtVersionFactory(QObject *parent = 0);
|
||||
~MaemoQtVersionFactory();
|
||||
|
||||
virtual bool canRestore(const QString &type);
|
||||
virtual BaseQtVersion *restore(const QVariantMap &data);
|
||||
|
||||
virtual int priority() const;
|
||||
virtual BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
|
||||
};
|
||||
|
||||
} // Internal
|
||||
} // Qt4ProjectManager
|
||||
|
||||
|
||||
#endif // MAEMOQTVERSIONFACTORY_H
|
@@ -35,6 +35,7 @@
|
||||
#include "maemoglobal.h"
|
||||
#include "maemousedportsgatherer.h"
|
||||
#include "qt4maemotarget.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
#include <utils/ssh/sshconnection.h>
|
||||
#include <utils/ssh/sshremoteprocess.h>
|
||||
@@ -74,10 +75,10 @@ void MaemoRemoteMounter::setConnection(const SshConnection::Ptr &connection,
|
||||
void MaemoRemoteMounter::setBuildConfiguration(const Qt4BuildConfiguration *bc)
|
||||
{
|
||||
ASSERT_STATE(Inactive);
|
||||
const QtVersion * const qtVersion = bc->qtVersion();
|
||||
const BaseQtVersion * const qtVersion = bc->qtVersion();
|
||||
m_remoteMountsAllowed
|
||||
= qobject_cast<AbstractQt4MaemoTarget *>(bc->target())->allowsRemoteMounts();
|
||||
m_maddeRoot = MaemoGlobal::maddeRoot(qtVersion);
|
||||
m_maddeRoot = qtVersion ? MaemoGlobal::maddeRoot(qtVersion->qmakeCommand()) : "";
|
||||
}
|
||||
|
||||
void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec,
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "qt4maemodeployconfiguration.h"
|
||||
#include "qt4maemotarget.h"
|
||||
#include "qtoutputformatter.h"
|
||||
#include "maemoqtversion.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
@@ -235,7 +236,10 @@ AbstractLinuxDeviceDeployStep *MaemoRunConfiguration::deployStep() const
|
||||
const QString MaemoRunConfiguration::targetRoot() const
|
||||
{
|
||||
QTC_ASSERT(activeQt4BuildConfiguration(), return QString());
|
||||
return MaemoGlobal::targetRoot(activeQt4BuildConfiguration()->qtVersion());
|
||||
BaseQtVersion *v = activeQt4BuildConfiguration()->qtVersion();
|
||||
if (!v)
|
||||
return QString();
|
||||
return MaemoGlobal::targetRoot(v->qmakeCommand());
|
||||
}
|
||||
|
||||
const QString MaemoRunConfiguration::arguments() const
|
||||
|
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "maemoglobal.h"
|
||||
#include "maemomanager.h"
|
||||
#include "maemoqtversion.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qtversionmanager.h"
|
||||
|
||||
@@ -93,8 +94,10 @@ bool MaemoToolChain::canClone() const
|
||||
|
||||
void MaemoToolChain::addToEnvironment(Utils::Environment &env) const
|
||||
{
|
||||
QtVersion *v = QtVersionManager::instance()->version(m_qtVersionId);
|
||||
const QString maddeRoot = MaemoGlobal::maddeRoot(v);
|
||||
BaseQtVersion *v = QtVersionManager::instance()->version(m_qtVersionId);
|
||||
if (!v)
|
||||
return;
|
||||
const QString maddeRoot = MaemoGlobal::maddeRoot(v->qmakeCommand());
|
||||
|
||||
// put this into environment to make pkg-config stuff work
|
||||
env.prependOrSet(QLatin1String("SYSROOT_DIR"), QDir::toNativeSeparators(sysroot()));
|
||||
@@ -107,7 +110,7 @@ void MaemoToolChain::addToEnvironment(Utils::Environment &env) const
|
||||
|
||||
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin").arg(maddeRoot)));
|
||||
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
|
||||
.arg(MaemoGlobal::targetRoot(v))));
|
||||
.arg(MaemoGlobal::targetRoot(v->qmakeCommand()))));
|
||||
|
||||
const QString manglePathsKey = QLatin1String("GCCWRAPPER_PATHMANGLE");
|
||||
if (!env.hasKey(manglePathsKey)) {
|
||||
@@ -121,19 +124,19 @@ void MaemoToolChain::addToEnvironment(Utils::Environment &env) const
|
||||
|
||||
QString MaemoToolChain::sysroot() const
|
||||
{
|
||||
QtVersion *v = QtVersionManager::instance()->version(m_qtVersionId);
|
||||
BaseQtVersion *v = QtVersionManager::instance()->version(m_qtVersionId);
|
||||
if (!v)
|
||||
return QString();
|
||||
|
||||
if (m_sysroot.isEmpty()) {
|
||||
QFile file(QDir::cleanPath(MaemoGlobal::targetRoot(v)) + QLatin1String("/information"));
|
||||
QFile file(QDir::cleanPath(MaemoGlobal::targetRoot(v->qmakeCommand())) + QLatin1String("/information"));
|
||||
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream stream(&file);
|
||||
while (!stream.atEnd()) {
|
||||
const QString &line = stream.readLine().trimmed();
|
||||
const QStringList &list = line.split(QLatin1Char(' '));
|
||||
if (list.count() > 1 && list.at(0) == QLatin1String("sysroot"))
|
||||
m_sysroot = MaemoGlobal::maddeRoot(v) + QLatin1String("/sysroots/") + list.at(1);
|
||||
m_sysroot = MaemoGlobal::maddeRoot(v->qmakeCommand()) + QLatin1String("/sysroots/") + list.at(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,14 +183,14 @@ void MaemoToolChain::setQtVersionId(int id)
|
||||
return;
|
||||
}
|
||||
|
||||
QtVersion *version = QtVersionManager::instance()->version(id);
|
||||
BaseQtVersion *version = QtVersionManager::instance()->version(id);
|
||||
Q_ASSERT(version);
|
||||
ProjectExplorer::Abi::OSFlavor flavour = ProjectExplorer::Abi::HarmattanLinuxFlavor;
|
||||
if (MaemoGlobal::isValidMaemo5QtVersion(version))
|
||||
if (MaemoGlobal::isValidMaemo5QtVersion(version->qmakeCommand()))
|
||||
flavour = ProjectExplorer::Abi::MaemoLinuxFlavor;
|
||||
else if (MaemoGlobal::isValidHarmattanQtVersion(version))
|
||||
else if (MaemoGlobal::isValidHarmattanQtVersion(version->qmakeCommand()))
|
||||
flavour = ProjectExplorer::Abi::HarmattanLinuxFlavor;
|
||||
else if (MaemoGlobal::isValidMeegoQtVersion(version))
|
||||
else if (MaemoGlobal::isValidMeegoQtVersion(version->qmakeCommand()))
|
||||
flavour = ProjectExplorer::Abi::MeegoLinuxFlavor;
|
||||
else
|
||||
return;
|
||||
@@ -221,14 +224,14 @@ MaemoToolChainConfigWidget::MaemoToolChainConfigWidget(MaemoToolChain *tc) :
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
QLabel *label = new QLabel;
|
||||
QtVersion *v = QtVersionManager::instance()->version(tc->qtVersionId());
|
||||
BaseQtVersion *v = QtVersionManager::instance()->version(tc->qtVersionId());
|
||||
Q_ASSERT(v);
|
||||
label->setText(tr("<html><head/><body><table>"
|
||||
"<tr><td>Path to MADDE:</td><td>%1</td></tr>"
|
||||
"<tr><td>Path to MADDE target:</td><td>%2</td></tr>"
|
||||
"<tr><td>Debugger:</td/><td>%3</td></tr></body></html>")
|
||||
.arg(QDir::toNativeSeparators(MaemoGlobal::maddeRoot(v)),
|
||||
QDir::toNativeSeparators(MaemoGlobal::targetRoot(v)),
|
||||
.arg(QDir::toNativeSeparators(MaemoGlobal::maddeRoot(v->qmakeCommand())),
|
||||
QDir::toNativeSeparators(MaemoGlobal::targetRoot(v->qmakeCommand())),
|
||||
QDir::toNativeSeparators(tc->debuggerCommand())));
|
||||
layout->addWidget(label);
|
||||
}
|
||||
@@ -268,14 +271,12 @@ QString MaemoToolChainFactory::id() const
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> MaemoToolChainFactory::autoDetect()
|
||||
{
|
||||
QList<ProjectExplorer::ToolChain *> result;
|
||||
|
||||
QtVersionManager *vm = QtVersionManager::instance();
|
||||
connect(vm, SIGNAL(qtVersionsChanged(QList<int>)),
|
||||
this, SLOT(handleQtVersionChanges(QList<int>)));
|
||||
|
||||
QList<int> versionList;
|
||||
foreach (QtVersion *v, vm->versions())
|
||||
foreach (BaseQtVersion *v, vm->versions())
|
||||
versionList.append(v->uniqueId());
|
||||
|
||||
return createToolChainList(versionList);
|
||||
@@ -296,7 +297,7 @@ QList<ProjectExplorer::ToolChain *> MaemoToolChainFactory::createToolChainList(c
|
||||
QList<ProjectExplorer::ToolChain *> result;
|
||||
|
||||
foreach (int i, changes) {
|
||||
QtVersion *v = vm->version(i);
|
||||
BaseQtVersion *v = vm->version(i);
|
||||
if (!v) {
|
||||
// remove tool chain:
|
||||
QList<ProjectExplorer::ToolChain *> toRemove;
|
||||
@@ -309,9 +310,7 @@ QList<ProjectExplorer::ToolChain *> MaemoToolChainFactory::createToolChainList(c
|
||||
}
|
||||
foreach (ProjectExplorer::ToolChain *tc, toRemove)
|
||||
tcm->deregisterToolChain(tc);
|
||||
} else if (v->supportsTargetId(Constants::MAEMO5_DEVICE_TARGET_ID)
|
||||
|| v->supportsTargetId(Constants::HARMATTAN_DEVICE_TARGET_ID)
|
||||
|| v->supportsTargetId(Constants::MEEGO_DEVICE_TARGET_ID)) {
|
||||
} else if (MaemoQtVersion *mqv = dynamic_cast<MaemoQtVersion *>(v)) {
|
||||
// add tool chain:
|
||||
MaemoToolChain *mTc = new MaemoToolChain(true);
|
||||
mTc->setQtVersionId(i);
|
||||
@@ -320,11 +319,11 @@ QList<ProjectExplorer::ToolChain *> MaemoToolChainFactory::createToolChainList(c
|
||||
target = "Maemo 6";
|
||||
else if (v->supportsTargetId(Constants::MEEGO_DEVICE_TARGET_ID))
|
||||
target = "Meego";
|
||||
mTc->setDisplayName(tr("%1 GCC (%2)").arg(target).arg(MaemoGlobal::maddeRoot(v)));
|
||||
mTc->setCompilerPath(MaemoGlobal::targetRoot(v) + QLatin1String("/bin/gcc"));
|
||||
mTc->setDebuggerCommand(ProjectExplorer::ToolChainManager::instance()->defaultDebugger(v->qtAbis().at(0)));
|
||||
mTc->setDisplayName(tr("%1 GCC (%2)").arg(target).arg(MaemoGlobal::maddeRoot(mqv->qmakeCommand())));
|
||||
mTc->setCompilerPath(MaemoGlobal::targetRoot(mqv->qmakeCommand()) + QLatin1String("/bin/gcc"));
|
||||
mTc->setDebuggerCommand(ProjectExplorer::ToolChainManager::instance()->defaultDebugger(mqv->qtAbis().at(0)));
|
||||
if (mTc->debuggerCommand().isEmpty())
|
||||
mTc->setDebuggerCommand(MaemoGlobal::targetRoot(v) + QLatin1String("/bin/gdb"));
|
||||
mTc->setDebuggerCommand(MaemoGlobal::targetRoot(mqv->qmakeCommand()) + QLatin1String("/bin/gdb"));
|
||||
result.append(mTc);
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,6 @@
|
||||
#include <projectexplorer/toolchainconfigwidget.h>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
|
@@ -60,7 +60,9 @@ HEADERS += \
|
||||
$$PWD/maemodeploybymountstep.h \
|
||||
$$PWD/maemouploadandinstalldeploystep.h \
|
||||
$$PWD/maemodirectdeviceuploadstep.h \
|
||||
$$PWD/abstractlinuxdevicedeploystep.h
|
||||
$$PWD/abstractlinuxdevicedeploystep.h \
|
||||
$$PWD/maemoqtversionfactory.h \
|
||||
$$PWD/maemoqtversion.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/maemoconfigtestdialog.cpp \
|
||||
@@ -121,7 +123,9 @@ SOURCES += \
|
||||
$$PWD/maemodeploybymountstep.cpp \
|
||||
$$PWD/maemouploadandinstalldeploystep.cpp \
|
||||
$$PWD/maemodirectdeviceuploadstep.cpp \
|
||||
$$PWD/abstractlinuxdevicedeploystep.cpp
|
||||
$$PWD/abstractlinuxdevicedeploystep.cpp \
|
||||
$$PWD/maemoqtversionfactory.cpp \
|
||||
$$PWD/maemoqtversion.cpp
|
||||
|
||||
FORMS += \
|
||||
$$PWD/maemoconfigtestdialog.ui \
|
||||
|
@@ -49,9 +49,9 @@
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <utils/filesystemwatcher.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <qt4projectmanager/baseqtversion.h>
|
||||
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QMainWindow>
|
||||
@@ -153,7 +153,7 @@ QList<ProjectExplorer::ToolChain *> AbstractQt4MaemoTarget::possibleToolChains(P
|
||||
QList<ProjectExplorer::ToolChain *> candidates = Qt4BaseTarget::possibleToolChains(bc);
|
||||
foreach (ProjectExplorer::ToolChain *i, candidates) {
|
||||
MaemoToolChain *tc = dynamic_cast<MaemoToolChain *>(i);
|
||||
if (!tc)
|
||||
if (!tc || !qt4Bc->qtVersion())
|
||||
continue;
|
||||
if (tc->qtVersionId() == qt4Bc->qtVersion()->uniqueId())
|
||||
result.append(tc);
|
||||
@@ -692,7 +692,8 @@ bool AbstractDebBasedQt4MaemoTarget::targetCanBeRemoved() const
|
||||
void AbstractDebBasedQt4MaemoTarget::removeTarget()
|
||||
{
|
||||
QString error;
|
||||
MaemoGlobal::removeRecursively(debianDirPath(), error);
|
||||
if (!MaemoGlobal::removeRecursively(debianDirPath(), error))
|
||||
qDebug("%s", qPrintable(error));
|
||||
}
|
||||
|
||||
void AbstractDebBasedQt4MaemoTarget::handleDebianFileChanged(const QString &filePath)
|
||||
@@ -725,7 +726,12 @@ AbstractQt4MaemoTarget::ActionStatus AbstractDebBasedQt4MaemoTarget::createSpeci
|
||||
<< QLatin1String("-s") << QLatin1String("-n") << QLatin1String("-p")
|
||||
<< (defaultPackageFileName() + QLatin1Char('_')
|
||||
+ AbstractMaemoPackageCreationStep::DefaultVersionNumber);
|
||||
if (!MaemoGlobal::callMad(dh_makeProc, dh_makeArgs, activeBuildConfiguration()->qtVersion(), true)
|
||||
BaseQtVersion *lqt = activeBuildConfiguration()->qtVersion();
|
||||
if (!lqt) {
|
||||
raiseError(tr("Unable to create Debian templates: No qt version set"));
|
||||
return ActionFailed;
|
||||
}
|
||||
if (!MaemoGlobal::callMad(dh_makeProc, dh_makeArgs, lqt->qmakeCommand(), true)
|
||||
|| !dh_makeProc.waitForStarted()) {
|
||||
raiseError(tr("Unable to create Debian templates: dh_make failed (%1)")
|
||||
.arg(dh_makeProc.errorString()));
|
||||
@@ -924,9 +930,12 @@ QString AbstractRpmBasedQt4MaemoTarget::shortDescription() const
|
||||
|
||||
QString AbstractRpmBasedQt4MaemoTarget::packageFileName() const
|
||||
{
|
||||
BaseQtVersion *lqt = activeBuildConfiguration()->qtVersion();
|
||||
if (!lqt)
|
||||
return QString();
|
||||
return packageName() + QLatin1Char('-') + projectVersion() + QLatin1Char('-')
|
||||
+ QString::fromUtf8(getValueForTag(ReleaseTag, 0)) + QLatin1Char('.')
|
||||
+ MaemoGlobal::architecture(activeBuildConfiguration()->qtVersion())
|
||||
+ MaemoGlobal::architecture(lqt->qmakeCommand())
|
||||
+ QLatin1String(".rpm");
|
||||
}
|
||||
|
||||
|
@@ -73,11 +73,11 @@ QStringList Qt4MaemoTargetFactory::supportedTargetIds(ProjectExplorer::Project *
|
||||
QStringList targetIds;
|
||||
if (parent && !qobject_cast<Qt4Project *>(parent))
|
||||
return targetIds;
|
||||
if (QtVersionManager::instance()->supportsTargetId(QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID)))
|
||||
if (!QtVersionManager::instance()->versionsForTargetId(QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID)).isEmpty())
|
||||
targetIds << QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID);
|
||||
if (QtVersionManager::instance()->supportsTargetId(QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID)))
|
||||
if (!QtVersionManager::instance()->versionsForTargetId(QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID)).isEmpty())
|
||||
targetIds << QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID);
|
||||
if (QtVersionManager::instance()->supportsTargetId(QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID)))
|
||||
if (!QtVersionManager::instance()->versionsForTargetId(QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID)).isEmpty())
|
||||
targetIds << QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID);
|
||||
return targetIds;
|
||||
}
|
||||
@@ -176,16 +176,16 @@ ProjectExplorer::Target *Qt4MaemoTargetFactory::create(ProjectExplorer::Project
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
|
||||
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id);
|
||||
QList<BaseQtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id);
|
||||
if (knownVersions.isEmpty())
|
||||
return 0;
|
||||
|
||||
QtVersion *qtVersion = knownVersions.first();
|
||||
QtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig();
|
||||
BaseQtVersion *qtVersion = knownVersions.first();
|
||||
BaseQtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig();
|
||||
|
||||
QList<BuildConfigurationInfo> infos;
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString()));
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config ^ QtVersion::DebugBuild, QString(), QString()));
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config ^ BaseQtVersion::DebugBuild, QString(), QString()));
|
||||
|
||||
return create(parent, id, infos);
|
||||
}
|
||||
|
@@ -31,7 +31,9 @@ SOURCES += $$PWD/s60manager.cpp \
|
||||
$$PWD/s60publishingsissettingspageovi.cpp \
|
||||
$$PWD/s60publisherovi.cpp \
|
||||
$$PWD/s60publishingbuildsettingspageovi.cpp \
|
||||
$$PWD/s60publishingresultspageovi.cpp
|
||||
$$PWD/s60publishingresultspageovi.cpp \
|
||||
$$PWD/symbianqtversionfactory.cpp \
|
||||
$$PWD/symbianqtversion.cpp
|
||||
|
||||
HEADERS += $$PWD/s60manager.h \
|
||||
$$PWD/sbsv2parser.h \
|
||||
@@ -66,7 +68,9 @@ HEADERS += $$PWD/s60manager.h \
|
||||
$$PWD/s60publishingsissettingspageovi.h \
|
||||
$$PWD/s60publisherovi.h \
|
||||
$$PWD/s60publishingbuildsettingspageovi.h \
|
||||
$$PWD/s60publishingresultspageovi.h
|
||||
$$PWD/s60publishingresultspageovi.h \
|
||||
$$PWD/symbianqtversionfactory.h \
|
||||
$$PWD/symbianqtversion.h
|
||||
|
||||
FORMS += $$PWD/s60createpackagestep.ui \
|
||||
$$PWD/s60certificatedetailsdialog.ui \
|
||||
|
@@ -170,7 +170,7 @@ QList<BuildConfigurationInfo> Qt4SymbianTargetFactory::availableBuildConfigurati
|
||||
// For emulator filter out all non debug builds
|
||||
QList<BuildConfigurationInfo> tmp;
|
||||
foreach (const BuildConfigurationInfo &info, infos)
|
||||
if (info.buildConfig & QtVersion::DebugBuild)
|
||||
if (info.buildConfig & BaseQtVersion::DebugBuild)
|
||||
tmp << info;
|
||||
return tmp;
|
||||
}
|
||||
@@ -192,22 +192,22 @@ ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Projec
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
|
||||
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id);
|
||||
QList<BaseQtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id);
|
||||
if (knownVersions.isEmpty())
|
||||
return 0;
|
||||
|
||||
QtVersion *qtVersion = knownVersions.first();
|
||||
QtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig();
|
||||
BaseQtVersion *qtVersion = knownVersions.first();
|
||||
BaseQtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig();
|
||||
|
||||
QList<BuildConfigurationInfo> infos;
|
||||
if (id != Constants::S60_EMULATOR_TARGET_ID) {
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString()));
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config ^ QtVersion::DebugBuild, QString(), QString()));
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config ^ BaseQtVersion::DebugBuild, QString(), QString()));
|
||||
} else {
|
||||
if(config & QtVersion::DebugBuild)
|
||||
if(config & BaseQtVersion::DebugBuild)
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config, QString(), QString()));
|
||||
else
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config ^ QtVersion::DebugBuild, QString(), QString()));
|
||||
infos.append(BuildConfigurationInfo(qtVersion, config ^ BaseQtVersion::DebugBuild, QString(), QString()));
|
||||
}
|
||||
|
||||
return create(parent, id, infos);
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "passphraseforkeydialog.h"
|
||||
#include "s60certificateinfo.h"
|
||||
#include "s60certificatedetailsdialog.h"
|
||||
#include "symbianqtversion.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
|
||||
@@ -183,6 +184,11 @@ bool S60CreatePackageStep::init()
|
||||
|
||||
QList<Qt4ProFileNode *> nodes = pro->allProFiles();
|
||||
|
||||
SymbianQtVersion *sqv = dynamic_cast<SymbianQtVersion *>(qt4BuildConfiguration()->qtVersion());
|
||||
if (!sqv)
|
||||
return false;
|
||||
m_isBuildWithSymbianSbsV2 = sqv->isBuildWithSymbianSbsV2();
|
||||
|
||||
m_workingDirectories.clear();
|
||||
QStringList projectCapabilities;
|
||||
foreach (Qt4ProFileNode *node, nodes) {
|
||||
@@ -408,7 +414,7 @@ bool S60CreatePackageStep::createOnePackage()
|
||||
|
||||
// Setup parsers:
|
||||
Q_ASSERT(!m_outputParserChain);
|
||||
if (!qt4BuildConfiguration()->qtVersion()->isBuildWithSymbianSbsV2()) {
|
||||
if (!m_isBuildWithSymbianSbsV2) {
|
||||
m_outputParserChain = new Qt4ProjectManager::AbldParser;
|
||||
m_outputParserChain->appendOutputParser(new ProjectExplorer::GnuMakeParser);
|
||||
} else {
|
||||
|
@@ -182,6 +182,7 @@ private:
|
||||
|
||||
bool m_suppressPatchWarningDialog;
|
||||
Utils::CheckableMessageBox *m_patchWarningDialog;
|
||||
bool m_isBuildWithSymbianSbsV2;
|
||||
};
|
||||
|
||||
class S60CreatePackageStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
||||
|
@@ -267,7 +267,7 @@ ProjectExplorer::ToolChain *S60DeployConfiguration::toolChain() const
|
||||
bool S60DeployConfiguration::isDebug() const
|
||||
{
|
||||
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration();
|
||||
return (qt4bc->qmakeBuildConfiguration() & QtVersion::DebugBuild);
|
||||
return (qt4bc->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild);
|
||||
}
|
||||
|
||||
QString S60DeployConfiguration::symbianTarget() const
|
||||
@@ -275,7 +275,7 @@ QString S60DeployConfiguration::symbianTarget() const
|
||||
return isDebug() ? QLatin1String("udeb") : QLatin1String("urel");
|
||||
}
|
||||
|
||||
const QtVersion *S60DeployConfiguration::qtVersion() const
|
||||
const BaseQtVersion *S60DeployConfiguration::qtVersion() const
|
||||
{
|
||||
if (const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration())
|
||||
return qt4bc->qtVersion();
|
||||
|
@@ -42,7 +42,7 @@ class ToolChain;
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
|
||||
namespace Internal {
|
||||
class Qt4SymbianTarget;
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
ProjectExplorer::DeployConfigurationWidget *configurationWidget() const;
|
||||
|
||||
const QtVersion *qtVersion() const;
|
||||
const BaseQtVersion *qtVersion() const;
|
||||
Qt4SymbianTarget *qt4Target() const;
|
||||
ProjectExplorer::ToolChain *toolChain() const;
|
||||
|
||||
|
@@ -41,6 +41,8 @@
|
||||
#include "qtoutputformatter.h"
|
||||
#include "qt4symbiantarget.h"
|
||||
#include "codaruncontrol.h"
|
||||
#include "baseqtversion.h"
|
||||
#include "symbianqtversion.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -223,18 +225,18 @@ QString S60DeviceRunConfiguration::targetName() const
|
||||
return ti.target;
|
||||
}
|
||||
|
||||
const QtVersion *S60DeviceRunConfiguration::qtVersion() const
|
||||
SymbianQtVersion *S60DeviceRunConfiguration::qtVersion() const
|
||||
{
|
||||
if (const BuildConfiguration *bc = target()->activeBuildConfiguration())
|
||||
if (const Qt4BuildConfiguration *qt4bc = qobject_cast<const Qt4BuildConfiguration *>(bc))
|
||||
return qt4bc->qtVersion();
|
||||
return dynamic_cast<SymbianQtVersion *>(qt4bc->qtVersion());
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool S60DeviceRunConfiguration::isDebug() const
|
||||
{
|
||||
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration();
|
||||
return (qt4bc->qmakeBuildConfiguration() & QtVersion::DebugBuild);
|
||||
return (qt4bc->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild);
|
||||
}
|
||||
|
||||
QString S60DeviceRunConfiguration::symbianTarget() const
|
||||
@@ -243,7 +245,7 @@ QString S60DeviceRunConfiguration::symbianTarget() const
|
||||
}
|
||||
|
||||
// ABLD/Raptor: Return executable from device/EPOC
|
||||
static inline QString localExecutableFromVersion(const QtVersion *qtv,
|
||||
static inline QString localExecutableFromVersion(const SymbianQtVersion *qtv,
|
||||
const QString &symbianTarget, /* udeb/urel */
|
||||
const QString &targetName,
|
||||
const ProjectExplorer::ToolChain *tc)
|
||||
|
@@ -46,10 +46,10 @@ class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class QtVersion;
|
||||
class Qt4BaseTarget;
|
||||
|
||||
namespace Internal {
|
||||
class SymbianQtVersion;
|
||||
class Qt4SymbianTarget;
|
||||
class Qt4ProFileNode;
|
||||
class S60DeviceRunConfigurationFactory;
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
virtual ~S60DeviceRunConfiguration();
|
||||
|
||||
Qt4SymbianTarget *qt4Target() const;
|
||||
const QtVersion *qtVersion() const;
|
||||
SymbianQtVersion *qtVersion() const;
|
||||
|
||||
using ProjectExplorer::RunConfiguration::isEnabled;
|
||||
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include "qt4symbiantarget.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qtoutputformatter.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
@@ -187,10 +188,10 @@ bool S60EmulatorRunConfiguration::fromMap(const QVariantMap &map)
|
||||
QString S60EmulatorRunConfiguration::executable() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration();
|
||||
QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
BaseQtVersion *qtVersion = qt4bc->qtVersion();
|
||||
QString baseDir = qtVersion->systemRoot();
|
||||
QString qmakeBuildConfig = "urel";
|
||||
if (qt4bc->qmakeBuildConfiguration() & QtVersion::DebugBuild)
|
||||
if (qt4bc->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild)
|
||||
qmakeBuildConfig = "udeb";
|
||||
baseDir += "/epoc32/release/winscw/" + qmakeBuildConfig;
|
||||
|
||||
|
@@ -47,6 +47,7 @@
|
||||
#include "gccetoolchain.h"
|
||||
#include "rvcttoolchain.h"
|
||||
#include "winscwtoolchain.h"
|
||||
#include "symbianqtversionfactory.h"
|
||||
|
||||
#include <symbianutils/symbiandevicemanager.h>
|
||||
|
||||
@@ -128,6 +129,7 @@ S60Manager::S60Manager(QObject *parent) : QObject(parent)
|
||||
addAutoReleasedObject(new S60DeployConfigurationFactory);
|
||||
|
||||
addAutoReleasedObject(new S60PublishingWizardFactoryOvi);
|
||||
addAutoReleasedObject(new SymbianQtVersionFactory);
|
||||
|
||||
connect(Core::ICore::instance()->mainWindow(), SIGNAL(deviceChange()),
|
||||
SymbianUtils::SymbianDeviceManager::instance(), SLOT(update()));
|
||||
|
@@ -248,6 +248,8 @@ bool S60PublisherOvi::isVendorNameValid(const QString &vendorName) const
|
||||
|
||||
QString S60PublisherOvi::qtVersion() const
|
||||
{
|
||||
if (!m_qt4bc->qtVersion())
|
||||
return QString();
|
||||
return m_qt4bc->qtVersion()->displayName();
|
||||
}
|
||||
|
||||
|
@@ -74,7 +74,7 @@ S60PublishingBuildSettingsPageOvi::S60PublishingBuildSettingsPageOvi(S60Publishe
|
||||
|
||||
// todo more intelligent selection? prefer newer versions?
|
||||
foreach (Qt4BuildConfiguration *qt4bc, list)
|
||||
if (!m_bc && !(qt4bc->qmakeBuildConfiguration() & QtVersion::DebugBuild))
|
||||
if (!m_bc && !(qt4bc->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild))
|
||||
m_bc = qt4bc;
|
||||
|
||||
if (!m_bc && !list.isEmpty())
|
||||
|
@@ -93,10 +93,11 @@ S60RunControlBase::S60RunControlBase(RunConfiguration *runConfiguration, const Q
|
||||
m_commandLineArguments.prepend(' ');
|
||||
m_commandLineArguments.prepend(qmlArgs);
|
||||
}
|
||||
m_qtDir = activeBuildConf->qtVersion()->versionInfo().value("QT_INSTALL_DATA");
|
||||
m_installationDrive = activeDeployConf->installationDrive();
|
||||
if (const QtVersion *qtv = activeDeployConf->qtVersion())
|
||||
if (const BaseQtVersion *qtv = activeBuildConf->qtVersion()) {
|
||||
m_qtDir = qtv->versionInfo().value("QT_INSTALL_DATA");
|
||||
m_qtBinPath = qtv->versionInfo().value(QLatin1String("QT_INSTALL_BINS"));
|
||||
}
|
||||
m_installationDrive = activeDeployConf->installationDrive();
|
||||
QTC_ASSERT(!m_qtBinPath.isEmpty(), return);
|
||||
m_executableFileName = s60runConfig->localExecutableFileName();
|
||||
m_runSmartInstaller = activeDeployConf->runSmartInstaller();
|
||||
|
390
src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp
Normal file
390
src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp
Normal file
@@ -0,0 +1,390 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "symbianqtversion.h"
|
||||
#include "qt-s60/sbsv2parser.h"
|
||||
#include "qt-s60/abldparser.h"
|
||||
#include "profileevaluator.h"
|
||||
|
||||
#include <projectexplorer/gnumakeparser.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QFormLayout>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
SymbianQtVersion::SymbianQtVersion()
|
||||
: BaseQtVersion(),
|
||||
m_validSystemRoot(false)
|
||||
{
|
||||
}
|
||||
|
||||
SymbianQtVersion::SymbianQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
|
||||
: BaseQtVersion(path, isAutodetected, autodetectionSource),
|
||||
m_validSystemRoot(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SymbianQtVersion::~SymbianQtVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SymbianQtVersion *SymbianQtVersion::clone() const
|
||||
{
|
||||
return new SymbianQtVersion(*this);
|
||||
}
|
||||
|
||||
bool SymbianQtVersion::equals(BaseQtVersion *other)
|
||||
{
|
||||
if (!BaseQtVersion::equals(other))
|
||||
return false;
|
||||
SymbianQtVersion *o = static_cast<SymbianQtVersion *>(other);
|
||||
return m_sbsV2Directory == o->m_sbsV2Directory
|
||||
&& m_systemRoot == o->m_systemRoot;
|
||||
}
|
||||
|
||||
QString SymbianQtVersion::type() const
|
||||
{
|
||||
return QLatin1String(Constants::SYMBIANQT);
|
||||
}
|
||||
|
||||
bool SymbianQtVersion::isValid() const
|
||||
{
|
||||
if (!BaseQtVersion::isValid())
|
||||
return false;
|
||||
if (!m_validSystemRoot)
|
||||
return false;
|
||||
if(isBuildWithSymbianSbsV2() && (m_sbsV2Directory.isEmpty() || !QFileInfo(m_sbsV2Directory + QLatin1String("/sbs")).exists()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
QString SymbianQtVersion::invalidReason() const
|
||||
{
|
||||
QString tmp = BaseQtVersion::invalidReason();
|
||||
if (tmp.isEmpty() && !m_validSystemRoot)
|
||||
return QCoreApplication::translate("QtVersion", "The \"Open C/C++ plugin\" is not installed in the Symbian SDK or the Symbian SDK path is misconfigured");
|
||||
if (isBuildWithSymbianSbsV2()
|
||||
&& (m_sbsV2Directory.isEmpty() || !QFileInfo(m_sbsV2Directory + QLatin1String("/sbs")).exists()))
|
||||
return QCoreApplication::translate("QtVersion", "SBS was not found.");
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool SymbianQtVersion::toolChainAvailable(const QString &id) const
|
||||
{
|
||||
if (!isValid())
|
||||
return false;
|
||||
if (id == QLatin1String(Constants::S60_EMULATOR_TARGET_ID)) {
|
||||
QList<ProjectExplorer::ToolChain *> tcList =
|
||||
ProjectExplorer::ToolChainManager::instance()->toolChains();
|
||||
foreach (ProjectExplorer::ToolChain *tc, tcList) {
|
||||
if (tc->id().startsWith(QLatin1String(Constants::WINSCW_TOOLCHAIN_ID)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else if (id == QLatin1String(Constants::S60_DEVICE_TARGET_ID)) {
|
||||
QList<ProjectExplorer::ToolChain *> tcList =
|
||||
ProjectExplorer::ToolChainManager::instance()->toolChains();
|
||||
foreach (ProjectExplorer::ToolChain *tc, tcList) {
|
||||
if (!tc->id().startsWith(Qt4ProjectManager::Constants::WINSCW_TOOLCHAIN_ID))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SymbianQtVersion::fromMap(const QVariantMap &map)
|
||||
{
|
||||
BaseQtVersion::fromMap(map);
|
||||
setSbsV2Directory(map.value(QLatin1String("SBSv2Directory")).toString());
|
||||
setSystemRoot(map.value(QLatin1String("SystemRoot")).toString());
|
||||
}
|
||||
|
||||
QVariantMap SymbianQtVersion::toMap() const
|
||||
{
|
||||
QVariantMap result = BaseQtVersion::toMap();
|
||||
result.insert(QLatin1String("SBSv2Directory"), sbsV2Directory());
|
||||
result.insert(QLatin1String("SystemRoot"), systemRoot());
|
||||
return result;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Abi> SymbianQtVersion::qtAbis() const
|
||||
{
|
||||
return QList<ProjectExplorer::Abi>()
|
||||
<< ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::SymbianOS,
|
||||
ProjectExplorer::Abi::UnknownFlavor,
|
||||
ProjectExplorer::Abi::ElfFormat,
|
||||
32);
|
||||
}
|
||||
|
||||
bool SymbianQtVersion::supportsTargetId(const QString &id) const
|
||||
{
|
||||
return supportedTargetIds().contains(id);
|
||||
}
|
||||
|
||||
QSet<QString> SymbianQtVersion::supportedTargetIds() const
|
||||
{
|
||||
return QSet<QString>() << QLatin1String(Constants::S60_DEVICE_TARGET_ID)
|
||||
<< QLatin1String(Constants::S60_EMULATOR_TARGET_ID);
|
||||
}
|
||||
|
||||
QString SymbianQtVersion::description() const
|
||||
{
|
||||
return QCoreApplication::translate("QtVersion", "Symbian", "Qt Version is meant for Symbian");
|
||||
}
|
||||
|
||||
|
||||
bool SymbianQtVersion::supportsShadowBuilds() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SymbianQtVersion::supportsBinaryDebuggingHelper() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static const char *S60_EPOC_HEADERS[] = {
|
||||
"include", "mkspecs/common/symbian", "epoc32/include",
|
||||
"epoc32/include/osextensions/stdapis", "epoc32/include/osextensions/stdapis/sys",
|
||||
"epoc32/include/stdapis", "epoc32/include/stdapis/sys",
|
||||
"epoc32/include/osextensions/stdapis/stlport", "epoc32/include/stdapis/stlport",
|
||||
"epoc32/include/oem", "epoc32/include/middleware", "epoc32/include/domain/middleware",
|
||||
"epoc32/include/osextensions", "epoc32/include/domain/osextensions",
|
||||
"epoc32/include/domain/osextensions/loc", "epoc32/include/domain/middleware/loc",
|
||||
"epoc32/include/domain/osextensions/loc/sc", "epoc32/include/domain/middleware/loc/sc"
|
||||
};
|
||||
|
||||
void SymbianQtVersion::addToEnvironment(Utils::Environment &env) const
|
||||
{
|
||||
BaseQtVersion::addToEnvironment(env);
|
||||
// Generic Symbian environment:
|
||||
QString epocRootPath = systemRoot();
|
||||
QDir epocDir(epocRootPath);
|
||||
|
||||
// Clean up epoc root path for the environment:
|
||||
if (!epocRootPath.endsWith(QLatin1Char('/')))
|
||||
epocRootPath.append(QLatin1Char('/'));
|
||||
if (!isBuildWithSymbianSbsV2()) {
|
||||
#ifdef Q_OS_WIN
|
||||
if (epocRootPath.count() > 2
|
||||
&& epocRootPath.at(0).toLower() >= QLatin1Char('a')
|
||||
&& epocRootPath.at(0).toLower() <= QLatin1Char('z')
|
||||
&& epocRootPath.at(1) == QLatin1Char(':')) {
|
||||
epocRootPath = epocRootPath.mid(2);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
env.set(QLatin1String("EPOCROOT"), QDir::toNativeSeparators(epocRootPath));
|
||||
|
||||
env.prependOrSetPath(epocDir.filePath(QLatin1String("epoc32/tools"))); // e.g. make.exe
|
||||
// Windows only:
|
||||
if (ProjectExplorer::Abi::hostAbi().os() == ProjectExplorer::Abi::WindowsOS) {
|
||||
QString winDir = QLatin1String(qgetenv("WINDIR"));
|
||||
if (!winDir.isEmpty())
|
||||
env.prependOrSetPath(QDir(winDir).filePath(QLatin1String("system32")));
|
||||
|
||||
if (epocDir.exists(QLatin1String("epoc32/gcc/bin")))
|
||||
env.prependOrSetPath(epocDir.filePath(QLatin1String("epoc32/gcc/bin"))); // e.g. cpp.exe, *NOT* gcc.exe
|
||||
// Find perl in the special Symbian flavour:
|
||||
if (epocDir.exists(QLatin1String("../../tools/perl/bin"))) {
|
||||
epocDir.cd(QLatin1String("../../tools/perl/bin"));
|
||||
env.prependOrSetPath(epocDir.absolutePath());
|
||||
} else {
|
||||
env.prependOrSetPath(epocDir.filePath(QLatin1String("perl/bin")));
|
||||
}
|
||||
}
|
||||
|
||||
// SBSv2:
|
||||
if (isBuildWithSymbianSbsV2()) {
|
||||
QString sbsHome(env.value(QLatin1String("SBS_HOME")));
|
||||
QString sbsConfig = sbsV2Directory();
|
||||
if (!sbsConfig.isEmpty()) {
|
||||
env.prependOrSetPath(sbsConfig);
|
||||
// SBS_HOME is the path minus the trailing /bin:
|
||||
env.set(QLatin1String("SBS_HOME"),
|
||||
QDir::toNativeSeparators(sbsConfig.left(sbsConfig.count() - 4))); // We need this for Qt 4.6.3 compatibility
|
||||
} else if (!sbsHome.isEmpty()) {
|
||||
env.prependOrSetPath(sbsHome + QLatin1String("/bin"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::HeaderPath> SymbianQtVersion::systemHeaderPathes() const
|
||||
{
|
||||
QList<ProjectExplorer::HeaderPath> result;
|
||||
QString root = systemRoot() + QLatin1Char('/');
|
||||
const int count = sizeof(S60_EPOC_HEADERS) / sizeof(const char *);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const QDir dir(root + QLatin1String(S60_EPOC_HEADERS[i]));
|
||||
if (dir.exists())
|
||||
result.append(ProjectExplorer::HeaderPath(dir.absolutePath(),
|
||||
ProjectExplorer::HeaderPath::GlobalHeaderPath));
|
||||
}
|
||||
result.append(BaseQtVersion::systemHeaderPathes());
|
||||
return result;
|
||||
}
|
||||
|
||||
ProjectExplorer::IOutputParser *SymbianQtVersion::createOutputParser() const
|
||||
{
|
||||
if (isBuildWithSymbianSbsV2()) {
|
||||
return new SbsV2Parser;
|
||||
} else {
|
||||
ProjectExplorer::IOutputParser *parser = new AbldParser;
|
||||
parser->appendOutputParser(new ProjectExplorer::GnuMakeParser);
|
||||
return parser;
|
||||
}
|
||||
}
|
||||
|
||||
QString SymbianQtVersion::sbsV2Directory() const
|
||||
{
|
||||
return m_sbsV2Directory;
|
||||
}
|
||||
|
||||
void SymbianQtVersion::setSbsV2Directory(const QString &directory)
|
||||
{
|
||||
QDir dir(directory);
|
||||
if (dir.exists(QLatin1String("sbs"))) {
|
||||
m_sbsV2Directory = dir.absolutePath();
|
||||
return;
|
||||
}
|
||||
dir.cd("bin");
|
||||
if (dir.exists(QLatin1String("sbs"))) {
|
||||
m_sbsV2Directory = dir.absolutePath();
|
||||
return;
|
||||
}
|
||||
m_sbsV2Directory = directory;
|
||||
}
|
||||
|
||||
bool SymbianQtVersion::isBuildWithSymbianSbsV2() const
|
||||
{
|
||||
ensureMkSpecParsed();
|
||||
return m_isBuildUsingSbsV2;
|
||||
}
|
||||
|
||||
void SymbianQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
|
||||
{
|
||||
QString makefileGenerator = evaluator->value("MAKEFILE_GENERATOR");
|
||||
m_isBuildUsingSbsV2 = (makefileGenerator == QLatin1String("SYMBIAN_SBSV2"));
|
||||
BaseQtVersion::parseMkSpec(evaluator);
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Task> SymbianQtVersion::reportIssuesImpl(const QString &proFile, const QString &buildDir)
|
||||
{
|
||||
QList<ProjectExplorer::Task> results = BaseQtVersion::reportIssuesImpl(proFile, buildDir);
|
||||
const QString epocRootDir = systemRoot();
|
||||
// Report an error if project- and epoc directory are on different drives:
|
||||
if (!epocRootDir.startsWith(proFile.left(3), Qt::CaseInsensitive) && !isBuildWithSymbianSbsV2()) {
|
||||
results.append(ProjectExplorer::Task(ProjectExplorer::Task::Error,
|
||||
QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker",
|
||||
"The Symbian SDK and the project sources must reside on the same drive."),
|
||||
QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
void SymbianQtVersion::setSystemRoot(const QString &root)
|
||||
{
|
||||
if (root == m_systemRoot)
|
||||
return;
|
||||
m_systemRoot = root;
|
||||
|
||||
m_validSystemRoot = false;
|
||||
if (!m_systemRoot.isEmpty()) {
|
||||
if (!m_systemRoot.endsWith(QLatin1Char('/')))
|
||||
m_systemRoot.append(QLatin1Char('/'));
|
||||
QFileInfo cppheader(m_systemRoot + QLatin1String("epoc32/include/stdapis/string.h"));
|
||||
m_validSystemRoot = cppheader.exists();
|
||||
}
|
||||
}
|
||||
|
||||
QString SymbianQtVersion::systemRoot() const
|
||||
{
|
||||
return m_systemRoot;
|
||||
}
|
||||
|
||||
QtConfigWidget *SymbianQtVersion::createConfigurationWidget() const
|
||||
{
|
||||
return new SymbianQtConfigWidget(const_cast<SymbianQtVersion *>(this));
|
||||
}
|
||||
|
||||
SymbianQtConfigWidget::SymbianQtConfigWidget(SymbianQtVersion *version)
|
||||
: m_version(version)
|
||||
{
|
||||
QFormLayout *fl = new QFormLayout();
|
||||
fl->setMargin(0);
|
||||
setLayout(fl);
|
||||
|
||||
Utils::PathChooser *s60sdkPath = new Utils::PathChooser;
|
||||
s60sdkPath->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
||||
|
||||
fl->addRow(tr("S60 SDK:"), s60sdkPath);
|
||||
|
||||
s60sdkPath->setPath(QDir::toNativeSeparators(version->systemRoot()));
|
||||
|
||||
connect(s60sdkPath, SIGNAL(changed(QString)),
|
||||
this, SLOT(updateCurrentS60SDKDirectory(QString)));
|
||||
|
||||
if (version->isBuildWithSymbianSbsV2()) {
|
||||
Utils::PathChooser *sbsV2Path = new Utils::PathChooser;
|
||||
sbsV2Path->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
||||
fl->addRow(tr("SBS v2 directory:"), sbsV2Path);
|
||||
sbsV2Path->setPath(QDir::toNativeSeparators(version->sbsV2Directory()));
|
||||
sbsV2Path->setEnabled(version->isBuildWithSymbianSbsV2());
|
||||
connect(sbsV2Path, SIGNAL(changed(QString)),
|
||||
this, SLOT(updateCurrentSbsV2Directory(QString)));
|
||||
}
|
||||
}
|
||||
|
||||
void SymbianQtConfigWidget::updateCurrentS60SDKDirectory(const QString &path)
|
||||
{
|
||||
m_version->setSystemRoot(QDir::fromNativeSeparators(path));
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void SymbianQtConfigWidget::updateCurrentSbsV2Directory(const QString &path)
|
||||
{
|
||||
m_version->setSbsV2Directory(QDir::fromNativeSeparators(path));
|
||||
emit changed();
|
||||
}
|
110
src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h
Normal file
110
src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef SYMBIANQTVERSION_H
|
||||
#define SYMBIANQTVERSION_H
|
||||
|
||||
#include "baseqtversion.h"
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class SymbianQtVersion : public BaseQtVersion
|
||||
{
|
||||
public:
|
||||
SymbianQtVersion();
|
||||
SymbianQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
SymbianQtVersion *clone() const;
|
||||
~SymbianQtVersion();
|
||||
|
||||
virtual bool equals(BaseQtVersion *other);
|
||||
|
||||
QString type() const;
|
||||
|
||||
virtual bool isValid() const;
|
||||
virtual QString invalidReason() const;
|
||||
|
||||
virtual bool toolChainAvailable(const QString &id) const;
|
||||
|
||||
virtual void fromMap(const QVariantMap &map);
|
||||
virtual QVariantMap toMap() const;
|
||||
|
||||
virtual QList<ProjectExplorer::Abi> qtAbis() const;
|
||||
|
||||
virtual bool supportsTargetId(const QString &id) const;
|
||||
virtual QSet<QString> supportedTargetIds() const;
|
||||
|
||||
virtual QString description() const;
|
||||
|
||||
virtual bool supportsShadowBuilds() const;
|
||||
virtual bool supportsBinaryDebuggingHelper() const;
|
||||
virtual void addToEnvironment(Utils::Environment &env) const;
|
||||
virtual QList<ProjectExplorer::HeaderPath> systemHeaderPathes() const;
|
||||
|
||||
virtual ProjectExplorer::IOutputParser *createOutputParser() const;
|
||||
|
||||
virtual QString systemRoot() const;
|
||||
void setSystemRoot(const QString &);
|
||||
|
||||
bool isBuildWithSymbianSbsV2() const;
|
||||
|
||||
QString sbsV2Directory() const;
|
||||
void setSbsV2Directory(const QString &directory);
|
||||
|
||||
virtual QtConfigWidget *createConfigurationWidget() const;
|
||||
|
||||
protected:
|
||||
QList<ProjectExplorer::Task> reportIssuesImpl(const QString &proFile, const QString &buildDir);
|
||||
void parseMkSpec(ProFileEvaluator *) const;
|
||||
private:
|
||||
QString m_sbsV2Directory;
|
||||
QString m_systemRoot;
|
||||
mutable bool m_validSystemRoot;
|
||||
mutable bool m_isBuildUsingSbsV2;
|
||||
};
|
||||
|
||||
class SymbianQtConfigWidget : public QtConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SymbianQtConfigWidget(SymbianQtVersion *version);
|
||||
public slots:
|
||||
void updateCurrentSbsV2Directory(const QString &path);
|
||||
void updateCurrentS60SDKDirectory(const QString &path);
|
||||
private:
|
||||
SymbianQtVersion *m_version;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SYMBIANQTVERSION_H
|
@@ -0,0 +1,85 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "symbianqtversionfactory.h"
|
||||
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "symbianqtversion.h"
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
SymbianQtVersionFactory::SymbianQtVersionFactory(QObject *parent)
|
||||
: QtVersionFactory(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SymbianQtVersionFactory::~SymbianQtVersionFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool SymbianQtVersionFactory::canRestore(const QString &type)
|
||||
{
|
||||
return type == QLatin1String(Constants::SYMBIANQT);
|
||||
}
|
||||
|
||||
BaseQtVersion *SymbianQtVersionFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
SymbianQtVersion *v = new SymbianQtVersion;
|
||||
v->fromMap(data);
|
||||
return v;
|
||||
}
|
||||
|
||||
int SymbianQtVersionFactory::priority() const
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
|
||||
BaseQtVersion *SymbianQtVersionFactory::create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
|
||||
{
|
||||
QFileInfo fi(qmakePath);
|
||||
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
|
||||
return 0;
|
||||
|
||||
QString makefileGenerator = evaluator->value("MAKEFILE_GENERATOR");
|
||||
if (makefileGenerator == QLatin1String("SYMBIAN_ABLD") ||
|
||||
makefileGenerator == QLatin1String("SYMBIAN_SBSV2") ||
|
||||
makefileGenerator == QLatin1String("SYMBIAN_UNIX")) {
|
||||
return new SymbianQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@@ -0,0 +1,57 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef SYMBIANQTVERSIONFACTORY_H
|
||||
#define SYMBIANQTVERSIONFACTORY_H
|
||||
|
||||
#include "qtversionfactory.h"
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class SymbianQtVersionFactory : public QtVersionFactory
|
||||
{
|
||||
public:
|
||||
explicit SymbianQtVersionFactory(QObject *parent = 0);
|
||||
~SymbianQtVersionFactory();
|
||||
|
||||
virtual bool canRestore(const QString &type);
|
||||
virtual BaseQtVersion *restore(const QVariantMap &data);
|
||||
|
||||
virtual int priority() const;
|
||||
virtual BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
|
||||
};
|
||||
|
||||
} // Internal
|
||||
} // Qt4ProjectManager
|
||||
|
||||
#endif // SYMBIANQTVERSION_H
|
@@ -43,7 +43,6 @@
|
||||
namespace Qt4ProjectManager {
|
||||
class Qt4TargetSetupWidget;
|
||||
class QtVersionNumber;
|
||||
class QtVersion;
|
||||
struct BuildConfigurationInfo;
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT Qt4BaseTargetFactory : public ProjectExplorer::ITargetFactory
|
||||
|
@@ -38,6 +38,9 @@
|
||||
#include "qt4nodes.h"
|
||||
#include "qmakestep.h"
|
||||
#include "makestep.h"
|
||||
#include "qtversionfactory.h"
|
||||
#include "baseqtversion.h"
|
||||
#include "qt4basetargetfactory.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
@@ -115,15 +118,13 @@ QVariantMap Qt4BuildConfiguration::toMap() const
|
||||
return map;
|
||||
}
|
||||
|
||||
static inline QString msgBuildConfigNotApplicable(const QString &d, const QtVersion *qtVersion,
|
||||
static inline QString msgBuildConfigNotApplicable(const QString &d, const BaseQtVersion *qtVersion,
|
||||
const Target *target)
|
||||
{
|
||||
return QString::fromLatin1("Warning: Buildconfiguration '%1' : Qt '%2' from %3 not supported by target '%4'").
|
||||
arg(d, qtVersion->displayName(), qtVersion->qmakeCommand(), target->id());
|
||||
}
|
||||
|
||||
#include "qt4basetargetfactory.h"
|
||||
|
||||
bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
if (!BuildConfiguration::fromMap(map))
|
||||
@@ -132,49 +133,42 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
|
||||
m_shadowBuild = map.value(QLatin1String(USE_SHADOW_BUILD_KEY), true).toBool();
|
||||
m_qtVersionId = map.value(QLatin1String(QT_VERSION_ID_KEY)).toInt();
|
||||
ProjectExplorer::ToolChain *tc = toolChain();
|
||||
m_qmakeBuildConfiguration = QtVersion::QmakeBuildConfigs(map.value(QLatin1String(BUILD_CONFIGURATION_KEY)).toInt());
|
||||
m_qmakeBuildConfiguration = BaseQtVersion::QmakeBuildConfigs(map.value(QLatin1String(BUILD_CONFIGURATION_KEY)).toInt());
|
||||
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY), defaultShadowBuildDirectory()).toString();
|
||||
|
||||
m_lastEmmitedBuildDirectory = buildDirectory();
|
||||
|
||||
// Pick a Qt version if the default version is used:
|
||||
// We assume that the default Qt version was used in earlier versions of Qt creator.
|
||||
// Pick a Qt version that is supporting a desktop.
|
||||
// Pick a Qt version that supports this target (usually desktop)
|
||||
if (m_qtVersionId == 0) {
|
||||
QList<QtVersion *> versions = QtVersionManager::instance()->versions();
|
||||
foreach (QtVersion *v, versions) {
|
||||
if (v->isValid() && v->supportsTargetId(QLatin1String(Constants::DESKTOP_TARGET_ID))) {
|
||||
QList<BaseQtVersion *> versions = QtVersionManager::instance()->versionsForTargetId(target()->id());
|
||||
foreach (BaseQtVersion *v, versions) {
|
||||
if (v->isValid()) {
|
||||
m_qtVersionId = v->uniqueId();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (m_qtVersionId == 0)
|
||||
m_qtVersionId = versions.at(0)->uniqueId();
|
||||
m_qtVersionId = -1;
|
||||
}
|
||||
|
||||
QtVersion *version = qtVersion();
|
||||
if (!map.contains(QLatin1String("Qt4ProjectManager.Qt4BuildConfiguration.NeedsV0Update"))) { // we are not upgrading from pre-targets!
|
||||
if (version->isValid() && !version->supportedTargetIds().contains(target()->id())) {
|
||||
qWarning("%s", qPrintable(msgBuildConfigNotApplicable(displayName(), version, target())));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!version->isValid() || !version->supportedTargetIds().contains(target()->id())) {
|
||||
qWarning("%s", qPrintable(msgBuildConfigNotApplicable(displayName(), version, target())));
|
||||
return false;
|
||||
}
|
||||
BaseQtVersion *version = QtVersionManager::instance()->version(m_qtVersionId);
|
||||
if (!version || !version->supportsTargetId(target()->id())) {
|
||||
m_qtVersionId = -1;
|
||||
version = 0;
|
||||
}
|
||||
|
||||
if (version->isValid()) {
|
||||
if (!tc)
|
||||
m_lastEmmitedBuildDirectory = buildDirectory();
|
||||
|
||||
if (version && version->isValid()) {
|
||||
if (tc && !qt4Target()->possibleToolChains(this).contains(tc))
|
||||
setToolChain(0);
|
||||
if (!toolChain())
|
||||
tc = qt4Target()->preferredToolChain(this);
|
||||
if (tc && qt4Target()->possibleToolChains(this).contains(tc))
|
||||
setToolChain(tc);
|
||||
m_shadowBuild = (m_shadowBuild && version->supportsShadowBuilds());
|
||||
}
|
||||
|
||||
if (!toolChain()) {
|
||||
if (version->isValid()) {
|
||||
if (version && version->isValid()) {
|
||||
qWarning("Warning: No tool chain available for '%s' from %s used in '%s'.",
|
||||
qPrintable(version->displayName()), qPrintable(version->qmakeCommand()),
|
||||
qPrintable(target()->id()));
|
||||
@@ -182,7 +176,6 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
|
||||
qWarning("Warning: No tool chain available for invalid Qt version used in '%s'.",
|
||||
qPrintable(target()->id()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -208,15 +201,6 @@ void Qt4BuildConfiguration::emitBuildDirectoryChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void Qt4BuildConfiguration::pickValidQtVersion()
|
||||
{
|
||||
QList<QtVersion *> versions = QtVersionManager::instance()->versionsForTargetId(qt4Target()->id());
|
||||
if (!versions.isEmpty())
|
||||
setQtVersion(versions.at(0));
|
||||
else
|
||||
setQtVersion(QtVersionManager::instance()->emptyVersion());
|
||||
}
|
||||
|
||||
Qt4BaseTarget *Qt4BuildConfiguration::qt4Target() const
|
||||
{
|
||||
return static_cast<Qt4BaseTarget *>(target());
|
||||
@@ -225,7 +209,8 @@ Qt4BaseTarget *Qt4BuildConfiguration::qt4Target() const
|
||||
Utils::Environment Qt4BuildConfiguration::baseEnvironment() const
|
||||
{
|
||||
Utils::Environment env = BuildConfiguration::baseEnvironment();
|
||||
qtVersion()->addToEnvironment(env);
|
||||
if (qtVersion())
|
||||
qtVersion()->addToEnvironment(env);
|
||||
|
||||
ToolChain *tc = toolChain();
|
||||
if (tc)
|
||||
@@ -300,9 +285,9 @@ QString Qt4BuildConfiguration::shadowBuildDirectory() const
|
||||
|
||||
void Qt4BuildConfiguration::setShadowBuildAndDirectory(bool shadowBuild, const QString &buildDirectory)
|
||||
{
|
||||
QtVersion *version = qtVersion();
|
||||
BaseQtVersion *version = qtVersion();
|
||||
QString directoryToSet = buildDirectory;
|
||||
bool toSet = (shadowBuild && version->isValid() && version->supportsShadowBuilds());
|
||||
bool toSet = (shadowBuild && version && version->isValid() && version->supportsShadowBuilds());
|
||||
if (m_shadowBuild == toSet && m_buildDirectory == directoryToSet)
|
||||
return;
|
||||
|
||||
@@ -320,10 +305,10 @@ QString Qt4BuildConfiguration::makeCommand() const
|
||||
return tc ? tc->makeCommand() : "make";
|
||||
}
|
||||
|
||||
static inline QString symbianMakeTarget(QtVersion::QmakeBuildConfigs buildConfig,
|
||||
static inline QString symbianMakeTarget(BaseQtVersion::QmakeBuildConfigs buildConfig,
|
||||
const QString &type)
|
||||
{
|
||||
QString rc = (buildConfig & QtVersion::DebugBuild) ?
|
||||
QString rc = (buildConfig & BaseQtVersion::DebugBuild) ?
|
||||
QLatin1String("debug-") : QLatin1String("release-");
|
||||
rc += type;
|
||||
return rc;
|
||||
@@ -334,7 +319,7 @@ QString Qt4BuildConfiguration::defaultMakeTarget() const
|
||||
ToolChain *tc = toolChain();
|
||||
if (!tc || target()->id() != Constants::S60_DEVICE_TARGET_ID)
|
||||
return QString();
|
||||
const QtVersion::QmakeBuildConfigs buildConfig = qmakeBuildConfiguration();
|
||||
const BaseQtVersion::QmakeBuildConfigs buildConfig = qmakeBuildConfiguration();
|
||||
|
||||
return symbianMakeTarget(buildConfig, tc->defaultMakeTarget());
|
||||
}
|
||||
@@ -344,18 +329,26 @@ QString Qt4BuildConfiguration::makefile() const
|
||||
return qt4Target()->qt4Project()->rootProjectNode()->makefile();
|
||||
}
|
||||
|
||||
QtVersion *Qt4BuildConfiguration::qtVersion() const
|
||||
BaseQtVersion *Qt4BuildConfiguration::qtVersion() const
|
||||
{
|
||||
QtVersionManager *vm = QtVersionManager::instance();
|
||||
return vm->version(m_qtVersionId);
|
||||
}
|
||||
|
||||
void Qt4BuildConfiguration::setQtVersion(QtVersion *version)
|
||||
void Qt4BuildConfiguration::setQtVersion(BaseQtVersion *version)
|
||||
{
|
||||
Q_ASSERT(version);
|
||||
|
||||
if (m_qtVersionId == version->uniqueId())
|
||||
if (version == 0) {
|
||||
m_qtVersionId = -1;
|
||||
m_shadowBuild = false;
|
||||
setToolChain(0);
|
||||
emit proFileEvaluateNeeded(this);
|
||||
emit qtVersionChanged();
|
||||
emit environmentChanged();
|
||||
emitBuildDirectoryChanged();
|
||||
return;
|
||||
}
|
||||
if (m_qtVersionId == version->uniqueId())
|
||||
return;
|
||||
|
||||
m_qtVersionId = version->uniqueId();
|
||||
|
||||
@@ -371,23 +364,21 @@ void Qt4BuildConfiguration::setQtVersion(QtVersion *version)
|
||||
|
||||
void Qt4BuildConfiguration::setToolChain(ProjectExplorer::ToolChain *tc)
|
||||
{
|
||||
Q_ASSERT(qtVersion());
|
||||
if (tc != 0 && !qt4Target()->possibleToolChains(this).contains(tc))
|
||||
return;
|
||||
|
||||
BuildConfiguration::setToolChain(tc);
|
||||
|
||||
emit proFileEvaluateNeeded(this);
|
||||
emit environmentChanged();
|
||||
emitBuildDirectoryChanged();
|
||||
}
|
||||
|
||||
QtVersion::QmakeBuildConfigs Qt4BuildConfiguration::qmakeBuildConfiguration() const
|
||||
BaseQtVersion::QmakeBuildConfigs Qt4BuildConfiguration::qmakeBuildConfiguration() const
|
||||
{
|
||||
return m_qmakeBuildConfiguration;
|
||||
}
|
||||
|
||||
void Qt4BuildConfiguration::setQMakeBuildConfiguration(QtVersion::QmakeBuildConfigs config)
|
||||
void Qt4BuildConfiguration::setQMakeBuildConfiguration(BaseQtVersion::QmakeBuildConfigs config)
|
||||
{
|
||||
if (m_qmakeBuildConfiguration == config)
|
||||
return;
|
||||
@@ -422,20 +413,20 @@ void Qt4BuildConfiguration::emitS60CreatesSmartInstallerChanged()
|
||||
QStringList Qt4BuildConfiguration::configCommandLineArguments() const
|
||||
{
|
||||
QStringList result;
|
||||
QtVersion::QmakeBuildConfigs defaultBuildConfiguration = qtVersion()->defaultBuildConfig();
|
||||
QtVersion::QmakeBuildConfigs userBuildConfiguration = m_qmakeBuildConfiguration;
|
||||
if ((defaultBuildConfiguration & QtVersion::BuildAll) && !(userBuildConfiguration & QtVersion::BuildAll))
|
||||
BaseQtVersion::QmakeBuildConfigs defaultBuildConfiguration = qtVersion() ? qtVersion()->defaultBuildConfig() : (BaseQtVersion::DebugBuild | BaseQtVersion::BuildAll);
|
||||
BaseQtVersion::QmakeBuildConfigs userBuildConfiguration = m_qmakeBuildConfiguration;
|
||||
if ((defaultBuildConfiguration & BaseQtVersion::BuildAll) && !(userBuildConfiguration & BaseQtVersion::BuildAll))
|
||||
result << "CONFIG-=debug_and_release";
|
||||
|
||||
if (!(defaultBuildConfiguration & QtVersion::BuildAll) && (userBuildConfiguration & QtVersion::BuildAll))
|
||||
if (!(defaultBuildConfiguration & BaseQtVersion::BuildAll) && (userBuildConfiguration & BaseQtVersion::BuildAll))
|
||||
result << "CONFIG+=debug_and_release";
|
||||
if ((defaultBuildConfiguration & QtVersion::DebugBuild)
|
||||
&& !(userBuildConfiguration & QtVersion::DebugBuild)
|
||||
&& !(userBuildConfiguration & QtVersion::BuildAll))
|
||||
if ((defaultBuildConfiguration & BaseQtVersion::DebugBuild)
|
||||
&& !(userBuildConfiguration & BaseQtVersion::DebugBuild)
|
||||
&& !(userBuildConfiguration & BaseQtVersion::BuildAll))
|
||||
result << "CONFIG+=release";
|
||||
if (!(defaultBuildConfiguration & QtVersion::DebugBuild)
|
||||
&& (userBuildConfiguration & QtVersion::DebugBuild)
|
||||
&& !(userBuildConfiguration & QtVersion::BuildAll))
|
||||
if (!(defaultBuildConfiguration & BaseQtVersion::DebugBuild)
|
||||
&& (userBuildConfiguration & BaseQtVersion::DebugBuild)
|
||||
&& !(userBuildConfiguration & BaseQtVersion::BuildAll))
|
||||
result << "CONFIG+=debug";
|
||||
return result;
|
||||
}
|
||||
@@ -466,8 +457,6 @@ void Qt4BuildConfiguration::qtVersionsChanged(const QList<int> &changedVersions)
|
||||
{
|
||||
if (!changedVersions.contains(m_qtVersionId))
|
||||
return;
|
||||
if (!qtVersion()->isValid())
|
||||
pickValidQtVersion();
|
||||
emit environmentChanged(); // Our qt version changed, that might have changed the environment
|
||||
}
|
||||
|
||||
@@ -477,10 +466,12 @@ bool Qt4BuildConfiguration::compareToImportFrom(const QString &makefile)
|
||||
QMakeStep *qs = qmakeStep();
|
||||
if (QFileInfo(makefile).exists() && qs) {
|
||||
QString qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(makefile);
|
||||
QtVersion *version = qtVersion();
|
||||
BaseQtVersion *version = qtVersion();
|
||||
if (!version)
|
||||
return false;
|
||||
if (version->qmakeCommand() == qmakePath) {
|
||||
// same qtversion
|
||||
QPair<QtVersion::QmakeBuildConfigs, QString> result =
|
||||
QPair<BaseQtVersion::QmakeBuildConfigs, QString> result =
|
||||
QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig());
|
||||
if (qmakeBuildConfiguration() == result.first) {
|
||||
// The qmake Build Configuration are the same,
|
||||
@@ -552,7 +543,7 @@ void Qt4BuildConfiguration::removeQMLInspectorFromArguments(QString *args)
|
||||
}
|
||||
|
||||
QString Qt4BuildConfiguration::extractSpecFromArguments(QString *args,
|
||||
const QString &directory, const QtVersion *version,
|
||||
const QString &directory, const BaseQtVersion *version,
|
||||
QStringList *outArgs)
|
||||
{
|
||||
QString parsedSpec;
|
||||
@@ -674,13 +665,11 @@ void Qt4BuildConfigurationFactory::update()
|
||||
{
|
||||
m_versions.clear();
|
||||
QtVersionManager *vm = QtVersionManager::instance();
|
||||
foreach (const QtVersion *version, vm->versions()) {
|
||||
if (version->isValid()) {
|
||||
QString key = QString::fromLatin1(QT4_BC_ID_PREFIX)
|
||||
+ QString::fromLatin1("Qt%1").arg(version->uniqueId());
|
||||
VersionInfo info(tr("Using Qt Version \"%1\"").arg(version->displayName()), version->uniqueId());
|
||||
m_versions.insert(key, info);
|
||||
}
|
||||
foreach (BaseQtVersion *version, vm->validVersions()) {
|
||||
QString key = QString::fromLatin1(QT4_BC_ID_PREFIX)
|
||||
+ QString::fromLatin1("Qt%1").arg(version->uniqueId());
|
||||
VersionInfo info(tr("Using Qt Version \"%1\"").arg(version->displayName()), version->uniqueId());
|
||||
m_versions.insert(key, info);
|
||||
}
|
||||
emit availableCreationIdsChanged();
|
||||
}
|
||||
@@ -715,7 +704,7 @@ bool Qt4BuildConfigurationFactory::canCreate(ProjectExplorer::Target *parent, co
|
||||
if (!m_versions.contains(id))
|
||||
return false;
|
||||
const VersionInfo &info = m_versions.value(id);
|
||||
QtVersion *version = QtVersionManager::instance()->version(info.versionId);
|
||||
BaseQtVersion *version = QtVersionManager::instance()->version(info.versionId);
|
||||
if (!version ||
|
||||
!version->supportsTargetId(parent->id()))
|
||||
return false;
|
||||
@@ -728,7 +717,7 @@ BuildConfiguration *Qt4BuildConfigurationFactory::create(ProjectExplorer::Target
|
||||
return 0;
|
||||
|
||||
const VersionInfo &info = m_versions.value(id);
|
||||
QtVersion *version = QtVersionManager::instance()->version(info.versionId);
|
||||
BaseQtVersion *version = QtVersionManager::instance()->version(info.versionId);
|
||||
Q_ASSERT(version);
|
||||
|
||||
Qt4BaseTarget *qt4Target = static_cast<Qt4BaseTarget *>(parent);
|
||||
@@ -747,13 +736,14 @@ BuildConfiguration *Qt4BuildConfigurationFactory::create(ProjectExplorer::Target
|
||||
//: Debug build configuration. We recommend not translating it.
|
||||
BuildConfiguration *bc = qt4Target->addQt4BuildConfiguration(tr("%1 Debug").arg(buildConfigurationName),
|
||||
version,
|
||||
(version->defaultBuildConfig() | QtVersion::DebugBuild),
|
||||
(version->defaultBuildConfig() | BaseQtVersion::DebugBuild),
|
||||
QString(), QString());
|
||||
|
||||
if (qt4Target->id() != Constants::S60_EMULATOR_TARGET_ID) {
|
||||
//: Release build configuration. We recommend not translating it.
|
||||
bc = qt4Target->addQt4BuildConfiguration(tr("%1 Release").arg(buildConfigurationName),
|
||||
version,
|
||||
(version->defaultBuildConfig() & ~QtVersion::DebugBuild),
|
||||
(version->defaultBuildConfig() & ~BaseQtVersion::DebugBuild),
|
||||
QString(), QString());
|
||||
}
|
||||
return bc;
|
||||
@@ -767,7 +757,7 @@ bool Qt4BuildConfigurationFactory::canClone(ProjectExplorer::Target *parent, Pro
|
||||
if (!qt4bc)
|
||||
return false;
|
||||
|
||||
QtVersion *version = qt4bc->qtVersion();
|
||||
BaseQtVersion *version = qt4bc->qtVersion();
|
||||
if (!version ||
|
||||
!version->supportsTargetId(parent->id()))
|
||||
return false;
|
||||
@@ -817,15 +807,15 @@ void Qt4BuildConfiguration::importFromBuildDirectory()
|
||||
QString qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(mkfile);
|
||||
if (!qmakePath.isEmpty()) {
|
||||
QtVersionManager *vm = QtVersionManager::instance();
|
||||
QtVersion *version = vm->qtVersionForQMakeBinary(qmakePath);
|
||||
BaseQtVersion *version = vm->qtVersionForQMakeBinary(qmakePath);
|
||||
if (!version) {
|
||||
version = new QtVersion(qmakePath);
|
||||
version = QtVersionFactory::createQtVersionFromQMakePath(qmakePath);
|
||||
vm->addVersion(version);
|
||||
}
|
||||
|
||||
QPair<QtVersion::QmakeBuildConfigs, QString> result =
|
||||
QPair<BaseQtVersion::QmakeBuildConfigs, QString> result =
|
||||
QtVersionManager::scanMakeFile(directory, version->defaultBuildConfig());
|
||||
QtVersion::QmakeBuildConfigs qmakeBuildConfig = result.first;
|
||||
BaseQtVersion::QmakeBuildConfigs qmakeBuildConfig = result.first;
|
||||
|
||||
QString aa = result.second;
|
||||
QString parsedSpec = Qt4BuildConfiguration::extractSpecFromArguments(&aa, directory, version);
|
||||
@@ -850,8 +840,8 @@ void Qt4BuildConfiguration::importFromBuildDirectory()
|
||||
// If we are switching to BuildAll we want "release" in there and no "debug"
|
||||
// or "debug" in there and no "release"
|
||||
// If we are switching to not BuildAl we want neither "release" nor "debug" in there
|
||||
bool debug = qmakeBuildConfig & QtVersion::DebugBuild;
|
||||
bool haveTag = !(qmakeBuildConfig & QtVersion::BuildAll);
|
||||
bool debug = qmakeBuildConfig & BaseQtVersion::DebugBuild;
|
||||
bool haveTag = !(qmakeBuildConfig & BaseQtVersion::BuildAll);
|
||||
QString makeCmdArguments = makeStep()->userArguments();
|
||||
Utils::QtcProcess::ArgIterator ait(&makeCmdArguments);
|
||||
while (ait.next()) {
|
||||
@@ -876,7 +866,7 @@ void Qt4BuildConfiguration::importFromBuildDirectory()
|
||||
|
||||
BuildConfiguration::BuildType Qt4BuildConfiguration::buildType() const
|
||||
{
|
||||
if (qmakeBuildConfiguration() & QtVersion::DebugBuild)
|
||||
if (qmakeBuildConfiguration() & BaseQtVersion::DebugBuild)
|
||||
return Debug;
|
||||
else
|
||||
return Release;
|
||||
|
@@ -75,13 +75,13 @@ public:
|
||||
Qt4ProjectManager::Internal::Qt4ProFileNode *subNodeBuild() const;
|
||||
|
||||
// returns the qtVersion
|
||||
QtVersion *qtVersion() const;
|
||||
void setQtVersion(QtVersion *);
|
||||
BaseQtVersion *qtVersion() const;
|
||||
void setQtVersion(BaseQtVersion *);
|
||||
|
||||
void setToolChain(ProjectExplorer::ToolChain *tc);
|
||||
|
||||
QtVersion::QmakeBuildConfigs qmakeBuildConfiguration() const;
|
||||
void setQMakeBuildConfiguration(QtVersion::QmakeBuildConfigs config);
|
||||
BaseQtVersion::QmakeBuildConfigs qmakeBuildConfiguration() const;
|
||||
void setQMakeBuildConfiguration(BaseQtVersion::QmakeBuildConfigs config);
|
||||
|
||||
/// \internal for qmakestep
|
||||
// used by qmake step to notify that the qmake args have changed
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
bool compareToImportFrom(const QString &makefile);
|
||||
static void removeQMLInspectorFromArguments(QString *args);
|
||||
static QString extractSpecFromArguments(QString *arguments,
|
||||
const QString &directory, const QtVersion *version,
|
||||
const QString &directory, const BaseQtVersion *version,
|
||||
QStringList *outArgs = 0);
|
||||
|
||||
QVariantMap toMap() const;
|
||||
@@ -165,7 +165,7 @@ private:
|
||||
QString m_buildDirectory;
|
||||
QString m_lastEmmitedBuildDirectory;
|
||||
int m_qtVersionId;
|
||||
QtVersion::QmakeBuildConfigs m_qmakeBuildConfiguration;
|
||||
BaseQtVersion::QmakeBuildConfigs m_qmakeBuildConfiguration;
|
||||
Qt4ProjectManager::Internal::Qt4ProFileNode *m_subNodeBuild;
|
||||
};
|
||||
|
||||
|
@@ -2066,7 +2066,7 @@ TargetInformation Qt4ProFileNode::targetInformation(ProFileReader *reader) const
|
||||
// Hmm can we find out whether it's debug or release in a saner way?
|
||||
// Theoretically it's in CONFIG
|
||||
QString qmakeBuildConfig = "release";
|
||||
if (m_project->activeTarget()->activeBuildConfiguration()->qmakeBuildConfiguration() & QtVersion::DebugBuild)
|
||||
if (m_project->activeTarget()->activeBuildConfiguration()->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild)
|
||||
qmakeBuildConfig = "debug";
|
||||
wd += QLatin1Char('/') + qmakeBuildConfig;
|
||||
}
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#include "qt4buildconfiguration.h"
|
||||
#include "findqt4profiles.h"
|
||||
#include "qmldumptool.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
@@ -433,7 +434,9 @@ void Qt4Project::updateCppCodeModel()
|
||||
QStringList predefinedFrameworkPaths;
|
||||
QByteArray predefinedMacros;
|
||||
|
||||
QString qtFrameworkPath = activeBC->qtVersion()->frameworkInstallPath();
|
||||
QString qtFrameworkPath;
|
||||
if (activeBC->qtVersion())
|
||||
qtFrameworkPath = activeBC->qtVersion()->frameworkInstallPath();
|
||||
if (!qtFrameworkPath.isEmpty())
|
||||
predefinedFrameworkPaths.append(qtFrameworkPath);
|
||||
|
||||
@@ -442,7 +445,8 @@ void Qt4Project::updateCppCodeModel()
|
||||
predefinedMacros = tc->predefinedMacros();
|
||||
|
||||
QList<HeaderPath> headers = tc->systemHeaderPaths();
|
||||
headers.append(activeBC->qtVersion()->systemHeaderPathes());
|
||||
if (activeBC->qtVersion())
|
||||
headers.append(activeBC->qtVersion()->systemHeaderPathes());
|
||||
foreach (const HeaderPath &headerPath, headers) {
|
||||
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
|
||||
predefinedFrameworkPaths.append(headerPath.path());
|
||||
@@ -485,26 +489,11 @@ void Qt4Project::updateCppCodeModel()
|
||||
if (!allIncludePaths.contains(includePath))
|
||||
allIncludePaths.append(includePath);
|
||||
}
|
||||
|
||||
#if 0 // Experimental PKGCONFIG support
|
||||
{ // Pkg Config support
|
||||
QStringList pkgConfig = pro->variableValue(PkgConfigVar);
|
||||
if (!pkgConfig.isEmpty()) {
|
||||
pkgConfig.prepend("--cflags-only-I");
|
||||
QProcess process;
|
||||
process.start("pkg-config", pkgConfig);
|
||||
process.waitForFinished();
|
||||
QString result = process.readAllStandardOutput();
|
||||
foreach(const QString &part, result.trimmed().split(' ', QString::SkipEmptyParts)) {
|
||||
info.includes.append(part.mid(2)); // Chop off "-I"
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Add mkspec directory
|
||||
allIncludePaths.append(activeBC->qtVersion()->mkspecPath());
|
||||
if (activeBC->qtVersion())
|
||||
allIncludePaths.append(activeBC->qtVersion()->mkspecPath());
|
||||
|
||||
allIncludePaths.append(predefinedIncludePaths);
|
||||
|
||||
@@ -565,9 +554,9 @@ void Qt4Project::updateQmlJSCodeModel()
|
||||
}
|
||||
bool preferDebugDump = false;
|
||||
if (activeTarget() && activeTarget()->activeBuildConfiguration()) {
|
||||
preferDebugDump = activeTarget()->activeBuildConfiguration()->qmakeBuildConfiguration() & QtVersion::DebugBuild;
|
||||
const QtVersion *qtVersion = activeTarget()->activeBuildConfiguration()->qtVersion();
|
||||
if (qtVersion->isValid()) {
|
||||
preferDebugDump = activeTarget()->activeBuildConfiguration()->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild;
|
||||
BaseQtVersion *qtVersion = activeTarget()->activeBuildConfiguration()->qtVersion();
|
||||
if (qtVersion && qtVersion->isValid()) {
|
||||
const QString qtVersionImportPath = qtVersion->versionInfo().value("QT_INSTALL_IMPORTS");
|
||||
if (!qtVersionImportPath.isEmpty())
|
||||
projectInfo.importPaths += qtVersionImportPath;
|
||||
@@ -885,8 +874,8 @@ ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4ProFileNode, Q
|
||||
bc = activeTarget()->activeBuildConfiguration();
|
||||
|
||||
if (bc) {
|
||||
QtVersion *version = bc->qtVersion();
|
||||
if (version->isValid()) {
|
||||
BaseQtVersion *version = bc->qtVersion();
|
||||
if (version && version->isValid()) {
|
||||
m_proFileOption->properties = version->versionInfo();
|
||||
if (bc->toolChain())
|
||||
m_proFileOption->sysroot = bc->qtVersion()->systemRoot();
|
||||
|
@@ -39,6 +39,8 @@
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4projectmanager.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
#include "qtversionfactory.h"
|
||||
#include "baseqtversion.h"
|
||||
#include "ui_qt4projectconfigwidget.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -125,10 +127,11 @@ Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget()
|
||||
|
||||
void Qt4ProjectConfigWidget::updateDetails()
|
||||
{
|
||||
QtVersion *version = m_buildConfiguration->qtVersion();
|
||||
BaseQtVersion *version = m_buildConfiguration->qtVersion();
|
||||
|
||||
QString versionString;
|
||||
versionString = version->displayName();
|
||||
if (version)
|
||||
versionString = version->displayName();
|
||||
|
||||
if (!version || !version->isValid()) {
|
||||
// Not a valid qt version
|
||||
@@ -157,10 +160,11 @@ void Qt4ProjectConfigWidget::environmentChanged()
|
||||
|
||||
void Qt4ProjectConfigWidget::updateShadowBuildUi()
|
||||
{
|
||||
m_ui->shadowBuildCheckBox->setEnabled(m_buildConfiguration->qtVersion()->supportsShadowBuilds());
|
||||
BaseQtVersion *version = m_buildConfiguration->qtVersion();
|
||||
m_ui->shadowBuildCheckBox->setEnabled(version && version->supportsShadowBuilds());
|
||||
bool isShadowbuilding = m_buildConfiguration->shadowBuild();
|
||||
m_ui->shadowBuildDirEdit->setEnabled(isShadowbuilding && m_buildConfiguration->qtVersion()->supportsShadowBuilds());
|
||||
m_browseButton->setEnabled(isShadowbuilding && m_buildConfiguration->qtVersion()->supportsShadowBuilds());
|
||||
m_ui->shadowBuildDirEdit->setEnabled(isShadowbuilding && version && version->supportsShadowBuilds());
|
||||
m_browseButton->setEnabled(isShadowbuilding && version && version->supportsShadowBuilds());
|
||||
m_ui->shadowBuildDirEdit->setPath(m_buildConfiguration->shadowBuildDirectory());
|
||||
}
|
||||
|
||||
@@ -218,7 +222,8 @@ void Qt4ProjectConfigWidget::init(ProjectExplorer::BuildConfiguration *bc)
|
||||
|
||||
bool shadowBuild = m_buildConfiguration->shadowBuild();
|
||||
m_ui->shadowBuildCheckBox->setChecked(shadowBuild);
|
||||
m_ui->shadowBuildCheckBox->setEnabled(m_buildConfiguration->qtVersion()->supportsShadowBuilds());
|
||||
m_ui->shadowBuildCheckBox->setEnabled(m_buildConfiguration->qtVersion()
|
||||
&& m_buildConfiguration->qtVersion()->supportsShadowBuilds());
|
||||
|
||||
updateShadowBuildUi();
|
||||
updateImportLabel();
|
||||
@@ -236,10 +241,11 @@ void Qt4ProjectConfigWidget::qtVersionChanged()
|
||||
if (m_ignoreChange)
|
||||
return;
|
||||
|
||||
int versionId = m_buildConfiguration->qtVersion()->uniqueId();
|
||||
int versionId = -1;
|
||||
if (m_buildConfiguration->qtVersion())
|
||||
versionId = m_buildConfiguration->qtVersion()->uniqueId();
|
||||
int comboBoxIndex = m_ui->qtVersionComboBox->findData(QVariant(versionId), Qt::UserRole);
|
||||
if (comboBoxIndex > -1)
|
||||
m_ui->qtVersionComboBox->setCurrentIndex(comboBoxIndex);
|
||||
m_ui->qtVersionComboBox->setCurrentIndex(comboBoxIndex);
|
||||
|
||||
updateShadowBuildUi();
|
||||
updateImportLabel();
|
||||
@@ -253,9 +259,9 @@ void Qt4ProjectConfigWidget::qtVersionsChanged()
|
||||
QtVersionManager *vm = QtVersionManager::instance();
|
||||
|
||||
m_ui->qtVersionComboBox->clear();
|
||||
QtVersion * qtVersion = m_buildConfiguration->qtVersion();
|
||||
BaseQtVersion *qtVersion = m_buildConfiguration->qtVersion();
|
||||
|
||||
const QList<QtVersion *> validVersions(vm->versionsForTargetId(m_buildConfiguration->target()->id()));
|
||||
QList<BaseQtVersion *> validVersions = vm->versionsForTargetId(m_buildConfiguration->target()->id());
|
||||
if (!validVersions.isEmpty()) {
|
||||
for (int i = 0; i < validVersions.size(); ++i) {
|
||||
m_ui->qtVersionComboBox->addItem(validVersions.at(i)->displayName(),
|
||||
@@ -265,7 +271,7 @@ void Qt4ProjectConfigWidget::qtVersionsChanged()
|
||||
m_ui->qtVersionComboBox->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
if (!qtVersion->isValid()) {
|
||||
if (!qtVersion || !qtVersion->isValid()) {
|
||||
m_ui->qtVersionComboBox->addItem(tr("Invalid Qt version"), -1);
|
||||
m_ui->qtVersionComboBox->setCurrentIndex(m_ui->qtVersionComboBox->count() - 1);
|
||||
}
|
||||
@@ -340,7 +346,7 @@ void Qt4ProjectConfigWidget::updateImportLabel()
|
||||
makefile.append(m_buildConfiguration->makefile());
|
||||
|
||||
QString qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(makefile);
|
||||
QtVersion *version = m_buildConfiguration->qtVersion();
|
||||
BaseQtVersion *version = m_buildConfiguration->qtVersion();
|
||||
// check that there's a makefile
|
||||
if (!qmakePath.isEmpty()) {
|
||||
// Is it from the same build?
|
||||
@@ -353,10 +359,10 @@ void Qt4ProjectConfigWidget::updateImportLabel()
|
||||
// and that the qmake path is different from the current version
|
||||
// import enable
|
||||
visible = true;
|
||||
QtVersion *newVersion = vm->qtVersionForQMakeBinary(qmakePath);
|
||||
BaseQtVersion *newVersion = vm->qtVersionForQMakeBinary(qmakePath);
|
||||
bool mustDelete(false);
|
||||
if (!newVersion) {
|
||||
newVersion = new QtVersion(qmakePath);
|
||||
newVersion = QtVersionFactory::createQtVersionFromQMakePath(qmakePath);
|
||||
mustDelete = true;
|
||||
}
|
||||
targetMatches = newVersion->supportsTargetId(m_buildConfiguration->target()->id());
|
||||
@@ -376,9 +382,11 @@ void Qt4ProjectConfigWidget::updateImportLabel()
|
||||
QString buildDirectory = m_buildConfiguration->target()->project()->projectDirectory();;
|
||||
if (m_buildConfiguration->shadowBuild())
|
||||
buildDirectory = m_buildConfiguration->buildDirectory();
|
||||
QList<ProjectExplorer::Task> issues = m_buildConfiguration->qtVersion()->reportIssues(m_buildConfiguration->target()->project()->file()->fileName(),
|
||||
buildDirectory,
|
||||
true);
|
||||
QList<ProjectExplorer::Task> issues;
|
||||
if (m_buildConfiguration->qtVersion())
|
||||
issues = m_buildConfiguration->qtVersion()->reportIssues(m_buildConfiguration->target()->project()->file()->fileName(),
|
||||
buildDirectory,
|
||||
true);
|
||||
|
||||
if (incompatibleBuild) {
|
||||
m_ui->problemLabel->setVisible(true);
|
||||
@@ -453,7 +461,7 @@ void Qt4ProjectConfigWidget::qtVersionSelected(const QString &)
|
||||
m_ui->qtVersionComboBox->removeItem(m_ui->qtVersionComboBox->count() - 1);
|
||||
|
||||
QtVersionManager *vm = QtVersionManager::instance();
|
||||
QtVersion *newQtVersion = vm->version(newQtVersionId);
|
||||
BaseQtVersion *newQtVersion = vm->version(newQtVersionId);
|
||||
|
||||
m_ignoreChange = true;
|
||||
m_buildConfiguration->setQtVersion(newQtVersion);
|
||||
|
@@ -191,8 +191,10 @@ void Qt4Manager::updateVariable(const QString &variable)
|
||||
Core::VariableManager::instance()->remove(QLatin1String(kInstallBins));
|
||||
return;
|
||||
}
|
||||
QString value = qt4pro->activeTarget()->activeBuildConfiguration()
|
||||
->qtVersion()->versionInfo().value(QLatin1String("QT_INSTALL_BINS"));
|
||||
QString value;
|
||||
BaseQtVersion *qtv = qt4pro->activeTarget()->activeBuildConfiguration()->qtVersion();
|
||||
if (qtv)
|
||||
value = qtv->versionInfo().value(QLatin1String("QT_INSTALL_BINS"));
|
||||
Core::VariableManager::instance()->insert(QLatin1String(kInstallBins), value);
|
||||
}
|
||||
}
|
||||
|
@@ -74,7 +74,12 @@ HEADERS += \
|
||||
debugginghelperbuildtask.h \
|
||||
qt4targetsetupwidget.h \
|
||||
qt4basetargetfactory.h \
|
||||
buildconfigurationinfo.h
|
||||
buildconfigurationinfo.h \
|
||||
qtversionfactory.h \
|
||||
winceqtversionfactory.h \
|
||||
baseqtversion.h \
|
||||
winceqtversion.h
|
||||
|
||||
SOURCES += qt4projectmanagerplugin.cpp \
|
||||
qtparser.cpp \
|
||||
qt4projectmanager.cpp \
|
||||
@@ -139,7 +144,11 @@ SOURCES += qt4projectmanagerplugin.cpp \
|
||||
qmldebugginglibrary.cpp \
|
||||
profilecompletion.cpp \
|
||||
profilekeywords.cpp \
|
||||
debugginghelperbuildtask.cpp
|
||||
debugginghelperbuildtask.cpp \
|
||||
qtversionfactory.cpp \
|
||||
winceqtversionfactory.cpp \
|
||||
baseqtversion.cpp \
|
||||
winceqtversion.cpp
|
||||
FORMS += makestep.ui \
|
||||
qmakestep.ui \
|
||||
qt4projectconfigwidget.ui \
|
||||
|
@@ -111,6 +111,13 @@ const char * const MAEMO_TOOLCHAIN_ID = "Qt4ProjectManager.ToolChain.Maemo";
|
||||
const char * const RVCT_TOOLCHAIN_ID = "Qt4ProjectManager.ToolChain.RVCT";
|
||||
const char * const WINSCW_TOOLCHAIN_ID = "Qt4ProjectManager.ToolChain.WINSCW";
|
||||
|
||||
// QtVersions
|
||||
const char * const SYMBIANQT = "Qt4ProjectManager.QtVersion.Symbian";
|
||||
const char * const MAEMOQT = "Qt4ProjectManager.QtVersion.Maemo";
|
||||
const char * const DESKTOPQT = "Qt4ProjectManager.QtVersion.Desktop";
|
||||
const char * const SIMULATORQT = "Qt4ProjectManager.QtVersion.Simulator";
|
||||
const char * const WINCEQT = "Qt4ProjectManager.QtVersion.WinCE";
|
||||
|
||||
// ICONS
|
||||
const char * const ICON_QT_PROJECT = ":/qt4projectmanager/images/qt_project.png";
|
||||
const char * const ICON_WINDOW = ":/qt4projectmanager/images/window.png";
|
||||
|
@@ -61,6 +61,9 @@
|
||||
#include "qt-desktop/qt4desktoptargetfactory.h"
|
||||
#include "qt-desktop/qt4simulatortargetfactory.h"
|
||||
#include "qt-desktop/qt4runconfiguration.h"
|
||||
#include "qt-desktop/desktopqtversionfactory.h"
|
||||
#include "qt-desktop/simulatorqtversionfactory.h"
|
||||
#include "winceqtversionfactory.h"
|
||||
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -120,6 +123,8 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
m_projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance();
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
|
||||
new ProFileCacheManager(this);
|
||||
|
||||
QtVersionManager *mgr = new QtVersionManager;
|
||||
addAutoReleasedObject(mgr);
|
||||
addAutoReleasedObject(new QtOptionsPage);
|
||||
@@ -171,6 +176,10 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
addAutoReleasedObject(new Qt4DesktopTargetFactory);
|
||||
addAutoReleasedObject(new Qt4SimulatorTargetFactory);
|
||||
|
||||
addAutoReleasedObject(new DesktopQtVersionFactory);
|
||||
addAutoReleasedObject(new SimulatorQtVersionFactory);
|
||||
addAutoReleasedObject(new WinCeQtVersionFactory);
|
||||
|
||||
ProFileCompletion *completion = new ProFileCompletion;
|
||||
addAutoReleasedObject(completion);
|
||||
// Set completion settings and keep them up to date
|
||||
@@ -179,8 +188,6 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
connect(textEditorSettings, SIGNAL(completionSettingsChanged(TextEditor::CompletionSettings)),
|
||||
completion, SLOT(setCompletionSettings(TextEditor::CompletionSettings)));
|
||||
|
||||
new ProFileCacheManager(this);
|
||||
|
||||
// TODO reenable
|
||||
//m_embeddedPropertiesPage = new EmbeddedPropertiesPage;
|
||||
//addObject(m_embeddedPropertiesPage);
|
||||
@@ -287,6 +294,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
void Qt4ProjectManagerPlugin::extensionsInitialized()
|
||||
{
|
||||
m_qt4ProjectManager->init();
|
||||
QtVersionManager::instance()->extensionsInitialized();
|
||||
}
|
||||
|
||||
void Qt4ProjectManagerPlugin::updateContextMenu(Project *project,
|
||||
|
@@ -38,6 +38,8 @@
|
||||
#include "qt4project.h"
|
||||
#include "qt4basetargetfactory.h"
|
||||
#include "qt4projectconfigwidget.h"
|
||||
#include "qtversionfactory.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
@@ -104,17 +106,17 @@ ProjectExplorer::Target *Qt4BaseTargetFactory::create(ProjectExplorer::Project *
|
||||
QList<BuildConfigurationInfo> Qt4BaseTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion)
|
||||
{
|
||||
QList<BuildConfigurationInfo> infoList;
|
||||
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
|
||||
QList<BaseQtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
|
||||
|
||||
foreach (QtVersion *version, knownVersions) {
|
||||
foreach (BaseQtVersion *version, knownVersions) {
|
||||
if (!version->isValid() || !version->toolChainAvailable(id))
|
||||
continue;
|
||||
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
|
||||
BaseQtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
|
||||
BuildConfigurationInfo info = BuildConfigurationInfo(version, config, QString(), QString());
|
||||
info.directory = shadowBuildDirectory(proFilePath, id, msgBuildConfigurationName(info));
|
||||
infoList.append(info);
|
||||
|
||||
info.buildConfig = config ^ QtVersion::DebugBuild;
|
||||
info.buildConfig = config ^ BaseQtVersion::DebugBuild;
|
||||
info.directory = shadowBuildDirectory(proFilePath, id, msgBuildConfigurationName(info));
|
||||
infoList.append(info);
|
||||
}
|
||||
@@ -176,7 +178,7 @@ Qt4BaseTargetFactory *Qt4BaseTargetFactory::qt4BaseTargetFactoryForId(const QStr
|
||||
QString Qt4BaseTargetFactory::msgBuildConfigurationName(const BuildConfigurationInfo &info)
|
||||
{
|
||||
const QString qtVersionName = info.version->displayName();
|
||||
return (info.buildConfig & QtVersion::DebugBuild) ?
|
||||
return (info.buildConfig & BaseQtVersion::DebugBuild) ?
|
||||
//: Name of a debug build configuration to created by a project wizard, %1 being the Qt version name. We recommend not translating it.
|
||||
tr("%1 Debug").arg(qtVersionName) :
|
||||
//: Name of a release build configuration to created by a project wizard, %1 being the Qt version name. We recommend not translating it.
|
||||
@@ -229,7 +231,7 @@ QList<ProjectExplorer::ToolChain *> Qt4BaseTarget::possibleToolChains(ProjectExp
|
||||
QList<ProjectExplorer::ToolChain *> result;
|
||||
|
||||
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(bc);
|
||||
if (!qt4bc && !qt4bc->qtVersion()->isValid())
|
||||
if (!qt4bc || !qt4bc->qtVersion() || !qt4bc->qtVersion()->isValid())
|
||||
return tmp;
|
||||
|
||||
QList<ProjectExplorer::Abi> abiList = qt4bc->qtVersion()->qtAbis();
|
||||
@@ -261,13 +263,13 @@ void Qt4BaseTarget::removeUnconfiguredCustomExectutableRunConfigurations()
|
||||
}
|
||||
}
|
||||
|
||||
Qt4BuildConfiguration *Qt4BaseTarget::addQt4BuildConfiguration(QString displayName, QtVersion *qtversion,
|
||||
QtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
|
||||
Qt4BuildConfiguration *Qt4BaseTarget::addQt4BuildConfiguration(QString displayName, BaseQtVersion *qtversion,
|
||||
BaseQtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
|
||||
QString additionalArguments,
|
||||
QString directory)
|
||||
{
|
||||
Q_ASSERT(qtversion);
|
||||
bool debug = qmakeBuildConfiguration & QtVersion::DebugBuild;
|
||||
bool debug = qmakeBuildConfiguration & BaseQtVersion::DebugBuild;
|
||||
|
||||
// Add the buildconfiguration
|
||||
Qt4BuildConfiguration *bc = new Qt4BuildConfiguration(this);
|
||||
@@ -292,7 +294,7 @@ Qt4BuildConfiguration *Qt4BaseTarget::addQt4BuildConfiguration(QString displayNa
|
||||
qmakeStep->setUserArguments(additionalArguments);
|
||||
|
||||
// set some options for qmake and make
|
||||
if (qmakeBuildConfiguration & QtVersion::BuildAll) // debug_and_release => explicit targets
|
||||
if (qmakeBuildConfiguration & BaseQtVersion::BuildAll) // debug_and_release => explicit targets
|
||||
makeStep->setUserArguments(debug ? "debug" : "release");
|
||||
|
||||
bc->setQMakeBuildConfiguration(qmakeBuildConfiguration);
|
||||
@@ -582,8 +584,8 @@ void Qt4DefaultTargetSetupWidget::targetCheckBoxToggled(bool b)
|
||||
QString Qt4DefaultTargetSetupWidget::displayNameFrom(const BuildConfigurationInfo &info)
|
||||
{
|
||||
QString buildType;
|
||||
if ((info.buildConfig & QtVersion::BuildAll) == 0) {
|
||||
if (info.buildConfig & QtVersion::DebugBuild)
|
||||
if ((info.buildConfig & BaseQtVersion::BuildAll) == 0) {
|
||||
if (info.buildConfig & BaseQtVersion::DebugBuild)
|
||||
//: Debug build
|
||||
buildType = tr("debug");
|
||||
else
|
||||
@@ -772,14 +774,14 @@ void Qt4DefaultTargetSetupWidget::setBuildConfigurationInfos(const QList<BuildCo
|
||||
int oldQtVersionId = -1;
|
||||
if (m_versionComboBox->currentIndex() != -1)
|
||||
oldQtVersionId = m_versionComboBox->itemData(m_versionComboBox->currentIndex()).toInt();
|
||||
QList<QtVersion *> list;
|
||||
QList<BaseQtVersion *> list;
|
||||
foreach (const BuildConfigurationInfo &info, m_infos) {
|
||||
if (!list.contains(info.version))
|
||||
list << info.version;
|
||||
}
|
||||
m_ignoreChange = true;
|
||||
m_versionComboBox->clear();
|
||||
foreach (QtVersion *v, list) {
|
||||
foreach (BaseQtVersion *v, list) {
|
||||
m_versionComboBox->addItem(v->displayName(), v->uniqueId());
|
||||
if (v->uniqueId() == oldQtVersionId)
|
||||
m_versionComboBox->setCurrentIndex(m_versionComboBox->count() - 1);
|
||||
@@ -1001,7 +1003,9 @@ QPair<ProjectExplorer::Task::TaskType, QString> Qt4DefaultTargetSetupWidget::fin
|
||||
return qMakePair(ProjectExplorer::Task::Unknown, QString());
|
||||
|
||||
QString buildDir = info.directory;
|
||||
QtVersion *version = info.version;
|
||||
if (!m_shadowBuildEnabled->isChecked())
|
||||
buildDir = QFileInfo(m_proFilePath).absolutePath();
|
||||
BaseQtVersion *version = info.version;
|
||||
|
||||
QList<ProjectExplorer::Task> issues = version->reportIssues(m_proFilePath, buildDir, false);
|
||||
|
||||
@@ -1083,13 +1087,15 @@ BuildConfigurationInfo BuildConfigurationInfo::checkForBuild(const QString &dire
|
||||
return BuildConfigurationInfo();
|
||||
|
||||
bool temporaryQtVersion = false;
|
||||
QtVersion *version = QtVersionManager::instance()->qtVersionForQMakeBinary(qmakeBinary);
|
||||
BaseQtVersion *version = QtVersionManager::instance()->qtVersionForQMakeBinary(qmakeBinary);
|
||||
if (!version) {
|
||||
version = new QtVersion(qmakeBinary);
|
||||
version = QtVersionFactory::createQtVersionFromQMakePath(qmakeBinary);
|
||||
temporaryQtVersion = true;
|
||||
if (!version)
|
||||
return BuildConfigurationInfo();
|
||||
}
|
||||
|
||||
QPair<QtVersion::QmakeBuildConfigs, QString> makefileBuildConfig =
|
||||
QPair<BaseQtVersion::QmakeBuildConfigs, QString> makefileBuildConfig =
|
||||
QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig());
|
||||
|
||||
QString additionalArguments = makefileBuildConfig.second;
|
||||
|
@@ -78,8 +78,8 @@ public:
|
||||
// This is the same for almost all Qt4Targets
|
||||
// so for now offer a convience function
|
||||
Qt4BuildConfiguration *addQt4BuildConfiguration(QString displayName,
|
||||
QtVersion *qtversion,
|
||||
QtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
|
||||
BaseQtVersion *qtversion,
|
||||
BaseQtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
|
||||
QString additionalArguments,
|
||||
QString directory);
|
||||
|
||||
|
@@ -36,30 +36,21 @@
|
||||
#include "ui_qtversioninfo.h"
|
||||
#include "ui_debugginghelper.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4target.h"
|
||||
#include "qtversionmanager.h"
|
||||
#include "qtversionfactory.h"
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/debugginghelper.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <utils/detailsbutton.h>
|
||||
#include <utils/treewidgetcolumnstretcher.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/buildablehelperlibrary.h>
|
||||
#include <qtconcurrent/runextensions.h>
|
||||
|
||||
#include <QtCore/QFuture>
|
||||
#include <QtCore/QtConcurrentRun>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtGui/QHelpEvent>
|
||||
#include <QtGui/QToolTip>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QMainWindow>
|
||||
|
||||
enum ModelRoles { VersionIdRole = Qt::UserRole, BuildLogRole, BuildRunningRole};
|
||||
|
||||
@@ -117,7 +108,6 @@ void QtOptionsPage::apply()
|
||||
|
||||
QtVersionManager *vm = QtVersionManager::instance();
|
||||
vm->setNewQtVersions(m_widget->versions());
|
||||
m_widget->updateState();
|
||||
}
|
||||
|
||||
bool QtOptionsPage::matches(const QString &s) const
|
||||
@@ -128,27 +118,22 @@ bool QtOptionsPage::matches(const QString &s) const
|
||||
//-----------------------------------------------------
|
||||
|
||||
|
||||
QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> versions)
|
||||
QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<BaseQtVersion *> versions)
|
||||
: QWidget(parent)
|
||||
, m_specifyNameString(tr("<specify a name>"))
|
||||
, m_specifyPathString(tr("<specify a qmake location>"))
|
||||
, m_ui(new Internal::Ui::QtVersionManager())
|
||||
, m_versionUi(new Internal::Ui::QtVersionInfo())
|
||||
, m_debuggingHelperUi(new Internal::Ui::DebuggingHelper())
|
||||
, m_invalidVersionIcon(":/projectexplorer/images/compile_error.png")
|
||||
, m_configurationWidget(0)
|
||||
{
|
||||
// Initialize m_versions
|
||||
foreach(QtVersion *version, versions)
|
||||
m_versions.push_back(new QtVersion(*version));
|
||||
foreach(BaseQtVersion *version, versions)
|
||||
m_versions.push_back(version->clone());
|
||||
|
||||
QWidget *versionInfoWidget = new QWidget();
|
||||
m_versionUi->setupUi(versionInfoWidget);
|
||||
|
||||
m_versionUi->qmakePath->setExpectedKind(Utils::PathChooser::ExistingCommand);
|
||||
m_versionUi->qmakePath->setPromptDialogTitle(tr("Select qmake Executable"));
|
||||
m_versionUi->s60SDKPath->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
||||
m_versionUi->s60SDKPath->setPromptDialogTitle(tr("Select S60 SDK Root"));
|
||||
|
||||
QWidget *debuggingHelperDetailsWidget = new QWidget();
|
||||
m_debuggingHelperUi->setupUi(debuggingHelperDetailsWidget);
|
||||
|
||||
@@ -172,32 +157,23 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
|
||||
manualItem->setFirstColumnSpanned(true);
|
||||
|
||||
for (int i = 0; i < m_versions.count(); ++i) {
|
||||
const QtVersion * const version = m_versions.at(i);
|
||||
BaseQtVersion *version = m_versions.at(i);
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(version->isAutodetected()? autoItem : manualItem);
|
||||
item->setText(0, version->displayName());
|
||||
item->setText(1, QDir::toNativeSeparators(version->qmakeCommand()));
|
||||
item->setData(0, VersionIdRole, version->uniqueId());
|
||||
item->setIcon(0, version->isValid()? m_validVersionIcon : m_invalidVersionIcon);
|
||||
}
|
||||
m_ui->qtdirList->expandAll();
|
||||
|
||||
connect(m_versionUi->nameEdit, SIGNAL(textEdited(const QString &)),
|
||||
this, SLOT(updateCurrentQtName()));
|
||||
|
||||
connect(m_versionUi->qmakePath, SIGNAL(changed(QString)),
|
||||
this, SLOT(updateCurrentQMakeLocation()));
|
||||
connect(m_versionUi->s60SDKPath, SIGNAL(changed(QString)),
|
||||
this, SLOT(updateCurrentS60SDKDirectory()));
|
||||
connect(m_versionUi->sbsV2Path, SIGNAL(changed(QString)),
|
||||
this, SLOT(updateCurrentSbsV2Directory()));
|
||||
|
||||
connect(m_ui->addButton, SIGNAL(clicked()),
|
||||
this, SLOT(addQtDir()));
|
||||
connect(m_ui->delButton, SIGNAL(clicked()),
|
||||
this, SLOT(removeQtDir()));
|
||||
|
||||
connect(m_versionUi->qmakePath, SIGNAL(browsingFinished()),
|
||||
this, SLOT(onQtBrowsed()));
|
||||
|
||||
connect(m_ui->qtdirList, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
|
||||
this, SLOT(versionChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
|
||||
|
||||
@@ -216,8 +192,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
|
||||
this, SLOT(slotShowDebuggingBuildLog()));
|
||||
|
||||
connect(m_ui->cleanUpButton, SIGNAL(clicked()), this, SLOT(cleanUpQtVersions()));
|
||||
showEnvironmentPage(0);
|
||||
updateState();
|
||||
userChangedCurrentVersion();
|
||||
updateCleanUpButton();
|
||||
}
|
||||
|
||||
bool QtOptionsPageWidget::eventFilter(QObject *o, QEvent *e)
|
||||
@@ -247,7 +223,7 @@ int QtOptionsPageWidget::currentIndex() const
|
||||
return -1;
|
||||
}
|
||||
|
||||
QtVersion *QtOptionsPageWidget::currentVersion() const
|
||||
BaseQtVersion *QtOptionsPageWidget::currentVersion() const
|
||||
{
|
||||
const int currentItemIndex = currentIndex();
|
||||
if (currentItemIndex >= 0 && currentItemIndex < m_versions.size())
|
||||
@@ -255,7 +231,7 @@ QtVersion *QtOptionsPageWidget::currentVersion() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int findVersionById(const QList<QtVersion *> &l, int id)
|
||||
static inline int findVersionById(const QList<BaseQtVersion *> &l, int id)
|
||||
{
|
||||
const int size = l.size();
|
||||
for (int i = 0; i < size; i++)
|
||||
@@ -271,7 +247,8 @@ void QtOptionsPageWidget::debuggingHelperBuildFinished(int qtVersionId, const QS
|
||||
if (index == -1)
|
||||
return; // Oops, somebody managed to delete the version
|
||||
|
||||
m_versions.at(index)->invalidateCache();
|
||||
BaseQtVersion *version = m_versions.at(index);
|
||||
version->recheckDumper();
|
||||
|
||||
// Update item view
|
||||
QTreeWidgetItem *item = treeItemForIndex(index);
|
||||
@@ -282,17 +259,15 @@ void QtOptionsPageWidget::debuggingHelperBuildFinished(int qtVersionId, const QS
|
||||
item->setData(0, BuildRunningRole, QVariant::fromValue(buildFlags));
|
||||
item->setData(0, BuildLogRole, output);
|
||||
|
||||
QtVersion *qtVersion = m_versions.at(index);
|
||||
|
||||
bool success = true;
|
||||
if (tools & DebuggingHelperBuildTask::GdbDebugging)
|
||||
success &= qtVersion->hasGdbDebuggingHelper();
|
||||
success &= version->hasGdbDebuggingHelper();
|
||||
if (tools & DebuggingHelperBuildTask::QmlDebugging)
|
||||
success &= qtVersion->hasQmlDebuggingLibrary();
|
||||
success &= version->hasQmlDebuggingLibrary();
|
||||
if (tools & DebuggingHelperBuildTask::QmlDump)
|
||||
success &= qtVersion->hasQmlDump();
|
||||
success &= version->hasQmlDump();
|
||||
if (tools & DebuggingHelperBuildTask::QmlObserver)
|
||||
success &= qtVersion->hasQmlObserver();
|
||||
success &= version->hasQmlObserver();
|
||||
|
||||
// Update bottom control if the selection is still the same
|
||||
if (index == currentIndex()) {
|
||||
@@ -305,7 +280,7 @@ void QtOptionsPageWidget::debuggingHelperBuildFinished(int qtVersionId, const QS
|
||||
void QtOptionsPageWidget::cleanUpQtVersions()
|
||||
{
|
||||
QStringList toRemove;
|
||||
foreach (const QtVersion *v, m_versions) {
|
||||
foreach (const BaseQtVersion *v, m_versions) {
|
||||
if (!v->isValid() && !v->isAutodetected())
|
||||
toRemove.append(v->displayName());
|
||||
}
|
||||
@@ -329,7 +304,7 @@ void QtOptionsPageWidget::cleanUpQtVersions()
|
||||
m_versions.removeAt(i);
|
||||
}
|
||||
}
|
||||
updateState();
|
||||
updateCleanUpButton();
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::buildDebuggingHelper(DebuggingHelperBuildTask::Tools tools)
|
||||
@@ -346,7 +321,7 @@ void QtOptionsPageWidget::buildDebuggingHelper(DebuggingHelperBuildTask::Tools t
|
||||
buildFlags |= tools;
|
||||
item->setData(0, BuildRunningRole, QVariant::fromValue(buildFlags));
|
||||
|
||||
QtVersion *version = m_versions.at(index);
|
||||
BaseQtVersion *version = m_versions.at(index);
|
||||
if (!version)
|
||||
return;
|
||||
|
||||
@@ -431,25 +406,40 @@ QtOptionsPageWidget::~QtOptionsPageWidget()
|
||||
delete m_ui;
|
||||
delete m_versionUi;
|
||||
delete m_debuggingHelperUi;
|
||||
delete m_configurationWidget;
|
||||
qDeleteAll(m_versions);
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::addQtDir()
|
||||
{
|
||||
QtVersion *newVersion = new QtVersion(m_specifyNameString, m_specifyPathString);
|
||||
m_versions.append(newVersion);
|
||||
QString filter("qmake (");
|
||||
foreach (const QString &s, Utils::BuildableHelperLibrary::possibleQMakeCommands()) {
|
||||
filter += s + " ";
|
||||
}
|
||||
filter += ")";
|
||||
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui->qtdirList->topLevelItem(1));
|
||||
item->setText(0, newVersion->displayName());
|
||||
item->setText(1, QDir::toNativeSeparators(newVersion->qmakeCommand()));
|
||||
item->setData(0, VersionIdRole, newVersion->uniqueId());
|
||||
QString qtVersion = QFileDialog::getOpenFileName(Core::ICore::instance()->mainWindow(),
|
||||
tr("Select a qmake executable"), QString(), filter);
|
||||
if (qtVersion.isNull())
|
||||
return;
|
||||
if (QtVersionManager::instance()->qtVersionForQMakeBinary(qtVersion)) {
|
||||
// Already exist
|
||||
}
|
||||
|
||||
m_ui->qtdirList->setCurrentItem(item);
|
||||
BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qtVersion);
|
||||
if (version) {
|
||||
m_versions.append(version);
|
||||
|
||||
m_versionUi->nameEdit->setText(newVersion->displayName());
|
||||
m_versionUi->qmakePath->setPath(newVersion->qmakeCommand());
|
||||
m_versionUi->nameEdit->setFocus();
|
||||
m_versionUi->nameEdit->selectAll();
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui->qtdirList->topLevelItem(1));
|
||||
item->setText(0, version->displayName());
|
||||
item->setText(1, QDir::toNativeSeparators(version->qmakeCommand()));
|
||||
item->setData(0, VersionIdRole, version->uniqueId());
|
||||
item->setIcon(0, version->isValid()? m_validVersionIcon : m_invalidVersionIcon);
|
||||
m_ui->qtdirList->setCurrentItem(item); // should update the rest of the ui
|
||||
m_versionUi->nameEdit->setFocus();
|
||||
m_versionUi->nameEdit->selectAll();
|
||||
}
|
||||
updateCleanUpButton();
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::removeQtDir()
|
||||
@@ -461,15 +451,15 @@ void QtOptionsPageWidget::removeQtDir()
|
||||
|
||||
delete item;
|
||||
|
||||
QtVersion *version = m_versions.at(index);
|
||||
BaseQtVersion *version = m_versions.at(index);
|
||||
m_versions.removeAt(index);
|
||||
delete version;
|
||||
updateState();
|
||||
updateCleanUpButton();
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::updateDebuggingHelperUi()
|
||||
{
|
||||
const QtVersion *version = currentVersion();
|
||||
BaseQtVersion *version = currentVersion();
|
||||
const QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
|
||||
|
||||
if (!version || !version->isValid()) {
|
||||
@@ -619,84 +609,49 @@ void QtOptionsPageWidget::updateDebuggingHelperUi()
|
||||
|
||||
m_ui->debuggingHelperWidget->setVisible(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::updateState()
|
||||
// To be called if a qt version was removed or added
|
||||
void QtOptionsPageWidget::updateCleanUpButton()
|
||||
{
|
||||
bool hasInvalidVersion = false;
|
||||
for (int i = 0; i < m_versions.count(); ++i) {
|
||||
QTreeWidgetItem *item = treeItemForIndex(i);
|
||||
if (!m_versions.at(i)->isValid()) {
|
||||
if (item)
|
||||
item->setIcon(0, m_invalidVersionIcon);
|
||||
hasInvalidVersion = true;
|
||||
} else {
|
||||
if (item)
|
||||
item->setIcon(0, m_validVersionIcon);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const QtVersion *version = currentVersion();
|
||||
const bool enabled = version != 0;
|
||||
const bool isAutodetected = enabled && version->isAutodetected();
|
||||
m_ui->delButton->setEnabled(enabled && !isAutodetected);
|
||||
m_ui->cleanUpButton->setEnabled(hasInvalidVersion);
|
||||
m_versionUi->nameEdit->setEnabled(enabled && !isAutodetected);
|
||||
m_versionUi->qmakePath->setEnabled(enabled && !isAutodetected);
|
||||
bool s60SDKPathEnabled = enabled &&
|
||||
(isAutodetected ? version->systemRoot().isEmpty() : true);
|
||||
m_versionUi->s60SDKPath->setEnabled(s60SDKPathEnabled);
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::userChangedCurrentVersion()
|
||||
{
|
||||
updateWidgets();
|
||||
updateDescriptionLabel();
|
||||
updateDebuggingHelperUi();
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::makeS60Visible(bool visible)
|
||||
void QtOptionsPageWidget::qtVersionChanged()
|
||||
{
|
||||
m_versionUi->s60SDKLabel->setVisible(visible);
|
||||
m_versionUi->s60SDKPath->setVisible(visible);
|
||||
m_versionUi->sbsV2Label->setVisible(visible);
|
||||
m_versionUi->sbsV2Path->setVisible(visible);
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
|
||||
{
|
||||
makeS60Visible(false);
|
||||
m_versionUi->errorLabel->setText("");
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
int index = indexForTreeItem(item);
|
||||
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
QtVersion *qtVersion = m_versions.at(index);
|
||||
|
||||
QList<ProjectExplorer::Abi> abis = qtVersion->qtAbis();
|
||||
if (!abis.isEmpty()) {
|
||||
ProjectExplorer::Abi qtAbi = qtVersion->qtAbis().at(0);
|
||||
if (qtAbi.os() == ProjectExplorer::Abi::SymbianOS) {
|
||||
makeS60Visible(true);
|
||||
m_versionUi->s60SDKPath->setPath(QDir::toNativeSeparators(m_versions.at(index)->systemRoot()));
|
||||
m_versionUi->sbsV2Path->setPath(m_versions.at(index)->sbsV2Directory());
|
||||
m_versionUi->sbsV2Path->setEnabled(m_versions.at(index)->isBuildWithSymbianSbsV2());
|
||||
}
|
||||
QTreeWidgetItem *item = m_ui->qtdirList->currentItem();
|
||||
if (item) {
|
||||
BaseQtVersion *version = currentVersion();
|
||||
item->setIcon(0, version->isValid()? m_validVersionIcon : m_invalidVersionIcon);
|
||||
}
|
||||
updateDescriptionLabel();
|
||||
updateDebuggingHelperUi();
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::updateDescriptionLabel()
|
||||
{
|
||||
QtVersion *version = currentVersion();
|
||||
BaseQtVersion *version = currentVersion();
|
||||
if (!version)
|
||||
m_versionUi->errorLabel->setText("");
|
||||
else if (version->isValid())
|
||||
m_versionUi->errorLabel->setText(version->description());
|
||||
m_versionUi->errorLabel->setText( tr("Qt version %1 for %2").arg(version->qtVersionString(),
|
||||
version->description()));
|
||||
else
|
||||
m_versionUi->errorLabel->setText(version->invalidReason());
|
||||
|
||||
updateState();
|
||||
}
|
||||
|
||||
int QtOptionsPageWidget::indexForTreeItem(const QTreeWidgetItem *item) const
|
||||
@@ -726,32 +681,37 @@ QTreeWidgetItem *QtOptionsPageWidget::treeItemForIndex(int index) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::versionChanged(QTreeWidgetItem *item, QTreeWidgetItem *old)
|
||||
void QtOptionsPageWidget::versionChanged(QTreeWidgetItem *newItem, QTreeWidgetItem *old)
|
||||
{
|
||||
if (old) {
|
||||
Q_UNUSED(newItem)
|
||||
if (old)
|
||||
fixQtVersionName(indexForTreeItem(old));
|
||||
}
|
||||
int itemIndex = indexForTreeItem(item);
|
||||
if (itemIndex >= 0) {
|
||||
m_versionUi->nameEdit->setText(item->text(0));
|
||||
m_versionUi->qmakePath->setPath(item->text(1));
|
||||
} else {
|
||||
m_versionUi->nameEdit->clear();
|
||||
m_versionUi->qmakePath->setPath(QString()); // clear()
|
||||
|
||||
}
|
||||
showEnvironmentPage(item);
|
||||
updateState();
|
||||
userChangedCurrentVersion();
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::onQtBrowsed()
|
||||
void QtOptionsPageWidget::updateWidgets()
|
||||
{
|
||||
const QString dir = m_versionUi->qmakePath->path();
|
||||
if (dir.isEmpty())
|
||||
return;
|
||||
delete m_configurationWidget;
|
||||
m_configurationWidget = 0;
|
||||
BaseQtVersion *version = currentVersion();
|
||||
if (version) {
|
||||
m_versionUi->nameEdit->setText(version->displayName());
|
||||
m_versionUi->qmakePath->setText(QDir::toNativeSeparators(version->qmakeCommand()));
|
||||
m_configurationWidget = version->createConfigurationWidget();
|
||||
if (m_configurationWidget) {
|
||||
m_versionUi->formLayout->addRow(m_configurationWidget);
|
||||
connect(m_configurationWidget, SIGNAL(changed()),
|
||||
this, SLOT(qtVersionChanged()));
|
||||
}
|
||||
} else {
|
||||
m_versionUi->nameEdit->clear();
|
||||
m_versionUi->qmakePath->setText(QString()); // clear()
|
||||
}
|
||||
|
||||
updateCurrentQMakeLocation();
|
||||
updateState();
|
||||
const bool enabled = version != 0;
|
||||
const bool isAutodetected = enabled && version->isAutodetected();
|
||||
m_ui->delButton->setEnabled(enabled && !isAutodetected);
|
||||
m_versionUi->nameEdit->setEnabled(enabled && !isAutodetected);
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::updateCurrentQtName()
|
||||
@@ -763,7 +723,6 @@ void QtOptionsPageWidget::updateCurrentQtName()
|
||||
return;
|
||||
m_versions[currentItemIndex]->setDisplayName(m_versionUi->nameEdit->text());
|
||||
currentItem->setText(0, m_versions[currentItemIndex]->displayName());
|
||||
updateDescriptionLabel();
|
||||
}
|
||||
|
||||
|
||||
@@ -808,58 +767,11 @@ void QtOptionsPageWidget::fixQtVersionName(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::updateCurrentQMakeLocation()
|
||||
QList<BaseQtVersion *> QtOptionsPageWidget::versions() const
|
||||
{
|
||||
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
|
||||
Q_ASSERT(currentItem);
|
||||
int currentItemIndex = indexForTreeItem(currentItem);
|
||||
if (currentItemIndex < 0)
|
||||
return;
|
||||
QtVersion *version = m_versions.at(currentItemIndex);
|
||||
if (version->qmakeCommand() == m_versionUi->qmakePath->path())
|
||||
return;
|
||||
version->setQMakeCommand(m_versionUi->qmakePath->path());
|
||||
currentItem->setText(1, QDir::toNativeSeparators(version->qmakeCommand()));
|
||||
showEnvironmentPage(currentItem);
|
||||
|
||||
if (m_versionUi->nameEdit->text().isEmpty() || m_versionUi->nameEdit->text() == m_specifyNameString) {
|
||||
QString name = ProjectExplorer::DebuggingHelperLibrary::qtVersionForQMake(version->qmakeCommand());
|
||||
if (!name.isEmpty())
|
||||
m_versionUi->nameEdit->setText(name);
|
||||
updateCurrentQtName();
|
||||
}
|
||||
|
||||
updateState();
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::updateCurrentS60SDKDirectory()
|
||||
{
|
||||
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
|
||||
Q_ASSERT(currentItem);
|
||||
int currentItemIndex = indexForTreeItem(currentItem);
|
||||
if (currentItemIndex < 0)
|
||||
return;
|
||||
m_versions[currentItemIndex]->setSystemRoot(m_versionUi->s60SDKPath->path());
|
||||
updateDescriptionLabel();
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::updateCurrentSbsV2Directory()
|
||||
{
|
||||
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
|
||||
Q_ASSERT(currentItem);
|
||||
int currentItemIndex = indexForTreeItem(currentItem);
|
||||
if (currentItemIndex < 0)
|
||||
return;
|
||||
m_versions[currentItemIndex]->setSbsV2Directory(m_versionUi->sbsV2Path->path());
|
||||
updateDescriptionLabel();
|
||||
}
|
||||
|
||||
QList<QtVersion *> QtOptionsPageWidget::versions() const
|
||||
{
|
||||
QList<QtVersion *> result;
|
||||
QList<BaseQtVersion *> result;
|
||||
for (int i = 0; i < m_versions.count(); ++i)
|
||||
if (m_versions.at(i)->qmakeCommand() != m_specifyPathString)
|
||||
result.append(new QtVersion(*(m_versions.at(i))));
|
||||
result.append(m_versions.at(i)->clone());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -867,14 +779,20 @@ QString QtOptionsPageWidget::searchKeywords() const
|
||||
{
|
||||
QString rc;
|
||||
QLatin1Char sep(' ');
|
||||
QTextStream(&rc)
|
||||
<< sep << m_versionUi->versionNameLabel->text()
|
||||
<< sep << m_versionUi->pathLabel->text()
|
||||
<< sep << m_versionUi->s60SDKLabel->text()
|
||||
<< sep << m_versionUi->sbsV2Label->text()
|
||||
<< sep << m_debuggingHelperUi->gdbHelperLabel->text()
|
||||
<< sep << m_debuggingHelperUi->qmlDumpLabel->text()
|
||||
<< sep << m_debuggingHelperUi->qmlObserverLabel->text();
|
||||
QTextStream ts(&rc);
|
||||
ts << sep << m_versionUi->versionNameLabel->text()
|
||||
<< sep << m_versionUi->pathLabel->text()
|
||||
<< sep << m_debuggingHelperUi->gdbHelperLabel->text()
|
||||
<< sep << m_debuggingHelperUi->qmlDumpLabel->text()
|
||||
<< sep << m_debuggingHelperUi->qmlObserverLabel->text();
|
||||
|
||||
// Symbian specific, could be factored out to the factory
|
||||
// checking m_configurationWidget is not enough, we want them to be a keyword
|
||||
// regardless of which qt versions configuration widget is currently active
|
||||
ts << sep << tr("S60 SDK:")
|
||||
<< sep << tr("SBS v2 directory:");
|
||||
|
||||
|
||||
rc.remove(QLatin1Char('&'));
|
||||
return rc;
|
||||
}
|
||||
|
@@ -34,12 +34,8 @@
|
||||
#define QTOPTIONSPAGE_H
|
||||
|
||||
#include "debugginghelperbuildtask.h"
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QFutureInterface>
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QIcon>
|
||||
|
||||
@@ -49,7 +45,8 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
|
||||
class QtVersion;
|
||||
class BaseQtVersion;
|
||||
class QtConfigWidget;
|
||||
|
||||
namespace Internal {
|
||||
namespace Ui {
|
||||
@@ -63,47 +60,44 @@ class QtOptionsPageWidget : public QWidget
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(QtOptionsPageWidget)
|
||||
public:
|
||||
QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> versions);
|
||||
QtOptionsPageWidget(QWidget *parent, QList<BaseQtVersion *> versions);
|
||||
~QtOptionsPageWidget();
|
||||
QList<QtVersion *> versions() const;
|
||||
QList<BaseQtVersion *> versions() const;
|
||||
void finish();
|
||||
QString searchKeywords() const;
|
||||
|
||||
virtual bool eventFilter(QObject *o, QEvent *e);
|
||||
|
||||
private:
|
||||
void showEnvironmentPage(QTreeWidgetItem * item);
|
||||
void updateDescriptionLabel();
|
||||
void userChangedCurrentVersion();
|
||||
void updateWidgets();
|
||||
void updateDebuggingHelperUi();
|
||||
void fixQtVersionName(int index);
|
||||
int indexForTreeItem(const QTreeWidgetItem *item) const;
|
||||
QTreeWidgetItem *treeItemForIndex(int index) const;
|
||||
QtVersion *currentVersion() const;
|
||||
BaseQtVersion *currentVersion() const;
|
||||
int currentIndex() const;
|
||||
void showDebuggingBuildLog(const QTreeWidgetItem *currentItem);
|
||||
|
||||
const QString m_specifyNameString;
|
||||
const QString m_specifyPathString;
|
||||
|
||||
Internal::Ui::QtVersionManager *m_ui;
|
||||
Internal::Ui::QtVersionInfo *m_versionUi;
|
||||
Internal::Ui::DebuggingHelper *m_debuggingHelperUi;
|
||||
QList<QtVersion *> m_versions;
|
||||
QList<BaseQtVersion *> m_versions;
|
||||
int m_defaultVersion;
|
||||
QIcon m_invalidVersionIcon;
|
||||
QIcon m_validVersionIcon;
|
||||
|
||||
public slots:
|
||||
void updateState();
|
||||
QtConfigWidget *m_configurationWidget;
|
||||
|
||||
private slots:
|
||||
void qtVersionChanged();
|
||||
void versionChanged(QTreeWidgetItem *item, QTreeWidgetItem *old);
|
||||
void addQtDir();
|
||||
void removeQtDir();
|
||||
void makeS60Visible(bool visible);
|
||||
void onQtBrowsed();
|
||||
void updateCleanUpButton();
|
||||
void updateCurrentQtName();
|
||||
void updateCurrentQMakeLocation();
|
||||
void updateCurrentS60SDKDirectory();
|
||||
void updateCurrentSbsV2Directory();
|
||||
void updateDebuggingHelperUi();
|
||||
void buildDebuggingHelper(DebuggingHelperBuildTask::Tools tools
|
||||
= DebuggingHelperBuildTask::AllTools);
|
||||
void buildGdbHelper();
|
||||
@@ -113,10 +107,6 @@ private slots:
|
||||
void slotShowDebuggingBuildLog();
|
||||
void debuggingHelperBuildFinished(int qtVersionId, const QString &output, DebuggingHelperBuildTask::Tools tools);
|
||||
void cleanUpQtVersions();
|
||||
|
||||
private:
|
||||
void updateDescriptionLabel();
|
||||
void showDebuggingBuildLog(const QTreeWidgetItem *currentItem);
|
||||
};
|
||||
|
||||
class QtOptionsPage : public Core::IOptionsPage
|
||||
|
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "qt4project.h"
|
||||
#include "qt4target.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Internal;
|
||||
@@ -57,6 +58,8 @@ Qt4UiCodeModelSupport::~Qt4UiCodeModelSupport()
|
||||
QString Qt4UiCodeModelSupport::uicCommand() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = m_project->activeTarget()->activeBuildConfiguration();
|
||||
if (!qt4bc->qtVersion())
|
||||
return QString();
|
||||
return qt4bc->qtVersion()->uicCommand();
|
||||
}
|
||||
|
||||
|
90
src/plugins/qt4projectmanager/qtversionfactory.cpp
Normal file
90
src/plugins/qt4projectmanager/qtversionfactory.cpp
Normal file
@@ -0,0 +1,90 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "qtversionfactory.h"
|
||||
#include "profilereader.h"
|
||||
#include "qtversionmanager.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
QtVersionFactory::QtVersionFactory(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QtVersionFactory::~QtVersionFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool sortByPriority(QtVersionFactory *a, QtVersionFactory *b)
|
||||
{
|
||||
return a->priority() > b->priority();
|
||||
}
|
||||
|
||||
BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const QString &qmakePath, bool isAutoDetected, const QString &autoDetectionSource)
|
||||
{
|
||||
QHash<QString, QString> versionInfo;
|
||||
bool success = BaseQtVersion::queryQMakeVariables(qmakePath, &versionInfo);
|
||||
if (!success)
|
||||
return 0;
|
||||
QString mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo);
|
||||
|
||||
ProFileOption option;
|
||||
option.properties = versionInfo;
|
||||
ProMessageHandler msgHandler(true);
|
||||
ProFileCacheManager::instance()->incRefCount();
|
||||
ProFileParser parser(ProFileCacheManager::instance()->cache(), &msgHandler);
|
||||
ProFileEvaluator evaluator(&option, &parser, &msgHandler);
|
||||
if (ProFile *pro = parser.parsedProFile(mkspec + "/qmake.conf")) {
|
||||
evaluator.setCumulative(false);
|
||||
evaluator.accept(pro, ProFileEvaluator::LoadProOnly);
|
||||
pro->deref();
|
||||
}
|
||||
|
||||
QList<QtVersionFactory *> factories = ExtensionSystem::PluginManager::instance()->getObjects<QtVersionFactory>();
|
||||
qSort(factories.begin(), factories.end(), &sortByPriority);
|
||||
|
||||
foreach (QtVersionFactory *factory, factories) {
|
||||
BaseQtVersion *ver = factory->create(qmakePath, &evaluator, isAutoDetected, autoDetectionSource);
|
||||
if (ver) {
|
||||
ProFileCacheManager::instance()->decRefCount();
|
||||
return ver;
|
||||
}
|
||||
}
|
||||
ProFileCacheManager::instance()->decRefCount();
|
||||
return 0;
|
||||
}
|
66
src/plugins/qt4projectmanager/qtversionfactory.h
Normal file
66
src/plugins/qt4projectmanager/qtversionfactory.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef QTVERSIONFACTORY_H
|
||||
#define QTVERSIONFACTORY_H
|
||||
|
||||
#include "baseqtversion.h"
|
||||
#include "qt4projectmanager_global.h"
|
||||
|
||||
#include "profilereader.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QVariantMap>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT QtVersionFactory : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QtVersionFactory(QObject *parent = 0);
|
||||
~QtVersionFactory();
|
||||
|
||||
virtual bool canRestore(const QString &type) = 0;
|
||||
virtual BaseQtVersion *restore(const QVariantMap &data) = 0;
|
||||
|
||||
/// factories with higher priority are asked first to identify
|
||||
/// a qtversion, the priority of the desktop factory is 0 and
|
||||
/// the desktop factory claims to handle all paths
|
||||
virtual int priority() const = 0;
|
||||
virtual BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString()) = 0;
|
||||
|
||||
static BaseQtVersion *createQtVersionFromQMakePath(const QString &qmakePath, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
|
||||
};
|
||||
|
||||
}
|
||||
#endif // QTVERSIONFACTORY_H
|
@@ -6,55 +6,36 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>404</width>
|
||||
<height>105</height>
|
||||
<width>222</width>
|
||||
<height>62</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="versionNameLabel">
|
||||
<property name="text">
|
||||
<string>Version name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="nameEdit"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="pathLabel">
|
||||
<property name="text">
|
||||
<string>qmake location:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Utils::PathChooser" name="qmakePath" native="true"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="s60SDKLabel">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="qmakePath">
|
||||
<property name="text">
|
||||
<string>S60 SDK:</string>
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="Utils::PathChooser" name="s60SDKPath" native="true"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="sbsV2Label">
|
||||
<property name="text">
|
||||
<string>SBS v2 directory:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="Utils::PathChooser" name="sbsV2Path" native="true"/>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="errorLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
@@ -63,18 +44,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Utils::PathChooser</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">utils/pathchooser.h</header>
|
||||
<container>1</container>
|
||||
<slots>
|
||||
<signal>editingFinished()</signal>
|
||||
<signal>browsingFinished()</signal>
|
||||
</slots>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,7 @@
|
||||
#define QTVERSIONMANAGER_H
|
||||
|
||||
#include "qt4projectmanager_global.h"
|
||||
#include "baseqtversion.h"
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
|
||||
@@ -42,6 +43,7 @@
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QFutureInterface>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariantMap>
|
||||
|
||||
namespace Utils {
|
||||
class Environment;
|
||||
@@ -54,194 +56,13 @@ class Task;
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class BaseQtVersion;
|
||||
|
||||
namespace Internal {
|
||||
class QtOptionsPageWidget;
|
||||
class QtOptionsPage;
|
||||
}
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT QtVersionNumber
|
||||
{
|
||||
public:
|
||||
QtVersionNumber(int ma, int mi, int p);
|
||||
QtVersionNumber(const QString &versionString);
|
||||
QtVersionNumber();
|
||||
|
||||
int majorVersion;
|
||||
int minorVersion;
|
||||
int patchVersion;
|
||||
bool operator <(const QtVersionNumber &b) const;
|
||||
bool operator <=(const QtVersionNumber &b) const;
|
||||
bool operator >(const QtVersionNumber &b) const;
|
||||
bool operator >=(const QtVersionNumber &b) const;
|
||||
bool operator !=(const QtVersionNumber &b) const;
|
||||
bool operator ==(const QtVersionNumber &b) const;
|
||||
private:
|
||||
bool checkVersionString(const QString &version) const;
|
||||
};
|
||||
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT QtVersion
|
||||
{
|
||||
friend class QtVersionManager;
|
||||
public:
|
||||
QtVersion(const QString &name, const QString &qmakeCommand,
|
||||
bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
|
||||
explicit QtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
|
||||
QtVersion(const QString &name, const QString &qmakeCommand, int id,
|
||||
bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
QtVersion();
|
||||
~QtVersion();
|
||||
|
||||
bool isValid() const;
|
||||
bool toolChainAvailable(const QString &id) const;
|
||||
|
||||
QString invalidReason() const;
|
||||
QString description() const;
|
||||
bool isAutodetected() const { return m_isAutodetected; }
|
||||
QString autodetectionSource() const { return m_autodetectionSource; }
|
||||
|
||||
QString displayName() const;
|
||||
QString sourcePath() const;
|
||||
QString qmakeCommand() const;
|
||||
QString uicCommand() const;
|
||||
QString designerCommand() const;
|
||||
QString linguistCommand() const;
|
||||
QString qmlviewerCommand() const;
|
||||
QString systemRoot() const;
|
||||
void setSystemRoot(const QString &);
|
||||
|
||||
bool supportsTargetId(const QString &id) const;
|
||||
QSet<QString> supportedTargetIds() const;
|
||||
|
||||
QList<ProjectExplorer::Abi> qtAbis() const;
|
||||
|
||||
/// @returns the name of the mkspec, which is generally not enough
|
||||
/// to pass to qmake.
|
||||
QString mkspec() const;
|
||||
/// @returns the full path to the default directory
|
||||
/// specifally not the directory the symlink/ORIGINAL_QMAKESPEC points to
|
||||
QString mkspecPath() const;
|
||||
|
||||
bool isBuildWithSymbianSbsV2() const;
|
||||
|
||||
void setDisplayName(const QString &name);
|
||||
void setQMakeCommand(const QString &path);
|
||||
|
||||
QString qtVersionString() const;
|
||||
QtVersionNumber qtVersion() const;
|
||||
// Returns the PREFIX, BINPREFIX, DOCPREFIX and similar information
|
||||
QHash<QString,QString> versionInfo() const;
|
||||
|
||||
QString sbsV2Directory() const;
|
||||
void setSbsV2Directory(const QString &directory);
|
||||
|
||||
void addToEnvironment(Utils::Environment &env) const;
|
||||
QList<ProjectExplorer::HeaderPath> systemHeaderPathes() const;
|
||||
|
||||
QString gdbDebuggingHelperLibrary() const;
|
||||
QString qmlDebuggingHelperLibrary(bool debugVersion) const;
|
||||
QString qmlDumpTool(bool debugVersion) const;
|
||||
QString qmlObserverTool() const;
|
||||
QStringList debuggingHelperLibraryLocations() const;
|
||||
|
||||
bool hasGdbDebuggingHelper() const;
|
||||
bool hasQmlDump() const;
|
||||
bool hasQmlDebuggingLibrary() const;
|
||||
bool hasQmlObserver() const;
|
||||
Utils::Environment qmlToolsEnvironment() const;
|
||||
|
||||
void invalidateCache();
|
||||
|
||||
bool hasExamples() const;
|
||||
QString examplesPath() const;
|
||||
|
||||
bool hasDocumentation() const;
|
||||
QString documentationPath() const;
|
||||
|
||||
bool hasDemos() const;
|
||||
QString demosPath() const;
|
||||
|
||||
QString headerInstallPath() const;
|
||||
QString frameworkInstallPath() const;
|
||||
QString libraryInstallPath() const;
|
||||
|
||||
// All valid Ids are >= 0
|
||||
int uniqueId() const;
|
||||
|
||||
enum QmakeBuildConfig
|
||||
{
|
||||
NoBuild = 1,
|
||||
DebugBuild = 2,
|
||||
BuildAll = 8
|
||||
};
|
||||
|
||||
Q_DECLARE_FLAGS(QmakeBuildConfigs, QmakeBuildConfig)
|
||||
|
||||
QmakeBuildConfigs defaultBuildConfig() const;
|
||||
QString toHtml(bool verbose) const;
|
||||
|
||||
bool supportsShadowBuilds() const;
|
||||
|
||||
/// Check a .pro-file/Qt version combination on possible issues with
|
||||
/// its symbian setup.
|
||||
/// @return a list of tasks, ordered on severity (errors first, then
|
||||
/// warnings and finally info items.
|
||||
QList<ProjectExplorer::Task> reportIssues(const QString &proFile, const QString &buildDir, bool includeTargetSpecificErrors);
|
||||
|
||||
ProjectExplorer::IOutputParser *createOutputParser() const;
|
||||
|
||||
private:
|
||||
static int getUniqueId();
|
||||
// Also used by QtOptionsPageWidget
|
||||
void updateSourcePath();
|
||||
void updateVersionInfo() const;
|
||||
QString findQtBinary(const QStringList &possibleName) const;
|
||||
void updateAbiAndMkspec() const;
|
||||
QString qtCorePath() const;
|
||||
|
||||
QString m_displayName;
|
||||
QString m_sourcePath;
|
||||
int m_id;
|
||||
bool m_isAutodetected;
|
||||
QString m_autodetectionSource;
|
||||
mutable bool m_hasDebuggingHelper; // controlled by m_versionInfoUpToDate
|
||||
mutable bool m_hasQmlDump; // controlled by m_versionInfoUpToDate
|
||||
mutable bool m_hasQmlDebuggingLibrary; // controlled by m_versionInfoUpdate
|
||||
mutable bool m_hasQmlObserver; // controlled by m_versionInfoUpToDate
|
||||
|
||||
QString m_sbsV2Directory;
|
||||
mutable QString m_systemRoot;
|
||||
|
||||
mutable bool m_abiUpToDate;
|
||||
mutable QString m_mkspec; // updated lazily
|
||||
mutable QString m_mkspecFullPath;
|
||||
mutable QList<ProjectExplorer::Abi> m_abis;
|
||||
|
||||
mutable bool m_versionInfoUpToDate;
|
||||
mutable QHash<QString,QString> m_versionInfo; // updated lazily
|
||||
mutable bool m_notInstalled;
|
||||
mutable bool m_defaultConfigIsDebug;
|
||||
mutable bool m_defaultConfigIsDebugAndRelease;
|
||||
mutable bool m_hasExamples;
|
||||
mutable bool m_hasDemos;
|
||||
mutable bool m_hasDocumentation;
|
||||
|
||||
mutable QString m_qmakeCommand;
|
||||
mutable QString m_qtVersionString;
|
||||
mutable QString m_uicCommand;
|
||||
mutable QString m_designerCommand;
|
||||
mutable QString m_linguistCommand;
|
||||
mutable QString m_qmlviewerCommand;
|
||||
mutable QSet<QString> m_targetIds;
|
||||
|
||||
mutable bool m_isBuildUsingSbsV2;
|
||||
mutable bool m_qmakeIsExecutable;
|
||||
mutable bool m_validSystemRoot;
|
||||
};
|
||||
|
||||
struct QMakeAssignment
|
||||
{
|
||||
QString variable;
|
||||
@@ -253,51 +74,49 @@ class QT4PROJECTMANAGER_EXPORT QtVersionManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
// for getUniqueId();
|
||||
friend class QtVersion;
|
||||
friend class BaseQtVersion;
|
||||
friend class Internal::QtOptionsPage;
|
||||
public:
|
||||
static QtVersionManager *instance();
|
||||
QtVersionManager();
|
||||
~QtVersionManager();
|
||||
void extensionsInitialized();
|
||||
|
||||
// This will *always* return at least one (Qt in Path), even if that is
|
||||
// unconfigured.
|
||||
QList<QtVersion *> versions() const;
|
||||
QList<QtVersion *> validVersions() const;
|
||||
QList<BaseQtVersion *> versions() const;
|
||||
QList<BaseQtVersion *> validVersions() const;
|
||||
|
||||
// Note: DO NOT STORE THIS POINTER!
|
||||
// The QtVersionManager will delete it at random times and you will
|
||||
// need to get a new pointer by calling this method again!
|
||||
QtVersion *version(int id) const;
|
||||
QtVersion *emptyVersion() const;
|
||||
BaseQtVersion *version(int id) const;
|
||||
|
||||
QtVersion *qtVersionForQMakeBinary(const QString &qmakePath);
|
||||
BaseQtVersion *qtVersionForQMakeBinary(const QString &qmakePath);
|
||||
|
||||
// Used by the projectloadwizard
|
||||
void addVersion(QtVersion *version);
|
||||
void removeVersion(QtVersion *version);
|
||||
void addVersion(BaseQtVersion *version);
|
||||
void removeVersion(BaseQtVersion *version);
|
||||
|
||||
// Target Support:
|
||||
bool supportsTargetId(const QString &id) const;
|
||||
// This returns a list of versions that support the target with the given id.
|
||||
// @return A list of QtVersions that supports a target. This list may be empty!
|
||||
|
||||
QList<QtVersion *> versionsForTargetId(const QString &id, const QtVersionNumber &minimumQtVersion = QtVersionNumber()) const;
|
||||
QList<BaseQtVersion *> versionsForTargetId(const QString &id, const QtVersionNumber &minimumQtVersion = QtVersionNumber()) const;
|
||||
QSet<QString> supportedTargetIds() const;
|
||||
|
||||
// Static Methods
|
||||
|
||||
enum MakefileCompatible { CouldNotParse, DifferentProject, SameProject };
|
||||
static MakefileCompatible makefileIsFor(const QString &makefile, const QString &proFile);
|
||||
static QPair<QtVersion::QmakeBuildConfigs, QString> scanMakeFile(const QString &makefile,
|
||||
QtVersion::QmakeBuildConfigs defaultBuildConfig);
|
||||
static QPair<BaseQtVersion::QmakeBuildConfigs, QString> scanMakeFile(const QString &makefile,
|
||||
BaseQtVersion::QmakeBuildConfigs defaultBuildConfig);
|
||||
static QString findQMakeBinaryFromMakefile(const QString &directory);
|
||||
bool isValidId(int id) const;
|
||||
|
||||
// Compatibility with pre-2.2:
|
||||
QString popPendingMwcUpdate();
|
||||
QString popPendingGcceUpdate();
|
||||
|
||||
signals:
|
||||
void qtVersionsChanged(const QList<int> &uniqueIds);
|
||||
void updateExamples(QString, QString, QString);
|
||||
@@ -306,29 +125,31 @@ private slots:
|
||||
void updateSettings();
|
||||
private:
|
||||
// This function is really simplistic...
|
||||
static bool equals(QtVersion *a, QtVersion *b);
|
||||
static bool equals(BaseQtVersion *a, BaseQtVersion *b);
|
||||
static QString findQMakeLine(const QString &directory, const QString &key);
|
||||
static QString trimLine(const QString line);
|
||||
static void parseArgs(const QString &args,
|
||||
QList<QMakeAssignment> *assignments,
|
||||
QList<QMakeAssignment> *afterAssignments,
|
||||
QString *additionalArguments);
|
||||
static QtVersion::QmakeBuildConfigs qmakeBuildConfigFromCmdArgs(QList<QMakeAssignment> *assignments,
|
||||
QtVersion::QmakeBuildConfigs defaultBuildConfig);
|
||||
static BaseQtVersion::QmakeBuildConfigs qmakeBuildConfigFromCmdArgs(QList<QMakeAssignment> *assignments,
|
||||
BaseQtVersion::QmakeBuildConfigs defaultBuildConfig);
|
||||
bool restoreQtVersions();
|
||||
bool legacyRestore();
|
||||
void findSystemQt();
|
||||
void updateFromInstaller();
|
||||
void saveQtVersions();
|
||||
// Used by QtOptionsPage
|
||||
void setNewQtVersions(QList<QtVersion *> newVersions);
|
||||
void setNewQtVersions(QList<BaseQtVersion *> newVersions);
|
||||
// Used by QtVersion
|
||||
int getUniqueId();
|
||||
void writeVersionsIntoSettings();
|
||||
void addNewVersionsFromInstaller();
|
||||
void updateSystemVersion();
|
||||
void updateDocumentation();
|
||||
|
||||
static int indexOfVersionInList(const QtVersion * const version, const QList<QtVersion *> &list);
|
||||
static int indexOfVersionInList(const BaseQtVersion * const version, const QList<BaseQtVersion *> &list);
|
||||
void updateUniqueIdToIndexMap();
|
||||
|
||||
QtVersion *m_emptyVersion;
|
||||
QMap<int, QtVersion *> m_versions;
|
||||
QMap<int, BaseQtVersion *> m_versions;
|
||||
int m_idcount;
|
||||
// managed by QtProjectManagerPlugin
|
||||
static QtVersionManager *m_self;
|
||||
@@ -340,6 +161,6 @@ private:
|
||||
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt4ProjectManager::QtVersion::QmakeBuildConfigs)
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt4ProjectManager::BaseQtVersion::QmakeBuildConfigs)
|
||||
|
||||
#endif // QTVERSIONMANAGER_H
|
||||
|
90
src/plugins/qt4projectmanager/winceqtversion.cpp
Normal file
90
src/plugins/qt4projectmanager/winceqtversion.cpp
Normal file
@@ -0,0 +1,90 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "winceqtversion.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
WinCeQtVersion::WinCeQtVersion()
|
||||
: BaseQtVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
WinCeQtVersion::WinCeQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
|
||||
: BaseQtVersion(path, isAutodetected, autodetectionSource)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
WinCeQtVersion::~WinCeQtVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
WinCeQtVersion *WinCeQtVersion::clone() const
|
||||
{
|
||||
return new WinCeQtVersion(*this);
|
||||
}
|
||||
|
||||
QString WinCeQtVersion::type() const
|
||||
{
|
||||
return Constants::WINCEQT;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Abi> WinCeQtVersion::qtAbis() const
|
||||
{
|
||||
return QList<ProjectExplorer::Abi>()
|
||||
<< ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture,
|
||||
ProjectExplorer::Abi::WindowsOS,
|
||||
ProjectExplorer::Abi::WindowsCEFlavor,
|
||||
ProjectExplorer::Abi::PEFormat,
|
||||
false);
|
||||
}
|
||||
|
||||
bool WinCeQtVersion::supportsTargetId(const QString &id) const
|
||||
{
|
||||
return id == QLatin1String(Constants::DESKTOP_TARGET_ID);
|
||||
}
|
||||
|
||||
QSet<QString> WinCeQtVersion::supportedTargetIds() const
|
||||
{
|
||||
return QSet<QString>() << QLatin1String(Constants::DESKTOP_TARGET_ID);
|
||||
}
|
||||
|
||||
QString WinCeQtVersion::description() const
|
||||
{
|
||||
return QCoreApplication::translate("QtVersion", "Qt for WinCE", "Qt Version is meant for WinCE");
|
||||
}
|
61
src/plugins/qt4projectmanager/winceqtversion.h
Normal file
61
src/plugins/qt4projectmanager/winceqtversion.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef WINCEQTVERSION_H
|
||||
#define WINCEQTVERSION_H
|
||||
#include "baseqtversion.h"
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class WinCeQtVersion : public BaseQtVersion
|
||||
{
|
||||
public:
|
||||
WinCeQtVersion();
|
||||
WinCeQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
~WinCeQtVersion();
|
||||
WinCeQtVersion *clone() const;
|
||||
|
||||
QString type() const;
|
||||
|
||||
virtual QList<ProjectExplorer::Abi> qtAbis() const;
|
||||
|
||||
virtual bool supportsTargetId(const QString &id) const;
|
||||
virtual QSet<QString> supportedTargetIds() const;
|
||||
|
||||
QString description() const;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // WINCEQTVERSION_H
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user