diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h | 2 | ||||
-rw-r--r-- | src/plugins/qtsupport/baseqtversion.cpp | 1 | ||||
-rw-r--r-- | src/plugins/remotelinux/embeddedlinuxtarget.cpp | 103 | ||||
-rw-r--r-- | src/plugins/remotelinux/embeddedlinuxtarget.h | 67 | ||||
-rw-r--r-- | src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp | 178 | ||||
-rw-r--r-- | src/plugins/remotelinux/embeddedlinuxtargetfactory.h | 71 | ||||
-rw-r--r-- | src/plugins/remotelinux/images/embeddedtarget.png | bin | 0 -> 1050 bytes | |||
-rw-r--r-- | src/plugins/remotelinux/remotelinux.pro | 6 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinux.qrc | 5 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxdeployconfigurationfactory.h | 18 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxplugin.cpp | 2 |
11 files changed, 441 insertions, 12 deletions
diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h index 42d5d88c95..7eb4fb4521 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h @@ -60,9 +60,9 @@ public: bool importEnabled, QList<BuildConfigurationInfo> importInfos); QString buildNameForId(const QString &id) const; QSet<QString> targetFeatures(const QString &id) const; + ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id); ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos); - }; } } diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 9e1a1bb4cd..8e33dbd564 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -1199,7 +1199,6 @@ QString BaseQtVersion::qtCorePath(const QHash<QString,QString> &versionInfo, con else if (file.endsWith(QLatin1String(".dll")) || file.endsWith(QString::fromLatin1(".so.") + versionString) || file.endsWith(QLatin1Char('.') + versionString + QLatin1String(".dylib"))) - return info.absoluteFilePath(); } } diff --git a/src/plugins/remotelinux/embeddedlinuxtarget.cpp b/src/plugins/remotelinux/embeddedlinuxtarget.cpp new file mode 100644 index 0000000000..22f3782a64 --- /dev/null +++ b/src/plugins/remotelinux/embeddedlinuxtarget.cpp @@ -0,0 +1,103 @@ +/************************************************************************** +** +** 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 "embeddedlinuxtarget.h" + +#include "remotelinux_constants.h" +#include "remotelinuxrunconfiguration.h" + +#include <projectexplorer/customexecutablerunconfiguration.h> +#include <qt4projectmanager/qt4buildconfiguration.h> +#include <qt4projectmanager/qt4nodes.h> +#include <qt4projectmanager/qt4project.h> + +#include <QtCore/QCoreApplication> + +namespace RemoteLinux { +namespace Internal { + +EmbeddedLinuxTarget::EmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id) : + Qt4ProjectManager::Qt4BaseTarget(parent, id), + m_buildConfigurationFactory(new Qt4ProjectManager::Qt4BuildConfigurationFactory) +{ + setDisplayName(tr("Embedded Linux")); +} + +EmbeddedLinuxTarget::~EmbeddedLinuxTarget() +{ + delete m_buildConfigurationFactory; +} + +ProjectExplorer::IBuildConfigurationFactory *EmbeddedLinuxTarget::buildConfigurationFactory() const +{ + return m_buildConfigurationFactory; +} + +QList<ProjectExplorer::RunConfiguration *> EmbeddedLinuxTarget::runConfigurationsForNode(ProjectExplorer::Node *n) +{ + QList<ProjectExplorer::RunConfiguration *> result; + foreach (ProjectExplorer::RunConfiguration *rc, runConfigurations()) + if (RemoteLinuxRunConfiguration *qt4c = qobject_cast<RemoteLinuxRunConfiguration *>(rc)) + if (qt4c->proFilePath() == n->path()) + result << rc; + return result; +} + +void EmbeddedLinuxTarget::createApplicationProFiles() +{ + removeUnconfiguredCustomExectutableRunConfigurations(); + + // We use the list twice + QList<Qt4ProjectManager::Qt4ProFileNode *> profiles = qt4Project()->applicationProFiles(); + QStringList pathes; + foreach (Qt4ProjectManager::Qt4ProFileNode *pro, profiles) + pathes.append(pro->path()); + + foreach (ProjectExplorer::RunConfiguration *rc, runConfigurations()) { + if (RemoteLinuxRunConfiguration *qt4rc = qobject_cast<RemoteLinuxRunConfiguration *>(rc)) + pathes.removeAll(qt4rc->proFilePath()); + } + + // Only add new runconfigurations if there are none. + foreach (const QString &path, pathes) { + RemoteLinuxRunConfiguration *qt4rc = + new RemoteLinuxRunConfiguration(this,RemoteLinuxRunConfiguration::Id, path); + addRunConfiguration(qt4rc); + } + + // Oh still none? Add a custom executable runconfiguration + if (runConfigurations().isEmpty()) + addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(this)); +} + +} // namespace Internal +} // namespace RemoteLinux diff --git a/src/plugins/remotelinux/embeddedlinuxtarget.h b/src/plugins/remotelinux/embeddedlinuxtarget.h new file mode 100644 index 0000000000..181a9b5b07 --- /dev/null +++ b/src/plugins/remotelinux/embeddedlinuxtarget.h @@ -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 EMBEDDEDLINUXTARGET_H +#define EMBEDDEDLINUXTARGET_H + +#include <qt4projectmanager/qt4target.h> +#include <qt4projectmanager/qt4buildconfiguration.h> + +namespace RemoteLinux { +namespace Internal { + +class EmbeddedLinuxTargetFactory; + +class EmbeddedLinuxTarget : public Qt4ProjectManager::Qt4BaseTarget +{ + Q_OBJECT + +public: + EmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id); + ~EmbeddedLinuxTarget(); + + ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const; + + void createApplicationProFiles(); + + QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n); + +private: + Qt4ProjectManager::Qt4BuildConfigurationFactory *m_buildConfigurationFactory; + + friend class EmbeddedLinuxTargetFactory; +}; + +} // namespace Internal +} // namespace RemoteLinux + +#endif // EMBEDDEDLINUXTARGET_H diff --git a/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp b/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp new file mode 100644 index 0000000000..0304b4a3ad --- /dev/null +++ b/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp @@ -0,0 +1,178 @@ +/************************************************************************** +** +** 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 "embeddedlinuxtargetfactory.h" + +#include "remotelinuxdeployconfiguration.h" +#include "remotelinuxdeployconfigurationfactory.h" +#include "embeddedlinuxtarget.h" +#include "remotelinux_constants.h" + +#include <projectexplorer/customexecutablerunconfiguration.h> + +#include <qt4projectmanager/buildconfigurationinfo.h> +#include <qt4projectmanager/qt4project.h> +#include <qt4projectmanager/qt4projectmanagerconstants.h> + +#include <qtsupport/qtversionmanager.h> + +#include <QtGui/QIcon> + +namespace RemoteLinux { +namespace Internal { + +EmbeddedLinuxTargetFactory::EmbeddedLinuxTargetFactory(QObject *parent) : + Qt4ProjectManager::Qt4BaseTargetFactory(parent) +{ } + +EmbeddedLinuxTargetFactory::~EmbeddedLinuxTargetFactory() +{ } + +QIcon EmbeddedLinuxTargetFactory::iconForId(const QString &id) const +{ + if (id == QLatin1String(Constants::EMBEDDED_LINUX_TARGET_ID)) + return QIcon(":/remotelinux/images/embeddedtarget.png"); + return QIcon(); +} + +QString EmbeddedLinuxTargetFactory::buildNameForId(const QString &id) const +{ + if (supportsTargetId(id)) + return tr("embedded"); + return QString(); +} + +QSet<QString> EmbeddedLinuxTargetFactory::targetFeatures(const QString & /*id*/) const +{ + QSet<QString> features; + features << Qt4ProjectManager::Constants::MOBILE_TARGETFEATURE_ID; + features << Qt4ProjectManager::Constants::SHADOWBUILD_TARGETFEATURE_ID; + + return features; +} + +QStringList EmbeddedLinuxTargetFactory::supportedTargetIds(ProjectExplorer::Project *project) const +{ + Q_UNUSED(project); + return QStringList() << RemoteLinux::Constants::EMBEDDED_LINUX_TARGET_ID; +} + +bool EmbeddedLinuxTargetFactory::supportsTargetId(const QString &id) const +{ + return id == RemoteLinux::Constants::EMBEDDED_LINUX_TARGET_ID; +} + +QString EmbeddedLinuxTargetFactory::displayNameForId(const QString &id) const +{ + if (id == RemoteLinux::Constants::EMBEDDED_LINUX_TARGET_ID) + return tr("Embedded Linux"); + return QString(); +} + +bool EmbeddedLinuxTargetFactory::canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const +{ + return canCreate(parent, ProjectExplorer::idFromMap(map)); +} + +ProjectExplorer::Target *EmbeddedLinuxTargetFactory::restore(ProjectExplorer::Project *parent, const QVariantMap &map) +{ + Q_ASSERT(canRestore(parent, map)); + + EmbeddedLinuxTarget *t = new EmbeddedLinuxTarget(static_cast<Qt4ProjectManager::Qt4Project *>(parent), + Constants::EMBEDDED_LINUX_TARGET_ID); + if (t->fromMap(map)) + return t; + + delete t; + return 0; +} + +bool EmbeddedLinuxTargetFactory::canCreate(ProjectExplorer::Project *parent, const QString &id) const +{ + Qt4ProjectManager::Qt4Project *project = qobject_cast<Qt4ProjectManager::Qt4Project *>(parent); + if (!project) + return false; + + return supportsTargetId(id); +} + + +ProjectExplorer::Target *EmbeddedLinuxTargetFactory::create(ProjectExplorer::Project *parent, + const QString &id) +{ + if (!canCreate(parent, id)) + return 0; + + QList<QtSupport::BaseQtVersion *> knownVersions = + QtSupport::QtVersionManager::instance()->versionsForTargetId(id); + if (knownVersions.isEmpty()) + return 0; + + QtSupport::BaseQtVersion *qtVersion = knownVersions.first(); + QtSupport::BaseQtVersion::QmakeBuildConfigs config = qtVersion->defaultBuildConfig(); + + QList<Qt4ProjectManager::BuildConfigurationInfo> infos; + infos.append(Qt4ProjectManager::BuildConfigurationInfo(qtVersion, config, QString(), QString())); + infos.append(Qt4ProjectManager::BuildConfigurationInfo(qtVersion, + config ^ QtSupport::BaseQtVersion::DebugBuild, + QString(), QString())); + + return create(parent, id, infos); +} + +ProjectExplorer::Target *EmbeddedLinuxTargetFactory::create(ProjectExplorer::Project *parent, + const QString &id, + const QList<Qt4ProjectManager::BuildConfigurationInfo> &infos) +{ + if (!canCreate(parent, id) || infos.isEmpty()) + return 0; + + EmbeddedLinuxTarget *t = new EmbeddedLinuxTarget(static_cast<Qt4ProjectManager::Qt4Project *>(parent), id); + + foreach (const Qt4ProjectManager::BuildConfigurationInfo &info, infos) + t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(), + info.version, info.buildConfig, + info.additionalArguments, info.directory, info.importing); + + t->addDeployConfiguration( + t->createDeployConfiguration( + RemoteLinuxDeployConfigurationFactory::genericDeployConfigurationId())); + + t->createApplicationProFiles(); + + if (t->runConfigurations().isEmpty()) + t->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(t)); + return t; +} + +} // namespace Internal +} // namespace RemoteLinux diff --git a/src/plugins/remotelinux/embeddedlinuxtargetfactory.h b/src/plugins/remotelinux/embeddedlinuxtargetfactory.h new file mode 100644 index 0000000000..74a74ef7d5 --- /dev/null +++ b/src/plugins/remotelinux/embeddedlinuxtargetfactory.h @@ -0,0 +1,71 @@ +/************************************************************************** +** +** 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 EMBEDDEDLINUXTARGETFACTORY_H +#define EMBEDDEDLINUXTARGETFACTORY_H + +#include <qt4projectmanager/qt4basetargetfactory.h> + +namespace RemoteLinux { +namespace Internal { + +class EmbeddedLinuxTargetFactory : public Qt4ProjectManager::Qt4BaseTargetFactory +{ + Q_OBJECT + +public: + explicit EmbeddedLinuxTargetFactory(QObject *parent = 0); + ~EmbeddedLinuxTargetFactory(); + + QIcon iconForId(const QString &id) const; + QString buildNameForId(const QString &id) const; + + QSet<QString> targetFeatures(const QString &id) const; + + QStringList supportedTargetIds(ProjectExplorer::Project *project) const; + bool supportsTargetId(const QString &id) const; + + QString displayNameForId(const QString &id) const; + + bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const; + ProjectExplorer::Target *restore(ProjectExplorer::Project *parent, const QVariantMap &map); + + bool canCreate(ProjectExplorer::Project *parent, const QString &id) const; + ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id); + ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id, + const QList<Qt4ProjectManager::BuildConfigurationInfo> &infos); +}; + +} // namespace Internal +} // namespace RemoteLinux + +#endif // EMBEDDEDLINUXTARGETFACTORY_H diff --git a/src/plugins/remotelinux/images/embeddedtarget.png b/src/plugins/remotelinux/images/embeddedtarget.png Binary files differnew file mode 100644 index 0000000000..93a092ab13 --- /dev/null +++ b/src/plugins/remotelinux/images/embeddedtarget.png diff --git a/src/plugins/remotelinux/remotelinux.pro b/src/plugins/remotelinux/remotelinux.pro index 7614cfc6c7..b219077217 100644 --- a/src/plugins/remotelinux/remotelinux.pro +++ b/src/plugins/remotelinux/remotelinux.pro @@ -5,6 +5,8 @@ include(../../qtcreatorplugin.pri) include(remotelinux_dependencies.pri) HEADERS += \ + embeddedlinuxtarget.h \ + embeddedlinuxtargetfactory.h \ embeddedlinuxqtversion.h \ embeddedlinuxqtversionfactory.h \ remotelinuxplugin.h \ @@ -62,6 +64,8 @@ HEADERS += \ remotelinuxcustomcommanddeploymentstep.h SOURCES += \ + embeddedlinuxtarget.cpp \ + embeddedlinuxtargetfactory.cpp \ embeddedlinuxqtversion.cpp \ embeddedlinuxqtversionfactory.cpp \ remotelinuxplugin.cpp \ @@ -126,5 +130,7 @@ FORMS += \ profilesupdatedialog.ui \ startgdbserverdialog.ui +RESOURCES += remotelinux.qrc + DEFINES += QT_NO_CAST_TO_ASCII DEFINES += REMOTELINUX_LIBRARY diff --git a/src/plugins/remotelinux/remotelinux.qrc b/src/plugins/remotelinux/remotelinux.qrc new file mode 100644 index 0000000000..e461e2e8e6 --- /dev/null +++ b/src/plugins/remotelinux/remotelinux.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/remotelinux"> + <file>images/embeddedtarget.png</file> + </qresource> +</RCC> diff --git a/src/plugins/remotelinux/remotelinuxdeployconfigurationfactory.h b/src/plugins/remotelinux/remotelinuxdeployconfigurationfactory.h index c06f97148a..115ba13c71 100644 --- a/src/plugins/remotelinux/remotelinuxdeployconfigurationfactory.h +++ b/src/plugins/remotelinux/remotelinuxdeployconfigurationfactory.h @@ -44,16 +44,14 @@ class RemoteLinuxDeployConfigurationFactory : public ProjectExplorer::DeployConf public: explicit RemoteLinuxDeployConfigurationFactory(QObject *parent = 0); - virtual QStringList availableCreationIds(ProjectExplorer::Target *parent) const; - virtual QString displayNameForId(const QString &id) const; - virtual bool canCreate(ProjectExplorer::Target *parent, const QString &id) const; - virtual ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const QString &id); - virtual bool canRestore(ProjectExplorer::Target *parent, - const QVariantMap &map) const; - virtual ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, - const QVariantMap &map); - virtual ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent, - ProjectExplorer::DeployConfiguration *product); + QStringList availableCreationIds(ProjectExplorer::Target *parent) const; + QString displayNameForId(const QString &id) const; + bool canCreate(ProjectExplorer::Target *parent, const QString &id) const; + ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const QString &id); + bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; + ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); + ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent, + ProjectExplorer::DeployConfiguration *product); static QString genericDeployConfigurationId(); }; diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index 1fe931afe3..75d4762f60 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -33,6 +33,7 @@ #include "remotelinuxplugin.h" #include "embeddedlinuxqtversionfactory.h" +#include "embeddedlinuxtargetfactory.h" #include "deployablefile.h" #include "genericlinuxdeviceconfigurationfactory.h" #include "genericremotelinuxdeploystepfactory.h" @@ -78,6 +79,7 @@ bool RemoteLinuxPlugin::initialize(const QStringList &arguments, addAutoReleasedObject(new RemoteLinuxDeployConfigurationFactory); addAutoReleasedObject(new GenericRemoteLinuxDeployStepFactory); + addAutoReleasedObject(new EmbeddedLinuxTargetFactory); addAutoReleasedObject(new EmbeddedLinuxQtVersionFactory); qRegisterMetaType<RemoteLinux::DeployableFile>("RemoteLinux::DeployableFile"); |