forked from qt-creator/qt-creator
RemoteLinux: Introduce abstract base class for remote Linux targets.
More stuff (e.g. deployment information) will move into that class shortly. Change-Id: I9ad785533d54859e72079b54796710707f716469 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -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<ProjectExplorer::ToolChain *> AbstractQt4MaemoTarget::possibleToolChains(P
|
||||
return result;
|
||||
}
|
||||
|
||||
ProjectExplorer::IBuildConfigurationFactory *AbstractQt4MaemoTarget::buildConfigurationFactory() const
|
||||
{
|
||||
return m_buildConfigurationFactory;
|
||||
}
|
||||
|
||||
void AbstractQt4MaemoTarget::createApplicationProFiles(bool reparse)
|
||||
{
|
||||
if (!reparse)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#ifndef QT4MAEMOTARGET_H
|
||||
#define QT4MAEMOTARGET_H
|
||||
|
||||
#include <qt4projectmanager/qt4target.h>
|
||||
#include <remotelinux/abstractembeddedlinuxtarget.h>
|
||||
|
||||
#include <QtCore/QIODevice>
|
||||
#include <QtCore/QSharedPointer>
|
||||
@@ -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<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
|
||||
QList<ProjectExplorer::ToolChain *> possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const;
|
||||
@@ -109,7 +108,6 @@ private:
|
||||
bool initPackagingSettingsFromOtherTarget();
|
||||
virtual bool initAdditionalPackagingSettingsFromOtherTarget() = 0;
|
||||
|
||||
Qt4ProjectManager::Qt4BuildConfigurationFactory *m_buildConfigurationFactory;
|
||||
bool m_isInitialized;
|
||||
};
|
||||
|
||||
|
||||
51
src/plugins/remotelinux/abstractembeddedlinuxtarget.cpp
Normal file
51
src/plugins/remotelinux/abstractembeddedlinuxtarget.cpp
Normal file
@@ -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 <qt4projectmanager/qt4buildconfiguration.h>
|
||||
|
||||
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
|
||||
59
src/plugins/remotelinux/abstractembeddedlinuxtarget.h
Normal file
59
src/plugins/remotelinux/abstractembeddedlinuxtarget.h
Normal file
@@ -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 <qt4projectmanager/qt4target.h>
|
||||
|
||||
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
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
#include "remotelinuxdeployconfiguration.h"
|
||||
#include "remotelinuxdeployconfigurationfactory.h"
|
||||
#include "embeddedlinuxtarget.h"
|
||||
#include "genericembeddedlinuxtarget.h"
|
||||
#include "remotelinux_constants.h"
|
||||
|
||||
#include <projectexplorer/customexecutablerunconfiguration.h>
|
||||
@@ -109,7 +109,7 @@ ProjectExplorer::Target *EmbeddedLinuxTargetFactory::restore(ProjectExplorer::Pr
|
||||
{
|
||||
Q_ASSERT(canRestore(parent, map));
|
||||
|
||||
EmbeddedLinuxTarget *t = new EmbeddedLinuxTarget(static_cast<Qt4ProjectManager::Qt4Project *>(parent),
|
||||
GenericEmbeddedLinuxTarget *t = new GenericEmbeddedLinuxTarget(static_cast<Qt4ProjectManager::Qt4Project *>(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<Qt4ProjectManager::Qt4Project *>(parent), id);
|
||||
GenericEmbeddedLinuxTarget *t = new GenericEmbeddedLinuxTarget(static_cast<Qt4ProjectManager::Qt4Project *>(parent), id);
|
||||
|
||||
foreach (const Qt4ProjectManager::BuildConfigurationInfo &info, infos)
|
||||
t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(),
|
||||
|
||||
@@ -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<ProjectExplorer::RunConfiguration *> EmbeddedLinuxTarget::runConfigurationsForNode(ProjectExplorer::Node *n)
|
||||
QList<ProjectExplorer::RunConfiguration *> GenericEmbeddedLinuxTarget::runConfigurationsForNode(ProjectExplorer::Node *n)
|
||||
{
|
||||
QList<ProjectExplorer::RunConfiguration *> result;
|
||||
foreach (ProjectExplorer::RunConfiguration *rc, runConfigurations())
|
||||
@@ -73,7 +62,7 @@ QList<ProjectExplorer::RunConfiguration *> 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();
|
||||
@@ -33,33 +33,25 @@
|
||||
#ifndef EMBEDDEDLINUXTARGET_H
|
||||
#define EMBEDDEDLINUXTARGET_H
|
||||
|
||||
#include <qt4projectmanager/qt4target.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#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<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
|
||||
|
||||
Utils::FileName mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const;
|
||||
|
||||
private:
|
||||
Qt4ProjectManager::Qt4BuildConfigurationFactory *m_buildConfigurationFactory;
|
||||
|
||||
friend class EmbeddedLinuxTargetFactory;
|
||||
};
|
||||
|
||||
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user