diff --git a/src/plugins/madde/qt4maemotarget.cpp b/src/plugins/madde/qt4maemotarget.cpp index d1398e09294..e232db50e82 100644 --- a/src/plugins/madde/qt4maemotarget.cpp +++ b/src/plugins/madde/qt4maemotarget.cpp @@ -119,9 +119,8 @@ bool adaptTagValue(QByteArray &document, const QByteArray &fieldName, AbstractQt4MaemoTarget::AbstractQt4MaemoTarget(Qt4Project *parent, const QString &id) : - Qt4BaseTarget(parent, id), + AbstractEmbeddedLinuxTarget(parent, id), m_filesWatcher(new Utils::FileSystemWatcher(this)), - m_buildConfigurationFactory(new Qt4BuildConfigurationFactory(this)), m_isInitialized(false) { m_filesWatcher->setObjectName(QLatin1String("Qt4MaemoTarget")); @@ -155,11 +154,6 @@ QList AbstractQt4MaemoTarget::possibleToolChains(P return result; } -ProjectExplorer::IBuildConfigurationFactory *AbstractQt4MaemoTarget::buildConfigurationFactory() const -{ - return m_buildConfigurationFactory; -} - void AbstractQt4MaemoTarget::createApplicationProFiles(bool reparse) { if (!reparse) diff --git a/src/plugins/madde/qt4maemotarget.h b/src/plugins/madde/qt4maemotarget.h index 11f5e861998..b120f75c49c 100644 --- a/src/plugins/madde/qt4maemotarget.h +++ b/src/plugins/madde/qt4maemotarget.h @@ -33,7 +33,7 @@ #ifndef QT4MAEMOTARGET_H #define QT4MAEMOTARGET_H -#include +#include #include #include @@ -53,7 +53,7 @@ namespace Internal { class Qt4MaemoDeployConfigurationFactory; class WatchableFile; -class AbstractQt4MaemoTarget : public Qt4ProjectManager::Qt4BaseTarget +class AbstractQt4MaemoTarget : public RemoteLinux::AbstractEmbeddedLinuxTarget { friend class Qt4MaemoTargetFactory; Q_OBJECT @@ -62,7 +62,6 @@ public: const QString &id); virtual ~AbstractQt4MaemoTarget(); - ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const; void createApplicationProFiles(bool reparse); QList runConfigurationsForNode(ProjectExplorer::Node *n); QList possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const; @@ -109,7 +108,6 @@ private: bool initPackagingSettingsFromOtherTarget(); virtual bool initAdditionalPackagingSettingsFromOtherTarget() = 0; - Qt4ProjectManager::Qt4BuildConfigurationFactory *m_buildConfigurationFactory; bool m_isInitialized; }; diff --git a/src/plugins/remotelinux/abstractembeddedlinuxtarget.cpp b/src/plugins/remotelinux/abstractembeddedlinuxtarget.cpp new file mode 100644 index 00000000000..51baed86039 --- /dev/null +++ b/src/plugins/remotelinux/abstractembeddedlinuxtarget.cpp @@ -0,0 +1,51 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@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 qt-info@nokia.com. +** +**************************************************************************/ +#include "abstractembeddedlinuxtarget.h" + +#include + +using namespace ProjectExplorer; +using namespace Qt4ProjectManager; + +namespace RemoteLinux { + +AbstractEmbeddedLinuxTarget::AbstractEmbeddedLinuxTarget(Qt4Project *parent, const QString &id) : + Qt4BaseTarget(parent, id), m_buildConfigurationFactory(new Qt4BuildConfigurationFactory(this)) +{ +} + +IBuildConfigurationFactory *AbstractEmbeddedLinuxTarget::buildConfigurationFactory() const +{ + return m_buildConfigurationFactory; +} + +} // namespace RemoteLinux diff --git a/src/plugins/remotelinux/abstractembeddedlinuxtarget.h b/src/plugins/remotelinux/abstractembeddedlinuxtarget.h new file mode 100644 index 00000000000..03690901c69 --- /dev/null +++ b/src/plugins/remotelinux/abstractembeddedlinuxtarget.h @@ -0,0 +1,59 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@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 qt-info@nokia.com. +** +**************************************************************************/ +#ifndef ABSTRACTEMBEDDEDLINUXTARGET_H +#define ABSTRACTEMBEDDEDLINUXTARGET_H + +#include "remotelinux_export.h" + +#include + +namespace ProjectExplorer { class IBuildConfigurationFactory; } +namespace Qt4ProjectManager { class Qt4BuildConfigurationFactory; } + +namespace RemoteLinux { + +class REMOTELINUX_EXPORT AbstractEmbeddedLinuxTarget : public Qt4ProjectManager::Qt4BaseTarget +{ + Q_OBJECT + +public: + AbstractEmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id); + + ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const; + +private: + Qt4ProjectManager::Qt4BuildConfigurationFactory *m_buildConfigurationFactory; +}; + +} // namespace RemoteLinux + +#endif // ABSTRACTEMBEDDEDLINUXTARGET_H diff --git a/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp b/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp index 6970925bb44..b5a1b328b04 100644 --- a/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp +++ b/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp @@ -34,7 +34,7 @@ #include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeployconfigurationfactory.h" -#include "embeddedlinuxtarget.h" +#include "genericembeddedlinuxtarget.h" #include "remotelinux_constants.h" #include @@ -109,7 +109,7 @@ ProjectExplorer::Target *EmbeddedLinuxTargetFactory::restore(ProjectExplorer::Pr { Q_ASSERT(canRestore(parent, map)); - EmbeddedLinuxTarget *t = new EmbeddedLinuxTarget(static_cast(parent), + GenericEmbeddedLinuxTarget *t = new GenericEmbeddedLinuxTarget(static_cast(parent), Constants::EMBEDDED_LINUX_TARGET_ID); if (t->fromMap(map)) return t; @@ -154,7 +154,7 @@ ProjectExplorer::Target *EmbeddedLinuxTargetFactory::create(ProjectExplorer::Pro if (!canCreate(parent, id) || infos.isEmpty()) return 0; - EmbeddedLinuxTarget *t = new EmbeddedLinuxTarget(static_cast(parent), id); + GenericEmbeddedLinuxTarget *t = new GenericEmbeddedLinuxTarget(static_cast(parent), id); foreach (const Qt4ProjectManager::BuildConfigurationInfo &info, infos) t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(), diff --git a/src/plugins/remotelinux/embeddedlinuxtarget.cpp b/src/plugins/remotelinux/genericembeddedlinuxtarget.cpp similarity index 80% rename from src/plugins/remotelinux/embeddedlinuxtarget.cpp rename to src/plugins/remotelinux/genericembeddedlinuxtarget.cpp index d8773bea21b..e95a8b06a7c 100644 --- a/src/plugins/remotelinux/embeddedlinuxtarget.cpp +++ b/src/plugins/remotelinux/genericembeddedlinuxtarget.cpp @@ -30,7 +30,7 @@ ** **************************************************************************/ -#include "embeddedlinuxtarget.h" +#include "genericembeddedlinuxtarget.h" #include "remotelinux_constants.h" #include "remotelinuxrunconfiguration.h" @@ -46,24 +46,13 @@ namespace RemoteLinux { namespace Internal { -EmbeddedLinuxTarget::EmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id) : - Qt4ProjectManager::Qt4BaseTarget(parent, id), - m_buildConfigurationFactory(new Qt4ProjectManager::Qt4BuildConfigurationFactory) +GenericEmbeddedLinuxTarget::GenericEmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, + const QString &id) : AbstractEmbeddedLinuxTarget(parent, id) { setDisplayName(tr("Embedded Linux")); } -EmbeddedLinuxTarget::~EmbeddedLinuxTarget() -{ - delete m_buildConfigurationFactory; -} - -ProjectExplorer::IBuildConfigurationFactory *EmbeddedLinuxTarget::buildConfigurationFactory() const -{ - return m_buildConfigurationFactory; -} - -QList EmbeddedLinuxTarget::runConfigurationsForNode(ProjectExplorer::Node *n) +QList GenericEmbeddedLinuxTarget::runConfigurationsForNode(ProjectExplorer::Node *n) { QList result; foreach (ProjectExplorer::RunConfiguration *rc, runConfigurations()) @@ -73,7 +62,7 @@ QList EmbeddedLinuxTarget::runConfiguration return result; } -Utils::FileName EmbeddedLinuxTarget::mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const +Utils::FileName GenericEmbeddedLinuxTarget::mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const { QtSupport::BaseQtVersion *version = bc->qtVersion(); if (!version) @@ -81,7 +70,7 @@ Utils::FileName EmbeddedLinuxTarget::mkspec(const Qt4ProjectManager::Qt4BuildCon return version->mkspec(); } -void EmbeddedLinuxTarget::createApplicationProFiles(bool reparse) +void GenericEmbeddedLinuxTarget::createApplicationProFiles(bool reparse) { if (!reparse) removeUnconfiguredCustomExectutableRunConfigurations(); diff --git a/src/plugins/remotelinux/embeddedlinuxtarget.h b/src/plugins/remotelinux/genericembeddedlinuxtarget.h similarity index 80% rename from src/plugins/remotelinux/embeddedlinuxtarget.h rename to src/plugins/remotelinux/genericembeddedlinuxtarget.h index eacef5cbfd4..5850f4d142f 100644 --- a/src/plugins/remotelinux/embeddedlinuxtarget.h +++ b/src/plugins/remotelinux/genericembeddedlinuxtarget.h @@ -33,33 +33,25 @@ #ifndef EMBEDDEDLINUXTARGET_H #define EMBEDDEDLINUXTARGET_H -#include -#include +#include "abstractembeddedlinuxtarget.h" namespace RemoteLinux { namespace Internal { class EmbeddedLinuxTargetFactory; -class EmbeddedLinuxTarget : public Qt4ProjectManager::Qt4BaseTarget +class GenericEmbeddedLinuxTarget : public AbstractEmbeddedLinuxTarget { Q_OBJECT public: - EmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id); - ~EmbeddedLinuxTarget(); - - ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const; + GenericEmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id); void createApplicationProFiles(bool reparse); - QList runConfigurationsForNode(ProjectExplorer::Node *n); - Utils::FileName mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const; private: - Qt4ProjectManager::Qt4BuildConfigurationFactory *m_buildConfigurationFactory; - friend class EmbeddedLinuxTargetFactory; }; diff --git a/src/plugins/remotelinux/remotelinux.pro b/src/plugins/remotelinux/remotelinux.pro index 184f91c21ac..6d2349ea4db 100644 --- a/src/plugins/remotelinux/remotelinux.pro +++ b/src/plugins/remotelinux/remotelinux.pro @@ -5,7 +5,7 @@ include(../../qtcreatorplugin.pri) include(remotelinux_dependencies.pri) HEADERS += \ - embeddedlinuxtarget.h \ + genericembeddedlinuxtarget.h \ embeddedlinuxtargetfactory.h \ embeddedlinuxqtversion.h \ embeddedlinuxqtversionfactory.h \ @@ -60,10 +60,11 @@ HEADERS += \ profilesupdatedialog.h \ startgdbserverdialog.h \ remotelinuxcustomcommanddeployservice.h \ - remotelinuxcustomcommanddeploymentstep.h + remotelinuxcustomcommanddeploymentstep.h \ + abstractembeddedlinuxtarget.h SOURCES += \ - embeddedlinuxtarget.cpp \ + genericembeddedlinuxtarget.cpp \ embeddedlinuxtargetfactory.cpp \ embeddedlinuxqtversion.cpp \ embeddedlinuxqtversionfactory.cpp \ @@ -115,7 +116,8 @@ SOURCES += \ profilesupdatedialog.cpp \ startgdbserverdialog.cpp \ remotelinuxcustomcommanddeployservice.cpp \ - remotelinuxcustomcommanddeploymentstep.cpp + remotelinuxcustomcommanddeploymentstep.cpp \ + abstractembeddedlinuxtarget.cpp FORMS += \ linuxdevicefactoryselectiondialog.ui \