RemoteLinux: Private implementation for all exported classes.

Change-Id: Id92eb156b027a4986788141845170105b3b1d9e5
Reviewed-on: http://codereview.qt.nokia.com/2507
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
Christian Kandeler
2011-08-02 12:20:16 +02:00
parent 7efb3c35a5
commit edc776c26c
54 changed files with 741 additions and 514 deletions

View File

@@ -33,6 +33,7 @@
#include "remotelinuxqmlprofilerrunner.h" #include "remotelinuxqmlprofilerrunner.h"
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <remotelinux/portlist.h>
#include <remotelinux/remotelinuxapplicationrunner.h> #include <remotelinux/remotelinuxapplicationrunner.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>

View File

@@ -45,6 +45,7 @@ class AbstractPackagingStepPrivate;
class REMOTELINUX_EXPORT AbstractPackagingStep : public ProjectExplorer::BuildStep class REMOTELINUX_EXPORT AbstractPackagingStep : public ProjectExplorer::BuildStep
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(AbstractPackagingStep)
public: public:
AbstractPackagingStep(ProjectExplorer::BuildStepList *bsl, const QString &id); AbstractPackagingStep(ProjectExplorer::BuildStepList *bsl, const QString &id);
AbstractPackagingStep(ProjectExplorer::BuildStepList *bsl, AbstractPackagingStep *other); AbstractPackagingStep(ProjectExplorer::BuildStepList *bsl, AbstractPackagingStep *other);

View File

@@ -272,7 +272,7 @@ void AbstractRemoteLinuxDeployService::handleConnectionFailure()
break; break;
case Connecting: { case Connecting: {
QString errorMsg = tr("Could not connect to host: %1").arg(m_d->connection->errorString()); QString errorMsg = tr("Could not connect to host: %1").arg(m_d->connection->errorString());
if (deviceConfiguration()->type() == LinuxDeviceConfiguration::Emulator) if (deviceConfiguration()->deviceType() == LinuxDeviceConfiguration::Emulator)
errorMsg += tr("\nDid the emulator fail to start?"); errorMsg += tr("\nDid the emulator fail to start?");
else else
errorMsg += tr("\nIs the device connected and set up for network access?"); errorMsg += tr("\nIs the device connected and set up for network access?");

View File

@@ -57,6 +57,7 @@ class AbstractRemoteLinuxDeployServicePrivate;
class REMOTELINUX_EXPORT AbstractRemoteLinuxDeployService : public QObject class REMOTELINUX_EXPORT AbstractRemoteLinuxDeployService : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(AbstractRemoteLinuxDeployService)
public: public:
explicit AbstractRemoteLinuxDeployService(QObject *parent); explicit AbstractRemoteLinuxDeployService(QObject *parent);
~AbstractRemoteLinuxDeployService(); ~AbstractRemoteLinuxDeployService();

View File

@@ -49,6 +49,7 @@ class AbstractRemoteLinuxDeployStepPrivate;
class REMOTELINUX_EXPORT AbstractRemoteLinuxDeployStep : public ProjectExplorer::BuildStep class REMOTELINUX_EXPORT AbstractRemoteLinuxDeployStep : public ProjectExplorer::BuildStep
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(AbstractRemoteLinuxDeployStep)
public: public:
bool fromMap(const QVariantMap &map); bool fromMap(const QVariantMap &map);

View File

@@ -31,6 +31,8 @@
**************************************************************************/ **************************************************************************/
#include "deployablefilesperprofile.h" #include "deployablefilesperprofile.h"
#include "deployablefile.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
@@ -39,46 +41,70 @@
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
class DeployableFilesPerProFilePrivate
{
public:
DeployableFilesPerProFilePrivate(const Qt4ProFileNode *proFileNode)
: projectType(proFileNode->projectType()),
proFilePath(proFileNode->path()),
projectName(proFileNode->displayName()),
targetInfo(proFileNode->targetInformation()),
installsList(proFileNode->installsList()),
projectVersion(proFileNode->projectVersion()),
config(proFileNode->variableValue(ConfigVar)),
modified(true)
{
}
const Qt4ProjectType projectType;
const QString proFilePath;
const QString projectName;
const Qt4ProjectManager::TargetInformation targetInfo;
const Qt4ProjectManager::InstallsList installsList;
const Qt4ProjectManager::ProjectVersion projectVersion;
const QStringList config;
QList<DeployableFile> deployables;
bool modified;
};
} // namespace Internal
using namespace Internal; using namespace Internal;
DeployableFilesPerProFile::DeployableFilesPerProFile(const Qt4ProFileNode *proFileNode, DeployableFilesPerProFile::DeployableFilesPerProFile(const Qt4ProFileNode *proFileNode,
QObject *parent) QObject *parent)
: QAbstractTableModel(parent), : QAbstractTableModel(parent), m_d(new DeployableFilesPerProFilePrivate(proFileNode))
m_projectType(proFileNode->projectType()),
m_proFilePath(proFileNode->path()),
m_projectName(proFileNode->displayName()),
m_targetInfo(proFileNode->targetInformation()),
m_installsList(proFileNode->installsList()),
m_projectVersion(proFileNode->projectVersion()),
m_config(proFileNode->variableValue(ConfigVar)),
m_modified(true)
{ {
if (m_projectType == ApplicationTemplate) { if (m_d->projectType == ApplicationTemplate) {
m_deployables.prepend(DeployableFile(localExecutableFilePath(), m_d->deployables.prepend(DeployableFile(localExecutableFilePath(),
m_installsList.targetPath)); m_d->installsList.targetPath));
} else if (m_projectType == LibraryTemplate) { } else if (m_d->projectType == LibraryTemplate) {
foreach (const QString &filePath, localLibraryFilePaths()) { foreach (const QString &filePath, localLibraryFilePaths()) {
m_deployables.prepend(DeployableFile(filePath, m_d->deployables.prepend(DeployableFile(filePath,
m_installsList.targetPath)); m_d->installsList.targetPath));
} }
} }
foreach (const InstallsItem &elem, m_installsList.items) { foreach (const InstallsItem &elem, m_d->installsList.items) {
foreach (const QString &file, elem.files) foreach (const QString &file, elem.files)
m_deployables << DeployableFile(file, elem.path); m_d->deployables << DeployableFile(file, elem.path);
} }
} }
DeployableFilesPerProFile::~DeployableFilesPerProFile() {} DeployableFilesPerProFile::~DeployableFilesPerProFile()
{
delete m_d;
}
DeployableFile DeployableFilesPerProFile::deployableAt(int row) const DeployableFile DeployableFilesPerProFile::deployableAt(int row) const
{ {
Q_ASSERT(row >= 0 && row < rowCount()); Q_ASSERT(row >= 0 && row < rowCount());
return m_deployables.at(row); return m_d->deployables.at(row);
} }
int DeployableFilesPerProFile::rowCount(const QModelIndex &parent) const int DeployableFilesPerProFile::rowCount(const QModelIndex &parent) const
{ {
return parent.isValid() ? 0 : m_deployables.count(); return parent.isValid() ? 0 : m_d->deployables.count();
} }
int DeployableFilesPerProFile::columnCount(const QModelIndex &parent) const int DeployableFilesPerProFile::columnCount(const QModelIndex &parent) const
@@ -91,7 +117,7 @@ QVariant DeployableFilesPerProFile::data(const QModelIndex &index, int role) con
if (!index.isValid() || index.row() >= rowCount()) if (!index.isValid() || index.row() >= rowCount())
return QVariant(); return QVariant();
if (m_projectType != AuxTemplate && !hasTargetPath() && index.row() == 0 if (m_d->projectType != AuxTemplate && !hasTargetPath() && index.row() == 0
&& index.column() == 1) { && index.column() == 1) {
if (role == Qt::DisplayRole) if (role == Qt::DisplayRole)
return tr("<no target path set>"); return tr("<no target path set>");
@@ -120,34 +146,34 @@ QVariant DeployableFilesPerProFile::headerData(int section,
QString DeployableFilesPerProFile::localExecutableFilePath() const QString DeployableFilesPerProFile::localExecutableFilePath() const
{ {
if (!m_targetInfo.valid || m_projectType != ApplicationTemplate) if (!m_d->targetInfo.valid || m_d->projectType != ApplicationTemplate)
return QString(); return QString();
return QDir::cleanPath(m_targetInfo.workingDir + '/' + m_targetInfo.target); return QDir::cleanPath(m_d->targetInfo.workingDir + '/' + m_d->targetInfo.target);
} }
QStringList DeployableFilesPerProFile::localLibraryFilePaths() const QStringList DeployableFilesPerProFile::localLibraryFilePaths() const
{ {
if (!m_targetInfo.valid || m_projectType != LibraryTemplate) if (!m_d->targetInfo.valid || m_d->projectType != LibraryTemplate)
return QStringList(); return QStringList();
QString basePath = m_targetInfo.workingDir + QLatin1String("/lib"); QString basePath = m_d->targetInfo.workingDir + QLatin1String("/lib");
const bool isStatic = m_config.contains(QLatin1String("static")) const bool isStatic = m_d->config.contains(QLatin1String("static"))
|| m_config.contains(QLatin1String("staticlib")); || m_d->config.contains(QLatin1String("staticlib"));
basePath += m_targetInfo.target + QLatin1String(isStatic ? ".a" : ".so"); basePath += m_d->targetInfo.target + QLatin1String(isStatic ? ".a" : ".so");
basePath = QDir::cleanPath(basePath); basePath = QDir::cleanPath(basePath);
const QChar dot(QLatin1Char('.')); const QChar dot(QLatin1Char('.'));
const QString filePathMajor = basePath + dot const QString filePathMajor = basePath + dot
+ QString::number(m_projectVersion.major); + QString::number(m_d->projectVersion.major);
const QString filePathMinor = filePathMajor + dot const QString filePathMinor = filePathMajor + dot
+ QString::number(m_projectVersion.minor); + QString::number(m_d->projectVersion.minor);
const QString filePathPatch = filePathMinor + dot const QString filePathPatch = filePathMinor + dot
+ QString::number(m_projectVersion.patch); + QString::number(m_d->projectVersion.patch);
return QStringList() << filePathPatch << filePathMinor << filePathMajor return QStringList() << filePathPatch << filePathMinor << filePathMajor
<< basePath; << basePath;
} }
QString DeployableFilesPerProFile::remoteExecutableFilePath() const QString DeployableFilesPerProFile::remoteExecutableFilePath() const
{ {
return hasTargetPath() && m_projectType == ApplicationTemplate return hasTargetPath() && m_d->projectType == ApplicationTemplate
? deployableAt(0).remoteDir + QLatin1Char('/') ? deployableAt(0).remoteDir + QLatin1Char('/')
+ QFileInfo(localExecutableFilePath()).fileName() + QFileInfo(localExecutableFilePath()).fileName()
: QString(); : QString();
@@ -155,7 +181,18 @@ QString DeployableFilesPerProFile::remoteExecutableFilePath() const
QString DeployableFilesPerProFile::projectDir() const QString DeployableFilesPerProFile::projectDir() const
{ {
return QFileInfo(m_proFilePath).dir().path(); return QFileInfo(m_d->proFilePath).dir().path();
} }
bool DeployableFilesPerProFile::hasTargetPath() const
{
return !m_d->installsList.targetPath.isEmpty();
}
bool DeployableFilesPerProFile::isModified() const { return m_d->modified; }
void DeployableFilesPerProFile::setUnModified() { m_d->modified = false; }
QString DeployableFilesPerProFile::projectName() const { return m_d->projectName; }
QString DeployableFilesPerProFile::proFilePath() const { return m_d->proFilePath; }
Qt4ProjectType DeployableFilesPerProFile::projectType() const { return m_d->projectType; }
QString DeployableFilesPerProFile::applicationName() const { return m_d->targetInfo.target; }
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -33,8 +33,6 @@
#ifndef DEPLOYABLEFILESPERPROFILE_H #ifndef DEPLOYABLEFILESPERPROFILE_H
#define DEPLOYABLEFILESPERPROFILE_H #define DEPLOYABLEFILESPERPROFILE_H
#include "deployablefile.h"
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <qt4projectmanager/qt4nodes.h> #include <qt4projectmanager/qt4nodes.h>
@@ -44,6 +42,11 @@
#include <QtCore/QString> #include <QtCore/QString>
namespace RemoteLinux { namespace RemoteLinux {
class DeployableFile;
namespace Internal {
class DeployableFilesPerProFilePrivate;
}
class REMOTELINUX_EXPORT DeployableFilesPerProFile : public QAbstractTableModel class REMOTELINUX_EXPORT DeployableFilesPerProFile : public QAbstractTableModel
{ {
@@ -56,17 +59,17 @@ public:
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
DeployableFile deployableAt(int row) const; DeployableFile deployableAt(int row) const;
bool isModified() const { return m_modified; } bool isModified() const;
void setUnModified() { m_modified = false; } void setUnModified();
QString localExecutableFilePath() const; QString localExecutableFilePath() const;
QString remoteExecutableFilePath() const; QString remoteExecutableFilePath() const;
QString projectName() const { return m_projectName; } QString projectName() const;
QString projectDir() const; QString projectDir() const;
QString proFilePath() const { return m_proFilePath; } QString proFilePath() const;
Qt4ProjectManager::Qt4ProjectType projectType() const { return m_projectType; } Qt4ProjectManager::Qt4ProjectType projectType() const;
bool isApplicationProject() const { return m_projectType == Qt4ProjectManager::ApplicationTemplate; } bool isApplicationProject() const { return projectType() == Qt4ProjectManager::ApplicationTemplate; }
QString applicationName() const { return m_targetInfo.target; } QString applicationName() const;
bool hasTargetPath() const { return !m_installsList.targetPath.isEmpty(); } bool hasTargetPath() const;
private: private:
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
@@ -77,15 +80,7 @@ private:
QStringList localLibraryFilePaths() const; QStringList localLibraryFilePaths() const;
const Qt4ProjectManager::Qt4ProjectType m_projectType; Internal::DeployableFilesPerProFilePrivate * const m_d;
const QString m_proFilePath;
const QString m_projectName;
const Qt4ProjectManager::TargetInformation m_targetInfo;
const Qt4ProjectManager::InstallsList m_installsList;
const Qt4ProjectManager::ProjectVersion m_projectVersion;
const QStringList m_config;
QList<DeployableFile> m_deployables;
bool m_modified;
}; };
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -39,60 +39,76 @@
#include <qt4projectmanager/qt4project.h> #include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4target.h> #include <qt4projectmanager/qt4target.h>
#include <QtCore/QList>
#include <QtCore/QTimer> #include <QtCore/QTimer>
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
class DeploymentInfoPrivate
{
public:
DeploymentInfoPrivate(const Qt4BaseTarget *target) : target(target) {}
QList<DeployableFilesPerProFile *> listModels;
const Qt4ProjectManager::Qt4BaseTarget * const target;
QTimer updateTimer;
};
} // namespace Internal
using namespace Internal; using namespace Internal;
DeploymentInfo::DeploymentInfo(const Qt4BaseTarget *target) DeploymentInfo::DeploymentInfo(const Qt4BaseTarget *target) : m_d(new DeploymentInfoPrivate(target))
: m_target(target), m_updateTimer(new QTimer(this))
{ {
Qt4Project * const pro = m_target->qt4Project(); Qt4Project * const pro = m_d->target->qt4Project();
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)), connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool))); SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
m_updateTimer->setInterval(1500); m_d->updateTimer.setInterval(1500);
m_updateTimer->setSingleShot(true); m_d->updateTimer.setSingleShot(true);
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(createModels())); connect(&m_d->updateTimer, SIGNAL(timeout()), this, SLOT(createModels()));
createModels(); createModels();
} }
DeploymentInfo::~DeploymentInfo() {} DeploymentInfo::~DeploymentInfo()
{
delete m_d;
}
void DeploymentInfo::startTimer(Qt4ProjectManager::Qt4ProFileNode*, bool success, bool parseInProgress) void DeploymentInfo::startTimer(Qt4ProjectManager::Qt4ProFileNode*, bool success, bool parseInProgress)
{ {
Q_UNUSED(success) Q_UNUSED(success)
if (!parseInProgress) if (!parseInProgress)
m_updateTimer->start(); m_d->updateTimer.start();
} }
void DeploymentInfo::createModels() void DeploymentInfo::createModels()
{ {
if (m_target->project()->activeTarget() != m_target) if (m_d->target->project()->activeTarget() != m_d->target)
return; return;
if (!m_target->activeBuildConfiguration() || !m_target->activeBuildConfiguration()->qtVersion() if (!m_d->target->activeBuildConfiguration() || !m_d->target->activeBuildConfiguration()->qtVersion()
|| !m_target->activeBuildConfiguration()->qtVersion()->isValid()) { || !m_d->target->activeBuildConfiguration()->qtVersion()->isValid()) {
beginResetModel(); beginResetModel();
qDeleteAll(m_listModels); qDeleteAll(m_d->listModels);
m_listModels.clear(); m_d->listModels.clear();
endResetModel(); endResetModel();
return; return;
} }
const Qt4ProFileNode *const rootNode const Qt4ProFileNode *const rootNode
= m_target->qt4Project()->rootProjectNode(); = m_d->target->qt4Project()->rootProjectNode();
if (!rootNode || rootNode->parseInProgress()) // Can be null right after project creation by wizard. if (!rootNode || rootNode->parseInProgress()) // Can be null right after project creation by wizard.
return; return;
m_updateTimer->stop(); m_d->updateTimer.stop();
disconnect(m_target->qt4Project(), disconnect(m_d->target->qt4Project(),
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool))); this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
beginResetModel(); beginResetModel();
qDeleteAll(m_listModels); qDeleteAll(m_d->listModels);
m_listModels.clear(); m_d->listModels.clear();
createModels(rootNode); createModels(rootNode);
endResetModel(); endResetModel();
connect(m_target->qt4Project(), connect(m_d->target->qt4Project(),
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool))); this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
} }
@@ -103,12 +119,12 @@ void DeploymentInfo::createModels(const Qt4ProFileNode *proFileNode)
case ApplicationTemplate: case ApplicationTemplate:
case LibraryTemplate: case LibraryTemplate:
case AuxTemplate: case AuxTemplate:
m_listModels << new DeployableFilesPerProFile(proFileNode, this); m_d->listModels << new DeployableFilesPerProFile(proFileNode, this);
break; break;
case SubDirsTemplate: { case SubDirsTemplate: {
const QList<ProjectExplorer::ProjectNode *> &subProjects const QList<ProjectExplorer::ProjectNode *> &subProjects
= proFileNode->subProjectNodes(); = proFileNode->subProjectNodes();
foreach (const ProjectExplorer::ProjectNode *subProject, subProjects) { foreach (const ProjectExplorer::ProjectNode * const subProject, subProjects) {
const Qt4ProFileNode * const qt4SubProject const Qt4ProFileNode * const qt4SubProject
= qobject_cast<const Qt4ProFileNode *>(subProject); = qobject_cast<const Qt4ProFileNode *>(subProject);
if (qt4SubProject && !qt4SubProject->path() if (qt4SubProject && !qt4SubProject->path()
@@ -123,13 +139,13 @@ void DeploymentInfo::createModels(const Qt4ProFileNode *proFileNode)
void DeploymentInfo::setUnmodified() void DeploymentInfo::setUnmodified()
{ {
foreach (DeployableFilesPerProFile *model, m_listModels) foreach (DeployableFilesPerProFile * const model, m_d->listModels)
model->setUnModified(); model->setUnModified();
} }
bool DeploymentInfo::isModified() const bool DeploymentInfo::isModified() const
{ {
foreach (const DeployableFilesPerProFile *model, m_listModels) { foreach (const DeployableFilesPerProFile * const model, m_d->listModels) {
if (model->isModified()) if (model->isModified())
return true; return true;
} }
@@ -139,14 +155,14 @@ bool DeploymentInfo::isModified() const
int DeploymentInfo::deployableCount() const int DeploymentInfo::deployableCount() const
{ {
int count = 0; int count = 0;
foreach (const DeployableFilesPerProFile *model, m_listModels) foreach (const DeployableFilesPerProFile * const model, m_d->listModels)
count += model->rowCount(); count += model->rowCount();
return count; return count;
} }
DeployableFile DeploymentInfo::deployableAt(int i) const DeployableFile DeploymentInfo::deployableAt(int i) const
{ {
foreach (const DeployableFilesPerProFile *model, m_listModels) { foreach (const DeployableFilesPerProFile * const model, m_d->listModels) {
Q_ASSERT(i >= 0); Q_ASSERT(i >= 0);
if (i < model->rowCount()) if (i < model->rowCount())
return model->deployableAt(i); return model->deployableAt(i);
@@ -159,7 +175,7 @@ DeployableFile DeploymentInfo::deployableAt(int i) const
QString DeploymentInfo::remoteExecutableFilePath(const QString &localExecutableFilePath) const QString DeploymentInfo::remoteExecutableFilePath(const QString &localExecutableFilePath) const
{ {
foreach (const DeployableFilesPerProFile *model, m_listModels) { foreach (const DeployableFilesPerProFile * const model, m_d->listModels) {
if (model->localExecutableFilePath() == localExecutableFilePath) if (model->localExecutableFilePath() == localExecutableFilePath)
return model->remoteExecutableFilePath(); return model->remoteExecutableFilePath();
} }
@@ -176,7 +192,7 @@ QVariant DeploymentInfo::data(const QModelIndex &index, int role) const
if (!index.isValid() || index.row() < 0 || index.row() >= modelCount() if (!index.isValid() || index.row() < 0 || index.row() >= modelCount()
|| index.column() != 0) || index.column() != 0)
return QVariant(); return QVariant();
const DeployableFilesPerProFile *const model = m_listModels.at(index.row()); const DeployableFilesPerProFile * const model = m_d->listModels.at(index.row());
if (role == Qt::ForegroundRole && model->projectType() != AuxTemplate if (role == Qt::ForegroundRole && model->projectType() != AuxTemplate
&& !model->hasTargetPath()) { && !model->hasTargetPath()) {
QBrush brush; QBrush brush;
@@ -188,4 +204,7 @@ QVariant DeploymentInfo::data(const QModelIndex &index, int role) const
return QVariant(); return QVariant();
} }
int DeploymentInfo::modelCount() const { return m_d->listModels.count(); }
DeployableFilesPerProFile *DeploymentInfo::modelAt(int i) const { return m_d->listModels.at(i); }
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -35,9 +35,6 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <QtCore/QAbstractListModel> #include <QtCore/QAbstractListModel>
#include <QtCore/QList>
QT_FORWARD_DECLARE_CLASS(QTimer)
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
class Qt4BaseTarget; class Qt4BaseTarget;
@@ -48,19 +45,24 @@ namespace RemoteLinux {
class DeployableFile; class DeployableFile;
class DeployableFilesPerProFile; class DeployableFilesPerProFile;
namespace Internal {
class DeploymentInfoPrivate;
}
class REMOTELINUX_EXPORT DeploymentInfo : public QAbstractListModel class REMOTELINUX_EXPORT DeploymentInfo : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
public: public:
DeploymentInfo(const Qt4ProjectManager::Qt4BaseTarget *target); DeploymentInfo(const Qt4ProjectManager::Qt4BaseTarget *target);
~DeploymentInfo(); ~DeploymentInfo();
void setUnmodified(); void setUnmodified();
bool isModified() const; bool isModified() const;
int deployableCount() const; int deployableCount() const;
DeployableFile deployableAt(int i) const; DeployableFile deployableAt(int i) const;
QString remoteExecutableFilePath(const QString &localExecutableFilePath) const; QString remoteExecutableFilePath(const QString &localExecutableFilePath) const;
int modelCount() const { return m_listModels.count(); } int modelCount() const;
DeployableFilesPerProFile *modelAt(int i) const { return m_listModels.at(i); } DeployableFilesPerProFile *modelAt(int i) const;
private slots: private slots:
void startTimer(Qt4ProjectManager::Qt4ProFileNode *, bool success, bool parseInProgress); void startTimer(Qt4ProjectManager::Qt4ProFileNode *, bool success, bool parseInProgress);
@@ -72,9 +74,7 @@ private:
Q_SLOT void createModels(); Q_SLOT void createModels();
void createModels(const Qt4ProjectManager::Qt4ProFileNode *proFileNode); void createModels(const Qt4ProjectManager::Qt4ProFileNode *proFileNode);
QList<DeployableFilesPerProFile *> m_listModels; Internal::DeploymentInfoPrivate * const m_d;
const Qt4ProjectManager::Qt4BaseTarget * const m_target;
QTimer *const m_updateTimer;
}; };
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -49,7 +49,7 @@ class REMOTELINUX_EXPORT GenericDirectUploadService : public AbstractRemoteLinux
{ {
Q_OBJECT Q_OBJECT
public: public:
GenericDirectUploadService(QObject *parent); GenericDirectUploadService(QObject *parent = 0);
void setDeployableFiles(const QList<DeployableFile> &deployableFiles); void setDeployableFiles(const QList<DeployableFile> &deployableFiles);

View File

@@ -40,6 +40,13 @@
#include <QtCore/QSharedPointer> #include <QtCore/QSharedPointer>
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
class GenericDirectUploadStepPrivate
{
public:
GenericDirectUploadService deployService;
};
} // namespace Internal
GenericDirectUploadStep::GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, const QString &id) GenericDirectUploadStep::GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, const QString &id)
: AbstractRemoteLinuxDeployStep(bsl, id) : AbstractRemoteLinuxDeployStep(bsl, id)
@@ -53,6 +60,11 @@ GenericDirectUploadStep::GenericDirectUploadStep(ProjectExplorer::BuildStepList
ctor(); ctor();
} }
GenericDirectUploadStep::~GenericDirectUploadStep()
{
delete m_d;
}
bool GenericDirectUploadStep::isDeploymentPossible(QString *whyNot) const bool GenericDirectUploadStep::isDeploymentPossible(QString *whyNot) const
{ {
QList<DeployableFile> deployableFiles; QList<DeployableFile> deployableFiles;
@@ -60,19 +72,19 @@ bool GenericDirectUploadStep::isDeploymentPossible(QString *whyNot) const
const int deployableCount = deploymentInfo->deployableCount(); const int deployableCount = deploymentInfo->deployableCount();
for (int i = 0; i < deployableCount; ++i) for (int i = 0; i < deployableCount; ++i)
deployableFiles << deploymentInfo->deployableAt(i); deployableFiles << deploymentInfo->deployableAt(i);
m_deployService->setDeployableFiles(deployableFiles); m_d->deployService.setDeployableFiles(deployableFiles);
return AbstractRemoteLinuxDeployStep::isDeploymentPossible(whyNot); return AbstractRemoteLinuxDeployStep::isDeploymentPossible(whyNot);
} }
AbstractRemoteLinuxDeployService *GenericDirectUploadStep::deployService() const AbstractRemoteLinuxDeployService *GenericDirectUploadStep::deployService() const
{ {
return m_deployService; return &m_d->deployService;
} }
void GenericDirectUploadStep::ctor() void GenericDirectUploadStep::ctor()
{ {
setDefaultDisplayName(displayName()); setDefaultDisplayName(displayName());
m_deployService = new GenericDirectUploadService(this); m_d = new Internal::GenericDirectUploadStepPrivate;
} }
QString GenericDirectUploadStep::stepId() QString GenericDirectUploadStep::stepId()

View File

@@ -36,7 +36,9 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
namespace RemoteLinux { namespace RemoteLinux {
class GenericDirectUploadService; namespace Internal {
class GenericDirectUploadStepPrivate;
}
class REMOTELINUX_EXPORT GenericDirectUploadStep : public AbstractRemoteLinuxDeployStep class REMOTELINUX_EXPORT GenericDirectUploadStep : public AbstractRemoteLinuxDeployStep
{ {
@@ -45,6 +47,7 @@ class REMOTELINUX_EXPORT GenericDirectUploadStep : public AbstractRemoteLinuxDep
public: public:
GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, const QString &id); GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, const QString &id);
GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, GenericDirectUploadStep *other); GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, GenericDirectUploadStep *other);
~GenericDirectUploadStep();
bool isDeploymentPossible(QString *whyNot = 0) const; bool isDeploymentPossible(QString *whyNot = 0) const;
@@ -56,7 +59,7 @@ private:
void ctor(); void ctor();
GenericDirectUploadService *m_deployService; Internal::GenericDirectUploadStepPrivate *m_d;
}; };
} //namespace RemoteLinux } //namespace RemoteLinux

View File

@@ -33,6 +33,7 @@
#include "genericlinuxdeviceconfigurationwizardpages.h" #include "genericlinuxdeviceconfigurationwizardpages.h"
#include "linuxdevicetestdialog.h" #include "linuxdevicetestdialog.h"
#include "linuxdevicetester.h" #include "linuxdevicetester.h"
#include "portlist.h"
#include "remotelinux_constants.h" #include "remotelinux_constants.h"
using namespace Utils; using namespace Utils;
@@ -84,7 +85,7 @@ LinuxDeviceConfiguration::Ptr GenericLinuxDeviceConfigurationWizard::deviceConfi
else else
sshParams.privateKeyFile = m_d->setupPage.privateKeyFilePath(); sshParams.privateKeyFile = m_d->setupPage.privateKeyFilePath();
LinuxDeviceConfiguration::Ptr devConf = LinuxDeviceConfiguration::create(m_d->setupPage.configurationName(), LinuxDeviceConfiguration::Ptr devConf = LinuxDeviceConfiguration::create(m_d->setupPage.configurationName(),
QLatin1String(Constants::GenericLinuxOsType), LinuxDeviceConfiguration::Physical, QLatin1String(Constants::GenericLinuxOsType), LinuxDeviceConfiguration::Hardware,
PortList::fromString(QLatin1String("10000-10100")), sshParams); PortList::fromString(QLatin1String("10000-10100")), sshParams);
LinuxDeviceTestDialog dlg(devConf, new GenericLinuxDeviceTester(this), this); LinuxDeviceTestDialog dlg(devConf, new GenericLinuxDeviceTester(this), this);
dlg.exec(); dlg.exec();

View File

@@ -42,6 +42,12 @@ public:
Ui::GenericLinuxDeviceConfigurationWizardSetupPage ui; Ui::GenericLinuxDeviceConfigurationWizardSetupPage ui;
}; };
class GenericLinuxDeviceConfigurationWizardFinalPagePrivate
{
public:
QLabel infoLabel;
};
} // namespace Internal } // namespace Internal
using namespace Utils; using namespace Utils;
@@ -139,18 +145,23 @@ void GenericLinuxDeviceConfigurationWizardSetupPage::handleAuthTypeChanged()
GenericLinuxDeviceConfigurationWizardFinalPage::GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent) GenericLinuxDeviceConfigurationWizardFinalPage::GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent)
: QWizardPage(parent), m_infoLabel(new QLabel(this)) : QWizardPage(parent), m_d(new Internal::GenericLinuxDeviceConfigurationWizardFinalPagePrivate)
{ {
setTitle(tr("Setup Finished")); setTitle(tr("Setup Finished"));
setSubTitle(QLatin1String(" ")); // For Qt bug (background color) setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
m_infoLabel->setWordWrap(true); m_d->infoLabel.setWordWrap(true);
QVBoxLayout * const layout = new QVBoxLayout(this); QVBoxLayout * const layout = new QVBoxLayout(this);
layout->addWidget(m_infoLabel); layout->addWidget(&m_d->infoLabel);
}
GenericLinuxDeviceConfigurationWizardFinalPage::~GenericLinuxDeviceConfigurationWizardFinalPage()
{
delete m_d;
} }
void GenericLinuxDeviceConfigurationWizardFinalPage::initializePage() void GenericLinuxDeviceConfigurationWizardFinalPage::initializePage()
{ {
m_infoLabel->setText(infoText()); m_d->infoLabel.setText(infoText());
} }
QString GenericLinuxDeviceConfigurationWizardFinalPage::infoText() const QString GenericLinuxDeviceConfigurationWizardFinalPage::infoText() const

View File

@@ -37,13 +37,10 @@
#include <QtGui/QWizardPage> #include <QtGui/QWizardPage>
QT_BEGIN_NAMESPACE
class QLabel;
QT_END_NAMESPACE
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
class GenericLinuxDeviceConfigurationWizardSetupPagePrivate; class GenericLinuxDeviceConfigurationWizardSetupPagePrivate;
class GenericLinuxDeviceConfigurationWizardFinalPagePrivate;
} // namespace Internal } // namespace Internal
class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizardSetupPage : public QWizardPage class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizardSetupPage : public QWizardPage
@@ -80,6 +77,7 @@ class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizardFinalPage : public
Q_OBJECT Q_OBJECT
public: public:
GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent); GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent);
~GenericLinuxDeviceConfigurationWizardFinalPage();
void initializePage(); void initializePage();
@@ -87,7 +85,7 @@ protected:
virtual QString infoText() const; virtual QString infoText() const;
private: private:
QLabel * const m_infoLabel; Internal::GenericLinuxDeviceConfigurationWizardFinalPagePrivate * const m_d;
}; };
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -31,14 +31,19 @@
**************************************************************************/ **************************************************************************/
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include "portlist.h"
#include "remotelinux_constants.h" #include "remotelinux_constants.h"
#include <utils/ssh/sshconnection.h>
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtGui/QDesktopServices> #include <QtGui/QDesktopServices>
typedef Utils::SshConnectionParameters::AuthenticationType AuthType; using namespace Utils;
typedef SshConnectionParameters::AuthenticationType AuthType;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
namespace { namespace {
const QLatin1String NameKey("Name"); const QLatin1String NameKey("Name");
const QLatin1String OldOsVersionKey("OsVersion"); // Outdated, only use for upgrading. const QLatin1String OldOsVersionKey("OsVersion"); // Outdated, only use for upgrading.
@@ -55,13 +60,36 @@ const QLatin1String TimeoutKey("Timeout");
const QLatin1String IsDefaultKey("IsDefault"); const QLatin1String IsDefaultKey("IsDefault");
const QLatin1String InternalIdKey("InternalId"); const QLatin1String InternalIdKey("InternalId");
const AuthType DefaultAuthType(Utils::SshConnectionParameters::AuthenticationByKey); const AuthType DefaultAuthType(SshConnectionParameters::AuthenticationByKey);
const int DefaultTimeout(10); const int DefaultTimeout(10);
const LinuxDeviceConfiguration::DeviceType DefaultDeviceType(LinuxDeviceConfiguration::Physical); const LinuxDeviceConfiguration::DeviceType DefaultDeviceType(LinuxDeviceConfiguration::Hardware);
} // anonymous namespace } // anonymous namespace
class LinuxDeviceConfigurationPrivate
{
public:
LinuxDeviceConfigurationPrivate(const SshConnectionParameters &sshParameters)
: sshParameters(sshParameters)
{
}
LinuxDeviceConfiguration::~LinuxDeviceConfiguration() {} SshConnectionParameters sshParameters;
QString name;
QString osType;
LinuxDeviceConfiguration::DeviceType deviceType;
PortList freePorts;
bool isDefault;
LinuxDeviceConfiguration::Id internalId;
};
} // namespace Internal
using namespace Internal;
LinuxDeviceConfiguration::~LinuxDeviceConfiguration()
{
delete m_d;
}
LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create(const QSettings &settings, LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create(const QSettings &settings,
Id &nextId) Id &nextId)
@@ -76,63 +104,66 @@ LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create(const ConstPtr &o
LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create(const QString &name, LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create(const QString &name,
const QString &osType, DeviceType deviceType, const PortList &freePorts, const QString &osType, DeviceType deviceType, const PortList &freePorts,
const Utils::SshConnectionParameters &sshParams) const SshConnectionParameters &sshParams)
{ {
return Ptr(new LinuxDeviceConfiguration(name, osType, deviceType, freePorts, sshParams)); return Ptr(new LinuxDeviceConfiguration(name, osType, deviceType, freePorts, sshParams));
} }
LinuxDeviceConfiguration::LinuxDeviceConfiguration(const QString &name, const QString &osType, LinuxDeviceConfiguration::LinuxDeviceConfiguration(const QString &name, const QString &osType,
DeviceType deviceType, const PortList &freePorts, DeviceType deviceType, const PortList &freePorts, const SshConnectionParameters &sshParams)
const Utils::SshConnectionParameters &sshParams) : m_d(new LinuxDeviceConfigurationPrivate(sshParams))
: m_sshParameters(sshParams), m_name(name), m_osType(osType), m_type(deviceType),
m_freePorts(freePorts), m_isDefault(false)
{ {
m_d->name = name;
m_d->osType = osType;
m_d->deviceType = deviceType;
m_d->freePorts = freePorts;
m_d->isDefault = false;
} }
LinuxDeviceConfiguration::LinuxDeviceConfiguration(const QSettings &settings, LinuxDeviceConfiguration::LinuxDeviceConfiguration(const QSettings &settings, Id &nextId)
Id &nextId) : m_d(new LinuxDeviceConfigurationPrivate(SshConnectionParameters::NoProxy))
: m_sshParameters(Utils::SshConnectionParameters::NoProxy),
m_name(settings.value(NameKey).toString()),
m_osType(settings.value(OsTypeKey).toString()),
m_type(static_cast<DeviceType>(settings.value(TypeKey, DefaultDeviceType).toInt())),
m_isDefault(settings.value(IsDefaultKey, false).toBool()),
m_internalId(settings.value(InternalIdKey, nextId).toULongLong())
{ {
if (m_internalId == nextId) m_d->name = settings.value(NameKey).toString();
m_d->osType = settings.value(OsTypeKey).toString();
m_d->deviceType = static_cast<DeviceType>(settings.value(TypeKey, DefaultDeviceType).toInt());
m_d->isDefault = settings.value(IsDefaultKey, false).toBool();
m_d->internalId = settings.value(InternalIdKey, nextId).toULongLong();
if (m_d->internalId == nextId)
++nextId; ++nextId;
// Convert from version < 2.3. // Convert from version < 2.3.
if (m_osType.isEmpty()) { if (m_d->osType.isEmpty()) {
const int oldOsType = settings.value(OldOsVersionKey, -1).toInt(); const int oldOsType = settings.value(OldOsVersionKey, -1).toInt();
switch (oldOsType) { switch (oldOsType) {
case 0: m_osType = QLatin1String("Maemo5OsType"); break; case 0: m_d->osType = QLatin1String("Maemo5OsType"); break;
case 1: m_osType = QLatin1String("HarmattanOsType"); break; case 1: m_d->osType = QLatin1String("HarmattanOsType"); break;
case 2: m_osType = QLatin1String("MeeGoOsType"); break; case 2: m_d->osType = QLatin1String("MeeGoOsType"); break;
default: m_osType = QLatin1String(Constants::GenericLinuxOsType); default: m_d->osType = QLatin1String(Constants::GenericLinuxOsType);
} }
} }
m_freePorts = PortList::fromString(settings.value(PortsSpecKey, QLatin1String("10000-10100")).toString()); m_d->freePorts = PortList::fromString(settings.value(PortsSpecKey, QLatin1String("10000-10100")).toString());
m_sshParameters.host = settings.value(HostKey).toString(); m_d->sshParameters.host = settings.value(HostKey).toString();
m_sshParameters.port = settings.value(SshPortKey, 22).toInt(); m_d->sshParameters.port = settings.value(SshPortKey, 22).toInt();
m_sshParameters.userName = settings.value(UserNameKey).toString(); m_d->sshParameters.userName = settings.value(UserNameKey).toString();
m_sshParameters.authenticationType m_d->sshParameters.authenticationType
= static_cast<AuthType>(settings.value(AuthKey, DefaultAuthType).toInt()); = static_cast<AuthType>(settings.value(AuthKey, DefaultAuthType).toInt());
m_sshParameters.password = settings.value(PasswordKey).toString(); m_d->sshParameters.password = settings.value(PasswordKey).toString();
m_sshParameters.privateKeyFile m_d->sshParameters.privateKeyFile
= settings.value(KeyFileKey, defaultPrivateKeyFilePath()).toString(); = settings.value(KeyFileKey, defaultPrivateKeyFilePath()).toString();
m_sshParameters.timeout = settings.value(TimeoutKey, DefaultTimeout).toInt(); m_d->sshParameters.timeout = settings.value(TimeoutKey, DefaultTimeout).toInt();
} }
LinuxDeviceConfiguration::LinuxDeviceConfiguration(const LinuxDeviceConfiguration::ConstPtr &other) LinuxDeviceConfiguration::LinuxDeviceConfiguration(const LinuxDeviceConfiguration::ConstPtr &other)
: m_sshParameters(other->m_sshParameters), : m_d(new LinuxDeviceConfigurationPrivate(other->m_d->sshParameters))
m_name(other->m_name),
m_osType(other->m_osType),
m_type(other->type()),
m_freePorts(other->freePorts()),
m_isDefault(other->m_isDefault),
m_internalId(other->m_internalId)
{ {
m_d->name = other->m_d->name;
m_d->osType = other->m_d->osType;
m_d->deviceType = other->deviceType();
m_d->freePorts = other->freePorts();
m_d->isDefault = other->m_d->isDefault;
m_d->internalId = other->m_d->internalId;
} }
QString LinuxDeviceConfiguration::defaultPrivateKeyFilePath() QString LinuxDeviceConfiguration::defaultPrivateKeyFilePath()
@@ -148,20 +179,55 @@ QString LinuxDeviceConfiguration::defaultPublicKeyFilePath()
void LinuxDeviceConfiguration::save(QSettings &settings) const void LinuxDeviceConfiguration::save(QSettings &settings) const
{ {
settings.setValue(NameKey, m_name); settings.setValue(NameKey, m_d->name);
settings.setValue(OsTypeKey, m_osType); settings.setValue(OsTypeKey, m_d->osType);
settings.setValue(TypeKey, m_type); settings.setValue(TypeKey, m_d->deviceType);
settings.setValue(HostKey, m_sshParameters.host); settings.setValue(HostKey, m_d->sshParameters.host);
settings.setValue(SshPortKey, m_sshParameters.port); settings.setValue(SshPortKey, m_d->sshParameters.port);
settings.setValue(PortsSpecKey, m_freePorts.toString()); settings.setValue(PortsSpecKey, m_d->freePorts.toString());
settings.setValue(UserNameKey, m_sshParameters.userName); settings.setValue(UserNameKey, m_d->sshParameters.userName);
settings.setValue(AuthKey, m_sshParameters.authenticationType); settings.setValue(AuthKey, m_d->sshParameters.authenticationType);
settings.setValue(PasswordKey, m_sshParameters.password); settings.setValue(PasswordKey, m_d->sshParameters.password);
settings.setValue(KeyFileKey, m_sshParameters.privateKeyFile); settings.setValue(KeyFileKey, m_d->sshParameters.privateKeyFile);
settings.setValue(TimeoutKey, m_sshParameters.timeout); settings.setValue(TimeoutKey, m_d->sshParameters.timeout);
settings.setValue(IsDefaultKey, m_isDefault); settings.setValue(IsDefaultKey, m_d->isDefault);
settings.setValue(InternalIdKey, m_internalId); settings.setValue(InternalIdKey, m_d->internalId);
} }
SshConnectionParameters LinuxDeviceConfiguration::sshParameters() const
{
return m_d->sshParameters;
}
LinuxDeviceConfiguration::DeviceType LinuxDeviceConfiguration::deviceType() const
{
return m_d->deviceType;
}
LinuxDeviceConfiguration::Id LinuxDeviceConfiguration::internalId() const
{
return m_d->internalId;
}
void LinuxDeviceConfiguration::setSshParameters(const SshConnectionParameters &sshParameters)
{
m_d->sshParameters = sshParameters;
}
void LinuxDeviceConfiguration::setFreePorts(const PortList &freePorts)
{
m_d->freePorts = freePorts;
}
PortList LinuxDeviceConfiguration::freePorts() const { return m_d->freePorts; }
QString LinuxDeviceConfiguration::name() const { return m_d->name; }
QString LinuxDeviceConfiguration::osType() const { return m_d->osType; }
bool LinuxDeviceConfiguration::isDefault() const { return m_d->isDefault; }
void LinuxDeviceConfiguration::setName(const QString &name) { m_d->name = name; }
void LinuxDeviceConfiguration::setInternalId(Id id) { m_d->internalId = id; }
void LinuxDeviceConfiguration::setDefault(bool isDefault) { m_d->isDefault = isDefault; }
const LinuxDeviceConfiguration::Id LinuxDeviceConfiguration::InvalidId = 0; const LinuxDeviceConfiguration::Id LinuxDeviceConfiguration::InvalidId = 0;
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -32,11 +32,8 @@
#ifndef LINUXDEVICECONFIGURATION_H #ifndef LINUXDEVICECONFIGURATION_H
#define LINUXDEVICECONFIGURATION_H #define LINUXDEVICECONFIGURATION_H
#include "portlist.h"
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <utils/ssh/sshconnection.h>
#include <QtCore/QSharedPointer> #include <QtCore/QSharedPointer>
#include <QtCore/QString> #include <QtCore/QString>
#include <QtCore/QStringList> #include <QtCore/QStringList>
@@ -47,11 +44,17 @@ class QDialog;
class QSettings; class QSettings;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Utils {
class SshConnectionParameters;
}
namespace RemoteLinux { namespace RemoteLinux {
class PortList;
namespace Internal { namespace Internal {
class LinuxDeviceConfigurationPrivate;
class LinuxDeviceConfigurations; class LinuxDeviceConfigurations;
} } // namespace Internal
class REMOTELINUX_EXPORT LinuxDeviceConfiguration class REMOTELINUX_EXPORT LinuxDeviceConfiguration
{ {
@@ -62,18 +65,17 @@ public:
typedef quint64 Id; typedef quint64 Id;
enum DeviceType { Physical, Emulator }; enum DeviceType { Hardware, Emulator };
~LinuxDeviceConfiguration(); ~LinuxDeviceConfiguration();
PortList freePorts() const { return m_freePorts; } PortList freePorts() const;
Utils::SshConnectionParameters sshParameters() const { return m_sshParameters; } Utils::SshConnectionParameters sshParameters() const;
QString name() const { return m_name; } QString name() const;
void setName(const QString &name) { m_name = name; } QString osType() const;
QString osType() const { return m_osType; } DeviceType deviceType() const;
DeviceType type() const { return m_type; } Id internalId() const;
Id internalId() const { return m_internalId; } bool isDefault() const;
bool isDefault() const { return m_isDefault; }
static QString defaultPrivateKeyFilePath(); static QString defaultPrivateKeyFilePath();
static QString defaultPublicKeyFilePath(); static QString defaultPublicKeyFilePath();
@@ -95,15 +97,14 @@ private:
static Ptr create(const QSettings &settings, Id &nextId); static Ptr create(const QSettings &settings, Id &nextId);
static Ptr create(const ConstPtr &other); static Ptr create(const ConstPtr &other);
void setName(const QString &name);
void setInternalId(Id id);
void setDefault(bool isDefault);
void setSshParameters(const Utils::SshConnectionParameters &sshParameters);
void setFreePorts(const PortList &freePorts);
void save(QSettings &settings) const; void save(QSettings &settings) const;
Utils::SshConnectionParameters m_sshParameters; Internal::LinuxDeviceConfigurationPrivate *m_d;
QString m_name;
QString m_osType;
DeviceType m_type;
PortList m_freePorts;
bool m_isDefault;
Id m_internalId;
}; };

View File

@@ -34,6 +34,7 @@
#include "remotelinuxutils.h" #include "remotelinuxutils.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/qtcassert.h>
#include <QtCore/QHash> #include <QtCore/QHash>
#include <QtCore/QSettings> #include <QtCore/QSettings>
@@ -128,12 +129,12 @@ void LinuxDeviceConfigurations::addConfiguration(const LinuxDeviceConfiguration:
name = nameTemplate.arg(QString::number(suffix++)); name = nameTemplate.arg(QString::number(suffix++));
while (hasConfig(name)); while (hasConfig(name));
} }
devConfig->m_name = name; devConfig->setName(name);
devConfig->m_internalId = m_nextId++; devConfig->setInternalId(m_nextId++);
beginInsertRows(QModelIndex(), rowCount(), rowCount()); beginInsertRows(QModelIndex(), rowCount(), rowCount());
if (!defaultDeviceConfig(devConfig->osType())) if (!defaultDeviceConfig(devConfig->osType()))
devConfig->m_isDefault = true; devConfig->setDefault(true);
m_devConfigs << devConfig; m_devConfigs << devConfig;
endInsertRows(); endInsertRows();
} }
@@ -142,14 +143,14 @@ void LinuxDeviceConfigurations::removeConfiguration(int idx)
{ {
Q_ASSERT(idx >= 0 && idx < rowCount()); Q_ASSERT(idx >= 0 && idx < rowCount());
beginRemoveRows(QModelIndex(), idx, idx); beginRemoveRows(QModelIndex(), idx, idx);
const bool wasDefault = deviceAt(idx)->m_isDefault; const bool wasDefault = deviceAt(idx)->isDefault();
const QString osType = deviceAt(idx)->osType(); const QString osType = deviceAt(idx)->osType();
m_devConfigs.removeAt(idx); m_devConfigs.removeAt(idx);
endRemoveRows(); endRemoveRows();
if (wasDefault) { if (wasDefault) {
for (int i = 0; i < m_devConfigs.count(); ++i) { for (int i = 0; i < m_devConfigs.count(); ++i) {
if (deviceAt(i)->osType() == osType) { if (deviceAt(i)->osType() == osType) {
m_devConfigs.at(i)->m_isDefault = true; m_devConfigs.at(i)->setDefault(true);
const QModelIndex changedIndex = index(i, 0); const QModelIndex changedIndex = index(i, 0);
emit dataChanged(changedIndex, changedIndex); emit dataChanged(changedIndex, changedIndex);
break; break;
@@ -161,7 +162,7 @@ void LinuxDeviceConfigurations::removeConfiguration(int idx)
void LinuxDeviceConfigurations::setConfigurationName(int i, const QString &name) void LinuxDeviceConfigurations::setConfigurationName(int i, const QString &name)
{ {
Q_ASSERT(i >= 0 && i < rowCount()); Q_ASSERT(i >= 0 && i < rowCount());
m_devConfigs.at(i)->m_name = name; m_devConfigs.at(i)->setName(name);
const QModelIndex changedIndex = index(i, 0); const QModelIndex changedIndex = index(i, 0);
emit dataChanged(changedIndex, changedIndex); emit dataChanged(changedIndex, changedIndex);
} }
@@ -170,40 +171,39 @@ void LinuxDeviceConfigurations::setSshParameters(int i,
const Utils::SshConnectionParameters &params) const Utils::SshConnectionParameters &params)
{ {
Q_ASSERT(i >= 0 && i < rowCount()); Q_ASSERT(i >= 0 && i < rowCount());
m_devConfigs.at(i)->m_sshParameters = params; m_devConfigs.at(i)->setSshParameters(params);
} }
void LinuxDeviceConfigurations::setFreePorts(int i, const PortList &freePorts) void LinuxDeviceConfigurations::setFreePorts(int i, const PortList &freePorts)
{ {
Q_ASSERT(i >= 0 && i < rowCount()); Q_ASSERT(i >= 0 && i < rowCount());
m_devConfigs.at(i)->m_freePorts = freePorts; m_devConfigs.at(i)->setFreePorts(freePorts);
} }
void LinuxDeviceConfigurations::setDefaultDevice(int idx) void LinuxDeviceConfigurations::setDefaultDevice(int idx)
{ {
Q_ASSERT(idx >= 0 && idx < rowCount()); Q_ASSERT(idx >= 0 && idx < rowCount());
const LinuxDeviceConfiguration::Ptr &devConf = m_devConfigs.at(idx); const LinuxDeviceConfiguration::Ptr &devConf = m_devConfigs.at(idx);
if (devConf->m_isDefault) if (devConf->isDefault())
return; return;
QModelIndex oldDefaultIndex; QModelIndex oldDefaultIndex;
for (int i = 0; i < m_devConfigs.count(); ++i) { for (int i = 0; i < m_devConfigs.count(); ++i) {
const LinuxDeviceConfiguration::Ptr &oldDefaultDev = m_devConfigs.at(i); const LinuxDeviceConfiguration::Ptr &oldDefaultDev = m_devConfigs.at(i);
if (oldDefaultDev->m_isDefault if (oldDefaultDev->isDefault() && oldDefaultDev->osType() == devConf->osType()) {
&& oldDefaultDev->osType() == devConf->osType()) { oldDefaultDev->setDefault(false);
oldDefaultDev->m_isDefault = false;
oldDefaultIndex = index(i, 0); oldDefaultIndex = index(i, 0);
break; break;
} }
} }
Q_ASSERT(oldDefaultIndex.isValid());
QTC_CHECK(oldDefaultIndex.isValid());
emit dataChanged(oldDefaultIndex, oldDefaultIndex); emit dataChanged(oldDefaultIndex, oldDefaultIndex);
devConf->m_isDefault = true; devConf->setDefault(true);
const QModelIndex newDefaultIndex = index(idx, 0); const QModelIndex newDefaultIndex = index(idx, 0);
emit dataChanged(newDefaultIndex, newDefaultIndex); emit dataChanged(newDefaultIndex, newDefaultIndex);
} }
LinuxDeviceConfigurations::LinuxDeviceConfigurations(QObject *parent) LinuxDeviceConfigurations::LinuxDeviceConfigurations(QObject *parent) : QAbstractListModel(parent)
: QAbstractListModel(parent)
{ {
} }
@@ -249,7 +249,7 @@ LinuxDeviceConfiguration::ConstPtr LinuxDeviceConfigurations::find(LinuxDeviceCo
LinuxDeviceConfiguration::ConstPtr LinuxDeviceConfigurations::defaultDeviceConfig(const QString &osType) const LinuxDeviceConfiguration::ConstPtr LinuxDeviceConfigurations::defaultDeviceConfig(const QString &osType) const
{ {
foreach (const LinuxDeviceConfiguration::ConstPtr &devConf, m_devConfigs) { foreach (const LinuxDeviceConfiguration::ConstPtr &devConf, m_devConfigs) {
if (devConf->m_isDefault && devConf->osType() == osType) if (devConf->isDefault() && devConf->osType() == osType)
return devConf; return devConf;
} }
return LinuxDeviceConfiguration::ConstPtr(); return LinuxDeviceConfiguration::ConstPtr();
@@ -258,7 +258,7 @@ LinuxDeviceConfiguration::ConstPtr LinuxDeviceConfigurations::defaultDeviceConfi
int LinuxDeviceConfigurations::indexForInternalId(LinuxDeviceConfiguration::Id internalId) const int LinuxDeviceConfigurations::indexForInternalId(LinuxDeviceConfiguration::Id internalId) const
{ {
for (int i = 0; i < m_devConfigs.count(); ++i) { for (int i = 0; i < m_devConfigs.count(); ++i) {
if (deviceAt(i)->m_internalId == internalId) if (deviceAt(i)->internalId() == internalId)
return i; return i;
} }
return -1; return -1;
@@ -266,7 +266,7 @@ int LinuxDeviceConfigurations::indexForInternalId(LinuxDeviceConfiguration::Id i
LinuxDeviceConfiguration::Id LinuxDeviceConfigurations::internalId(LinuxDeviceConfiguration::ConstPtr devConf) const LinuxDeviceConfiguration::Id LinuxDeviceConfigurations::internalId(LinuxDeviceConfiguration::ConstPtr devConf) const
{ {
return devConf ? devConf->m_internalId : LinuxDeviceConfiguration::InvalidId; return devConf ? devConf->internalId() : LinuxDeviceConfiguration::InvalidId;
} }
void LinuxDeviceConfigurations::ensureOneDefaultConfigurationPerOsType() void LinuxDeviceConfigurations::ensureOneDefaultConfigurationPerOsType()
@@ -277,7 +277,7 @@ void LinuxDeviceConfigurations::ensureOneDefaultConfigurationPerOsType()
foreach (const LinuxDeviceConfiguration::Ptr &devConf, m_devConfigs) { foreach (const LinuxDeviceConfiguration::Ptr &devConf, m_devConfigs) {
if (devConf->isDefault()) { if (devConf->isDefault()) {
if (osTypeHasDefault.value(devConf->osType())) if (osTypeHasDefault.value(devConf->osType()))
devConf->m_isDefault = false; devConf->setDefault(false);
else else
osTypeHasDefault.insert(devConf->osType(), true); osTypeHasDefault.insert(devConf->osType(), true);
} }
@@ -286,7 +286,7 @@ void LinuxDeviceConfigurations::ensureOneDefaultConfigurationPerOsType()
// Step 2: Ensure there's at least one default configuration per device type. // Step 2: Ensure there's at least one default configuration per device type.
foreach (const LinuxDeviceConfiguration::Ptr &devConf, m_devConfigs) { foreach (const LinuxDeviceConfiguration::Ptr &devConf, m_devConfigs) {
if (!osTypeHasDefault.value(devConf->osType())) { if (!osTypeHasDefault.value(devConf->osType())) {
devConf->m_isDefault = true; devConf->setDefault(true);
osTypeHasDefault.insert(devConf->osType(), true); osTypeHasDefault.insert(devConf->osType(), true);
} }
} }
@@ -304,7 +304,7 @@ QVariant LinuxDeviceConfigurations::data(const QModelIndex &index, int role) con
return QVariant(); return QVariant();
const LinuxDeviceConfiguration::ConstPtr devConf = deviceAt(index.row()); const LinuxDeviceConfiguration::ConstPtr devConf = deviceAt(index.row());
QString name = devConf->name(); QString name = devConf->name();
if (devConf->m_isDefault) { if (devConf->isDefault()) {
name += QLatin1Char(' ') + tr("(default for %1)") name += QLatin1Char(' ') + tr("(default for %1)")
.arg(RemoteLinuxUtils::osTypeToString(devConf->osType())); .arg(RemoteLinuxUtils::osTypeToString(devConf->osType()));
} }

View File

@@ -34,6 +34,7 @@
#include "linuxdeviceconfigurations.h" #include "linuxdeviceconfigurations.h"
#include "linuxdevicefactoryselectiondialog.h" #include "linuxdevicefactoryselectiondialog.h"
#include "portlist.h"
#include "remotelinuxutils.h" #include "remotelinuxutils.h"
#include "sshkeycreationdialog.h" #include "sshkeycreationdialog.h"
@@ -202,7 +203,7 @@ void LinuxDeviceConfigurationsSettingsWidget::displayCurrent()
m_ui->defaultDeviceButton->setEnabled(!current->isDefault()); m_ui->defaultDeviceButton->setEnabled(!current->isDefault());
m_ui->osTypeValueLabel->setText(RemoteLinuxUtils::osTypeToString(current->osType())); m_ui->osTypeValueLabel->setText(RemoteLinuxUtils::osTypeToString(current->osType()));
const SshConnectionParameters &sshParams = current->sshParameters(); const SshConnectionParameters &sshParams = current->sshParameters();
if (current->type() == LinuxDeviceConfiguration::Physical) if (current->deviceType() == LinuxDeviceConfiguration::Hardware)
m_ui->deviceTypeValueLabel->setText(tr("Physical Device")); m_ui->deviceTypeValueLabel->setText(tr("Physical Device"));
else else
m_ui->deviceTypeValueLabel->setText(tr("Emulator")); m_ui->deviceTypeValueLabel->setText(tr("Emulator"));

View File

@@ -56,7 +56,7 @@ protected:
void doDeviceSetup() void doDeviceSetup()
{ {
if (deviceConfiguration()->type() == LinuxDeviceConfiguration::Physical) { if (deviceConfiguration()->deviceType() == LinuxDeviceConfiguration::Hardware) {
handleDeviceSetupDone(true); handleDeviceSetupDone(true);
return; return;
} }

View File

@@ -47,8 +47,8 @@
#include <remotelinux/deployablefile.h> #include <remotelinux/deployablefile.h>
#include <remotelinux/deploymentinfo.h> #include <remotelinux/deploymentinfo.h>
#include <remotelinux/linuxdeviceconfiguration.h> #include <remotelinux/linuxdeviceconfiguration.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/ssh/sshconnection.h>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
#include <QtCore/QList> #include <QtCore/QList>
@@ -156,7 +156,7 @@ void AbstractMaemoDeployByMountService::doDeviceSetup()
{ {
QTC_ASSERT(m_state == Inactive, return); QTC_ASSERT(m_state == Inactive, return);
if (deviceConfiguration()->type() == LinuxDeviceConfiguration::Physical) { if (deviceConfiguration()->deviceType() == LinuxDeviceConfiguration::Hardware) {
handleDeviceSetupDone(true); handleDeviceSetupDone(true);
return; return;
} }

View File

@@ -38,6 +38,7 @@
#include "qt4maemotarget.h" #include "qt4maemotarget.h"
#include <qt4projectmanager/qt4nodes.h> #include <qt4projectmanager/qt4nodes.h>
#include <remotelinux/deployablefile.h>
#include <remotelinux/deployablefilesperprofile.h> #include <remotelinux/deployablefilesperprofile.h>
#include <remotelinux/deploymentinfo.h> #include <remotelinux/deploymentinfo.h>
#include <remotelinux/remotelinuxdeployconfigurationwidget.h> #include <remotelinux/remotelinuxdeployconfigurationwidget.h>

View File

@@ -69,7 +69,7 @@ QString defaultUser(const QString &osType)
QString defaultHost(LinuxDeviceConfiguration::DeviceType type) QString defaultHost(LinuxDeviceConfiguration::DeviceType type)
{ {
return QLatin1String(type == LinuxDeviceConfiguration::Physical ? "192.168.2.15" : "localhost"); return QLatin1String(type == LinuxDeviceConfiguration::Hardware ? "192.168.2.15" : "localhost");
} }
struct WizardData struct WizardData
@@ -152,7 +152,7 @@ public:
LinuxDeviceConfiguration::DeviceType deviceType() const LinuxDeviceConfiguration::DeviceType deviceType() const
{ {
return m_ui->hwButton->isChecked() return m_ui->hwButton->isChecked()
? LinuxDeviceConfiguration::Physical : LinuxDeviceConfiguration::Emulator; ? LinuxDeviceConfiguration::Hardware : LinuxDeviceConfiguration::Emulator;
} }
int sshPort() const int sshPort() const
@@ -164,7 +164,7 @@ public:
private slots: private slots:
void handleDeviceTypeChanged() void handleDeviceTypeChanged()
{ {
const bool enable = deviceType() == LinuxDeviceConfiguration::Physical; const bool enable = deviceType() == LinuxDeviceConfiguration::Hardware;
m_ui->hostNameLabel->setEnabled(enable); m_ui->hostNameLabel->setEnabled(enable);
m_ui->hostNameLineEdit->setEnabled(enable); m_ui->hostNameLineEdit->setEnabled(enable);
m_ui->sshPortLabel->setEnabled(enable); m_ui->sshPortLabel->setEnabled(enable);

View File

@@ -157,7 +157,7 @@ PortList MaemoGlobal::freePorts(const LinuxDeviceConfiguration::ConstPtr &devCon
{ {
if (!devConf || !qtVersion) if (!devConf || !qtVersion)
return PortList(); return PortList();
if (devConf->type() == LinuxDeviceConfiguration::Emulator) { if (devConf->deviceType() == LinuxDeviceConfiguration::Emulator) {
MaemoQemuRuntime rt; MaemoQemuRuntime rt;
const int id = qtVersion->uniqueId(); const int id = qtVersion->uniqueId();
if (MaemoQemuManager::instance().runtimeForQtVersion(id, &rt)) if (MaemoQemuManager::instance().runtimeForQtVersion(id, &rt))

View File

@@ -589,7 +589,7 @@ bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
if (qtVersion) if (qtVersion)
*qtVersion = version; *qtVersion = version;
const LinuxDeviceConfiguration::ConstPtr &config = mrc->deviceConfig(); const LinuxDeviceConfiguration::ConstPtr &config = mrc->deviceConfig();
return config && config->type() == LinuxDeviceConfiguration::Emulator; return config && config->deviceType() == LinuxDeviceConfiguration::Emulator;
} }
void MaemoQemuManager::notify(const QList<int> uniqueIds) void MaemoQemuManager::notify(const QList<int> uniqueIds)

View File

@@ -41,6 +41,8 @@
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <qt4projectmanager/qt4buildconfiguration.h> #include <qt4projectmanager/qt4buildconfiguration.h>
#include <remotelinux/portlist.h>
#include <utils/ssh/sshconnection.h>
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>

View File

@@ -28,7 +28,6 @@
** Nokia at info@qt.nokia.com. ** Nokia at info@qt.nokia.com.
** **
**************************************************************************/ **************************************************************************/
#include "maemorunfactories.h" #include "maemorunfactories.h"
#include "maemoconstants.h" #include "maemoconstants.h"
@@ -40,6 +39,7 @@
#include "qt4maemotarget.h" #include "qt4maemotarget.h"
#include <debugger/debuggerconstants.h> #include <debugger/debuggerconstants.h>
#include <debugger/debuggerstartparameters.h>
#include <debugger/debuggerplugin.h> #include <debugger/debuggerplugin.h>
#include <debugger/debuggerrunner.h> #include <debugger/debuggerrunner.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>

View File

@@ -28,7 +28,6 @@
** Nokia at info@qt.nokia.com. ** Nokia at info@qt.nokia.com.
** **
**************************************************************************/ **************************************************************************/
#include "maemosshrunner.h" #include "maemosshrunner.h"
#include "maemoqemumanager.h" #include "maemoqemumanager.h"
@@ -39,6 +38,7 @@
#include <qt4projectmanager/qt4buildconfiguration.h> #include <qt4projectmanager/qt4buildconfiguration.h>
#include <remotelinux/linuxdeviceconfiguration.h> #include <remotelinux/linuxdeviceconfiguration.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/ssh/sshconnection.h>
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
using namespace Utils; using namespace Utils;
@@ -47,7 +47,7 @@ namespace RemoteLinux {
namespace Internal { namespace Internal {
MaemoSshRunner::MaemoSshRunner(QObject *parent, MaemoRunConfiguration *runConfig) MaemoSshRunner::MaemoSshRunner(QObject *parent, MaemoRunConfiguration *runConfig)
: AbstractRemoteLinuxApplicationRunner(parent, runConfig), : AbstractRemoteLinuxApplicationRunner(runConfig, parent),
m_mounter(new MaemoRemoteMounter(this)), m_mounter(new MaemoRemoteMounter(this)),
m_mountSpecs(runConfig->remoteMounts()->mountSpecs()), m_mountSpecs(runConfig->remoteMounts()->mountSpecs()),
m_mountState(InactiveMountState) m_mountState(InactiveMountState)
@@ -72,7 +72,7 @@ bool MaemoSshRunner::canRun(QString &whyNot) const
if (!AbstractRemoteLinuxApplicationRunner::canRun(whyNot)) if (!AbstractRemoteLinuxApplicationRunner::canRun(whyNot))
return false; return false;
if (devConfig()->type() == LinuxDeviceConfiguration::Emulator if (devConfig()->deviceType() == LinuxDeviceConfiguration::Emulator
&& !MaemoQemuManager::instance().qemuIsRunning()) { && !MaemoQemuManager::instance().qemuIsRunning()) {
MaemoQemuRuntime rt; MaemoQemuRuntime rt;
if (MaemoQemuManager::instance().runtimeForQtVersion(m_qtId, &rt)) { if (MaemoQemuManager::instance().runtimeForQtVersion(m_qtId, &rt)) {

View File

@@ -31,11 +31,18 @@
**************************************************************************/ **************************************************************************/
#include "portlist.h" #include "portlist.h"
#include <QtCore/QList>
#include <QtCore/QPair>
#include <QtCore/QString>
#include <cctype> #include <cctype>
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
namespace { namespace {
typedef QPair<int, int> Range;
class PortsSpecParser class PortsSpecParser
{ {
struct ParseException { struct ParseException {
@@ -120,43 +127,65 @@ private:
} // anonymous namespace } // anonymous namespace
class PortListPrivate
{
public:
QList<Range> ranges;
};
} // namespace Internal
PortList::PortList() : m_d(new Internal::PortListPrivate)
{
}
PortList::PortList(const PortList &other) : m_d(new Internal::PortListPrivate(*other.m_d))
{
}
PortList &PortList::operator=(const PortList &other)
{
*m_d = *other.m_d;
return *this;
}
PortList PortList::fromString(const QString &portsSpec) PortList PortList::fromString(const QString &portsSpec)
{ {
return PortsSpecParser(portsSpec).parse(); return Internal::PortsSpecParser(portsSpec).parse();
} }
void PortList::addPort(int port) { addRange(port, port); } void PortList::addPort(int port) { addRange(port, port); }
void PortList::addRange(int startPort, int endPort) void PortList::addRange(int startPort, int endPort)
{ {
m_ranges << Range(startPort, endPort); m_d->ranges << Internal::Range(startPort, endPort);
} }
bool PortList::hasMore() const { return !m_ranges.isEmpty(); } bool PortList::hasMore() const { return !m_d->ranges.isEmpty(); }
int PortList::count() const int PortList::count() const
{ {
int n = 0; int n = 0;
foreach (const Range &r, m_ranges) foreach (const Internal::Range &r, m_d->ranges)
n += r.second - r.first + 1; n += r.second - r.first + 1;
return n; return n;
} }
int PortList::getNext() int PortList::getNext()
{ {
Q_ASSERT(!m_ranges.isEmpty()); Q_ASSERT(!m_d->ranges.isEmpty());
Range &firstRange = m_ranges.first();
Internal::Range &firstRange = m_d->ranges.first();
const int next = firstRange.first++; const int next = firstRange.first++;
if (firstRange.first > firstRange.second) if (firstRange.first > firstRange.second)
m_ranges.removeFirst(); m_d->ranges.removeFirst();
return next; return next;
} }
QString PortList::toString() const QString PortList::toString() const
{ {
QString stringRep; QString stringRep;
foreach (const Range &range, m_ranges) { foreach (const Internal::Range &range, m_d->ranges) {
stringRep += QString::number(range.first); stringRep += QString::number(range.first);
if (range.second != range.first) if (range.second != range.first)
stringRep += QLatin1Char('-') + QString::number(range.second); stringRep += QLatin1Char('-') + QString::number(range.second);

View File

@@ -34,14 +34,20 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <QtCore/QPair> QT_FORWARD_DECLARE_CLASS(QString)
#include <QtCore/QString>
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
class PortListPrivate;
} // namespace Internal
class REMOTELINUX_EXPORT PortList class REMOTELINUX_EXPORT PortList
{ {
public: public:
PortList();
PortList(const PortList &other);
PortList &operator=(const PortList &other);
void addPort(int port); void addPort(int port);
void addRange(int startPort, int endPort); void addRange(int startPort, int endPort);
bool hasMore() const; bool hasMore() const;
@@ -53,8 +59,7 @@ public:
static QString regularExpression(); static QString regularExpression();
private: private:
typedef QPair<int, int> Range; Internal::PortListPrivate * const m_d;
QList<Range> m_ranges;
}; };
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -33,6 +33,8 @@
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include "sshkeydeployer.h" #include "sshkeydeployer.h"
#include <utils/ssh/sshconnection.h>
#include <QtCore/QTimer> #include <QtCore/QTimer>
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>

View File

@@ -41,6 +41,7 @@
#include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsteplist.h>
#include <qt4projectmanager/qt4target.h> #include <qt4projectmanager/qt4target.h>
#include <remotelinux/deployablefile.h>
#include <remotelinux/deployablefilesperprofile.h> #include <remotelinux/deployablefilesperprofile.h>
#include <remotelinux/deploymentinfo.h> #include <remotelinux/deploymentinfo.h>
#include <remotelinux/deploymentsettingsassistant.h> #include <remotelinux/deploymentsettingsassistant.h>

View File

@@ -32,6 +32,7 @@
#include "remotelinuxapplicationrunner.h" #include "remotelinuxapplicationrunner.h"
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include "portlist.h"
#include "remotelinuxrunconfiguration.h" #include "remotelinuxrunconfiguration.h"
#include "remotelinuxusedportsgatherer.h" #include "remotelinuxusedportsgatherer.h"
@@ -93,8 +94,8 @@ public:
using namespace Internal; using namespace Internal;
AbstractRemoteLinuxApplicationRunner::AbstractRemoteLinuxApplicationRunner(QObject *parent, AbstractRemoteLinuxApplicationRunner::AbstractRemoteLinuxApplicationRunner(RemoteLinuxRunConfiguration *runConfig,
RemoteLinuxRunConfiguration *runConfig) QObject *parent)
: QObject(parent), m_d(new AbstractRemoteLinuxApplicationRunnerPrivate(runConfig)) : QObject(parent), m_d(new AbstractRemoteLinuxApplicationRunnerPrivate(runConfig))
{ {
connect(&m_d->portsGatherer, SIGNAL(error(QString)), SLOT(handlePortsGathererError(QString))); connect(&m_d->portsGatherer, SIGNAL(error(QString)), SLOT(handlePortsGathererError(QString)));
@@ -441,9 +442,9 @@ void AbstractRemoteLinuxApplicationRunner::handlePostRunCleanupDone()
const qint64 AbstractRemoteLinuxApplicationRunner::InvalidExitCode = std::numeric_limits<qint64>::min(); const qint64 AbstractRemoteLinuxApplicationRunner::InvalidExitCode = std::numeric_limits<qint64>::min();
GenericRemoteLinuxApplicationRunner::GenericRemoteLinuxApplicationRunner(QObject *parent, GenericRemoteLinuxApplicationRunner::GenericRemoteLinuxApplicationRunner(RemoteLinuxRunConfiguration *runConfig,
RemoteLinuxRunConfiguration *runConfig) QObject *parent)
: AbstractRemoteLinuxApplicationRunner(parent, runConfig) : AbstractRemoteLinuxApplicationRunner(runConfig, parent)
{ {
} }

View File

@@ -28,24 +28,21 @@
** Nokia at info@qt.nokia.com. ** Nokia at info@qt.nokia.com.
** **
**************************************************************************/ **************************************************************************/
#ifndef REMOTELINUXAPPLICATIONRUNNER_H #ifndef REMOTELINUXAPPLICATIONRUNNER_H
#define REMOTELINUXAPPLICATIONRUNNER_H #define REMOTELINUXAPPLICATIONRUNNER_H
#include "portlist.h"
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QSharedPointer> #include <QtCore/QSharedPointer>
#include <QtCore/QStringList>
namespace Utils { namespace Utils {
class SshConnection; class SshConnection;
class SshRemoteProcess;
} }
namespace RemoteLinux { namespace RemoteLinux {
class LinuxDeviceConfiguration; class LinuxDeviceConfiguration;
class PortList;
class RemoteLinuxRunConfiguration; class RemoteLinuxRunConfiguration;
class RemoteLinuxUsedPortsGatherer; class RemoteLinuxUsedPortsGatherer;
@@ -58,7 +55,8 @@ class REMOTELINUX_EXPORT AbstractRemoteLinuxApplicationRunner : public QObject
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(AbstractRemoteLinuxApplicationRunner) Q_DISABLE_COPY(AbstractRemoteLinuxApplicationRunner)
public: public:
AbstractRemoteLinuxApplicationRunner(QObject *parent, RemoteLinuxRunConfiguration *runConfig); AbstractRemoteLinuxApplicationRunner(RemoteLinuxRunConfiguration *runConfig,
QObject *parent = 0);
~AbstractRemoteLinuxApplicationRunner(); ~AbstractRemoteLinuxApplicationRunner();
void start(); void start();
@@ -135,7 +133,8 @@ class REMOTELINUX_EXPORT GenericRemoteLinuxApplicationRunner : public AbstractRe
{ {
Q_OBJECT Q_OBJECT
public: public:
GenericRemoteLinuxApplicationRunner(QObject *parent, RemoteLinuxRunConfiguration *runConfig); GenericRemoteLinuxApplicationRunner(RemoteLinuxRunConfiguration *runConfig,
QObject *parent = 0);
~GenericRemoteLinuxApplicationRunner(); ~GenericRemoteLinuxApplicationRunner();
protected: protected:

View File

@@ -28,14 +28,15 @@
** Nokia at info@qt.nokia.com. ** Nokia at info@qt.nokia.com.
** **
**************************************************************************/ **************************************************************************/
#include "remotelinuxdebugsupport.h" #include "remotelinuxdebugsupport.h"
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include "remotelinuxapplicationrunner.h" #include "remotelinuxapplicationrunner.h"
#include "remotelinuxrunconfiguration.h"
#include "remotelinuxusedportsgatherer.h" #include "remotelinuxusedportsgatherer.h"
#include <debugger/debuggerengine.h> #include <debugger/debuggerengine.h>
#include <debugger/debuggerstartparameters.h>
#include <projectexplorer/abi.h> #include <projectexplorer/abi.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
@@ -43,11 +44,51 @@
#include <qt4projectmanager/qt4buildconfiguration.h> #include <qt4projectmanager/qt4buildconfiguration.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QPointer>
#include <QtCore/QSharedPointer>
using namespace Utils; using namespace Utils;
using namespace Debugger; using namespace Debugger;
using namespace ProjectExplorer; using namespace ProjectExplorer;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
namespace {
enum State { Inactive, StartingRunner, StartingRemoteProcess, Debugging };
} // anonymous namespace
class AbstractRemoteLinuxDebugSupportPrivate
{
public:
AbstractRemoteLinuxDebugSupportPrivate(RemoteLinuxRunConfiguration *runConfig,
DebuggerEngine *engine)
: engine(engine), runConfig(runConfig), deviceConfig(runConfig->deviceConfig()),
debuggingType(runConfig->debuggingType()), state(Inactive),
gdbServerPort(-1), qmlPort(-1)
{
}
const QPointer<Debugger::DebuggerEngine> engine;
const QPointer<RemoteLinuxRunConfiguration> runConfig;
const LinuxDeviceConfiguration::ConstPtr deviceConfig;
const RemoteLinuxRunConfiguration::DebuggingType debuggingType;
QByteArray gdbserverOutput;
State state;
int gdbServerPort;
int qmlPort;
};
class RemoteLinuxDebugSupportPrivate
{
public:
RemoteLinuxDebugSupportPrivate(RemoteLinuxRunConfiguration *runConfig) : runner(runConfig) {}
GenericRemoteLinuxApplicationRunner runner;
};
} // namespace Internal
using namespace Internal; using namespace Internal;
DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const RemoteLinuxRunConfiguration *runConfig) DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const RemoteLinuxRunConfiguration *runConfig)
@@ -93,31 +134,30 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
return params; return params;
} }
AbstractRemoteLinuxDebugSupport::AbstractRemoteLinuxDebugSupport(RemoteLinuxRunConfiguration *runConfig, DebuggerEngine *engine) AbstractRemoteLinuxDebugSupport::AbstractRemoteLinuxDebugSupport(RemoteLinuxRunConfiguration *runConfig,
: QObject(engine), m_engine(engine), m_runConfig(runConfig), DebuggerEngine *engine)
m_deviceConfig(m_runConfig->deviceConfig()), : QObject(engine), m_d(new AbstractRemoteLinuxDebugSupportPrivate(runConfig, engine))
m_debuggingType(runConfig->debuggingType()),
m_state(Inactive), m_gdbServerPort(-1), m_qmlPort(-1)
{ {
connect(m_engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleAdapterSetupRequested())); connect(m_d->engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleAdapterSetupRequested()));
} }
AbstractRemoteLinuxDebugSupport::~AbstractRemoteLinuxDebugSupport() AbstractRemoteLinuxDebugSupport::~AbstractRemoteLinuxDebugSupport()
{ {
setState(Inactive); setFinished();
delete m_d;
} }
void AbstractRemoteLinuxDebugSupport::showMessage(const QString &msg, int channel) void AbstractRemoteLinuxDebugSupport::showMessage(const QString &msg, int channel)
{ {
if (m_engine) if (m_d->engine)
m_engine->showMessage(msg, channel); m_d->engine->showMessage(msg, channel);
} }
void AbstractRemoteLinuxDebugSupport::handleAdapterSetupRequested() void AbstractRemoteLinuxDebugSupport::handleAdapterSetupRequested()
{ {
QTC_ASSERT(m_state == Inactive, return); QTC_ASSERT(m_d->state == Inactive, return);
setState(StartingRunner); m_d->state = StartingRunner;
showMessage(tr("Preparing remote side ...\n"), AppStuff); showMessage(tr("Preparing remote side ...\n"), AppStuff);
disconnect(runner(), 0, this, 0); disconnect(runner(), 0, this, 0);
connect(runner(), SIGNAL(error(QString)), this, SLOT(handleSshError(QString))); connect(runner(), SIGNAL(error(QString)), this, SLOT(handleSshError(QString)));
@@ -128,52 +168,52 @@ void AbstractRemoteLinuxDebugSupport::handleAdapterSetupRequested()
void AbstractRemoteLinuxDebugSupport::handleSshError(const QString &error) void AbstractRemoteLinuxDebugSupport::handleSshError(const QString &error)
{ {
if (m_state == Debugging) { if (m_d->state == Debugging) {
showMessage(error, AppError); showMessage(error, AppError);
if (m_engine) if (m_d->engine)
m_engine->notifyInferiorIll(); m_d->engine->notifyInferiorIll();
} else if (m_state != Inactive) { } else if (m_d->state != Inactive) {
handleAdapterSetupFailed(error); handleAdapterSetupFailed(error);
} }
} }
void AbstractRemoteLinuxDebugSupport::startExecution() void AbstractRemoteLinuxDebugSupport::startExecution()
{ {
if (m_state == Inactive) if (m_d->state == Inactive)
return; return;
QTC_ASSERT(m_state == StartingRunner, return); QTC_ASSERT(m_d->state == StartingRunner, return);
if (m_debuggingType != RemoteLinuxRunConfiguration::DebugQmlOnly) { if (m_d->debuggingType != RemoteLinuxRunConfiguration::DebugQmlOnly) {
if (!setPort(m_gdbServerPort)) if (!setPort(m_d->gdbServerPort))
return; return;
} }
if (m_debuggingType != RemoteLinuxRunConfiguration::DebugCppOnly) { if (m_d->debuggingType != RemoteLinuxRunConfiguration::DebugCppOnly) {
if (!setPort(m_qmlPort)) if (!setPort(m_d->qmlPort))
return; return;
} }
setState(StartingRemoteProcess); m_d->state = StartingRemoteProcess;
m_gdbserverOutput.clear(); m_d->gdbserverOutput.clear();
connect(runner(), SIGNAL(remoteErrorOutput(QByteArray)), this, connect(runner(), SIGNAL(remoteErrorOutput(QByteArray)), this,
SLOT(handleRemoteErrorOutput(QByteArray))); SLOT(handleRemoteErrorOutput(QByteArray)));
connect(runner(), SIGNAL(remoteOutput(QByteArray)), this, connect(runner(), SIGNAL(remoteOutput(QByteArray)), this,
SLOT(handleRemoteOutput(QByteArray))); SLOT(handleRemoteOutput(QByteArray)));
if (m_debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly) { if (m_d->debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly) {
connect(runner(), SIGNAL(remoteProcessStarted()), connect(runner(), SIGNAL(remoteProcessStarted()),
SLOT(handleRemoteProcessStarted())); SLOT(handleRemoteProcessStarted()));
} }
const QString &remoteExe = runner()->remoteExecutable(); const QString &remoteExe = runner()->remoteExecutable();
QString args = runner()->arguments(); QString args = runner()->arguments();
if (m_debuggingType != RemoteLinuxRunConfiguration::DebugCppOnly) { if (m_d->debuggingType != RemoteLinuxRunConfiguration::DebugCppOnly) {
args += QString(QLatin1String(" -qmljsdebugger=port:%1,block")) args += QString(QLatin1String(" -qmljsdebugger=port:%1,block"))
.arg(m_qmlPort); .arg(m_d->qmlPort);
} }
const QString remoteCommandLine = m_debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly const QString remoteCommandLine = m_d->debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly
? QString::fromLocal8Bit("%1 %2 %3").arg(runner()->commandPrefix()).arg(remoteExe).arg(args) ? QString::fromLocal8Bit("%1 %2 %3").arg(runner()->commandPrefix()).arg(remoteExe).arg(args)
: QString::fromLocal8Bit("%1 gdbserver :%2 %3 %4").arg(runner()->commandPrefix()) : QString::fromLocal8Bit("%1 gdbserver :%2 %3 %4").arg(runner()->commandPrefix())
.arg(m_gdbServerPort).arg(remoteExe).arg(args); .arg(m_d->gdbServerPort).arg(remoteExe).arg(args);
connect(runner(), SIGNAL(remoteProcessFinished(qint64)), connect(runner(), SIGNAL(remoteProcessFinished(qint64)),
SLOT(handleRemoteProcessFinished(qint64))); SLOT(handleRemoteProcessFinished(qint64)));
runner()->startExecution(remoteCommandLine.toUtf8()); runner()->startExecution(remoteCommandLine.toUtf8());
@@ -181,51 +221,51 @@ void AbstractRemoteLinuxDebugSupport::startExecution()
void AbstractRemoteLinuxDebugSupport::handleRemoteProcessFinished(qint64 exitCode) void AbstractRemoteLinuxDebugSupport::handleRemoteProcessFinished(qint64 exitCode)
{ {
if (!m_engine || m_state == Inactive) if (!m_d->engine || m_d->state == Inactive)
return; return;
if (m_state == Debugging) { if (m_d->state == Debugging) {
// The QML engine does not realize on its own that the application has finished. // The QML engine does not realize on its own that the application has finished.
if (m_debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly) if (m_d->debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly)
m_engine->quitDebugger(); m_d->engine->quitDebugger();
else if (exitCode != 0) else if (exitCode != 0)
m_engine->notifyInferiorIll(); m_d->engine->notifyInferiorIll();
} else { } else {
const QString errorMsg = m_debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly const QString errorMsg = m_d->debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly
? tr("Remote application failed with exit code %1.").arg(exitCode) ? tr("Remote application failed with exit code %1.").arg(exitCode)
: tr("The gdbserver process closed unexpectedly."); : tr("The gdbserver process closed unexpectedly.");
m_engine->handleRemoteSetupFailed(errorMsg); m_d->engine->handleRemoteSetupFailed(errorMsg);
} }
} }
void AbstractRemoteLinuxDebugSupport::handleDebuggingFinished() void AbstractRemoteLinuxDebugSupport::handleDebuggingFinished()
{ {
setState(Inactive); setFinished();
} }
void AbstractRemoteLinuxDebugSupport::handleRemoteOutput(const QByteArray &output) void AbstractRemoteLinuxDebugSupport::handleRemoteOutput(const QByteArray &output)
{ {
QTC_ASSERT(m_state == Inactive || m_state == Debugging, return); QTC_ASSERT(m_d->state == Inactive || m_d->state == Debugging, return);
showMessage(QString::fromUtf8(output), AppOutput); showMessage(QString::fromUtf8(output), AppOutput);
} }
void AbstractRemoteLinuxDebugSupport::handleRemoteErrorOutput(const QByteArray &output) void AbstractRemoteLinuxDebugSupport::handleRemoteErrorOutput(const QByteArray &output)
{ {
QTC_ASSERT(m_state == Inactive || m_state == StartingRemoteProcess || m_state == Debugging, QTC_ASSERT(m_d->state == Inactive || m_d->state == StartingRemoteProcess || m_d->state == Debugging,
return); return);
if (!m_engine) if (!m_d->engine)
return; return;
showMessage(QString::fromUtf8(output), AppOutput); showMessage(QString::fromUtf8(output), AppOutput);
if (m_state == StartingRemoteProcess if (m_d->state == StartingRemoteProcess
&& m_debuggingType != RemoteLinuxRunConfiguration::DebugQmlOnly) { && m_d->debuggingType != RemoteLinuxRunConfiguration::DebugQmlOnly) {
m_gdbserverOutput += output; m_d->gdbserverOutput += output;
if (m_gdbserverOutput.contains("Listening on port")) { if (m_d->gdbserverOutput.contains("Listening on port")) {
handleAdapterSetupDone(); handleAdapterSetupDone();
m_gdbserverOutput.clear(); m_d->gdbserverOutput.clear();
} }
} }
} }
@@ -237,30 +277,29 @@ void AbstractRemoteLinuxDebugSupport::handleProgressReport(const QString &progre
void AbstractRemoteLinuxDebugSupport::handleAdapterSetupFailed(const QString &error) void AbstractRemoteLinuxDebugSupport::handleAdapterSetupFailed(const QString &error)
{ {
setState(Inactive); setFinished();
m_engine->handleRemoteSetupFailed(tr("Initial setup failed: %1").arg(error)); m_d->engine->handleRemoteSetupFailed(tr("Initial setup failed: %1").arg(error));
} }
void AbstractRemoteLinuxDebugSupport::handleAdapterSetupDone() void AbstractRemoteLinuxDebugSupport::handleAdapterSetupDone()
{ {
setState(Debugging); m_d->state = Debugging;
m_engine->handleRemoteSetupDone(m_gdbServerPort, m_qmlPort); m_d->engine->handleRemoteSetupDone(m_d->gdbServerPort, m_d->qmlPort);
} }
void AbstractRemoteLinuxDebugSupport::handleRemoteProcessStarted() void AbstractRemoteLinuxDebugSupport::handleRemoteProcessStarted()
{ {
Q_ASSERT(m_debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly); Q_ASSERT(m_d->debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly);
QTC_ASSERT(m_state == StartingRemoteProcess, return); QTC_ASSERT(m_d->state == StartingRemoteProcess, return);
handleAdapterSetupDone(); handleAdapterSetupDone();
} }
void AbstractRemoteLinuxDebugSupport::setState(State newState) void AbstractRemoteLinuxDebugSupport::setFinished()
{ {
if (m_state == newState) if (m_d->state == Inactive)
return; return;
m_state = newState; m_d->state = Inactive;
if (m_state == Inactive)
runner()->stop(); runner()->stop();
} }
@@ -278,12 +317,18 @@ bool AbstractRemoteLinuxDebugSupport::setPort(int &port)
RemoteLinuxDebugSupport::RemoteLinuxDebugSupport(RemoteLinuxRunConfiguration *runConfig, RemoteLinuxDebugSupport::RemoteLinuxDebugSupport(RemoteLinuxRunConfiguration *runConfig,
DebuggerEngine *engine) DebuggerEngine *engine)
: AbstractRemoteLinuxDebugSupport(runConfig, engine), : AbstractRemoteLinuxDebugSupport(runConfig, engine),
m_runner(new GenericRemoteLinuxApplicationRunner(this, runConfig)) m_d(new RemoteLinuxDebugSupportPrivate(runConfig))
{ {
} }
RemoteLinuxDebugSupport::~RemoteLinuxDebugSupport() RemoteLinuxDebugSupport::~RemoteLinuxDebugSupport()
{ {
delete m_d;
}
AbstractRemoteLinuxApplicationRunner *RemoteLinuxDebugSupport::runner() const
{
return &m_d->runner;
} }
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -33,16 +33,12 @@
#define REMOTELINUXDEBUGSUPPORT_H #define REMOTELINUXDEBUGSUPPORT_H
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include "remotelinuxrunconfiguration.h"
#include <debugger/debuggerstartparameters.h>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QPointer>
#include <QtCore/QSharedPointer>
namespace Debugger { namespace Debugger {
class DebuggerEngine; class DebuggerEngine;
class DebuggerStartParameters;
} }
namespace ProjectExplorer { class RunControl; } namespace ProjectExplorer { class RunControl; }
@@ -51,9 +47,15 @@ class LinuxDeviceConfiguration;
class RemoteLinuxRunConfiguration; class RemoteLinuxRunConfiguration;
class AbstractRemoteLinuxApplicationRunner; class AbstractRemoteLinuxApplicationRunner;
namespace Internal {
class AbstractRemoteLinuxDebugSupportPrivate;
class RemoteLinuxDebugSupportPrivate;
} // namespace Internal
class REMOTELINUX_EXPORT AbstractRemoteLinuxDebugSupport : public QObject class REMOTELINUX_EXPORT AbstractRemoteLinuxDebugSupport : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(AbstractRemoteLinuxDebugSupport)
public: public:
static Debugger::DebuggerStartParameters startParameters(const RemoteLinuxRunConfiguration *runConfig); static Debugger::DebuggerStartParameters startParameters(const RemoteLinuxRunConfiguration *runConfig);
@@ -72,25 +74,16 @@ private slots:
void handleRemoteProcessFinished(qint64 exitCode); void handleRemoteProcessFinished(qint64 exitCode);
private: private:
enum State { Inactive, StartingRunner, StartingRemoteProcess, Debugging };
virtual AbstractRemoteLinuxApplicationRunner *runner() const=0; virtual AbstractRemoteLinuxApplicationRunner *runner() const=0;
void handleAdapterSetupFailed(const QString &error); void handleAdapterSetupFailed(const QString &error);
void handleAdapterSetupDone(); void handleAdapterSetupDone();
void setState(State newState); void setFinished();
bool setPort(int &port); bool setPort(int &port);
void showMessage(const QString &msg, int channel); void showMessage(const QString &msg, int channel);
const QPointer<Debugger::DebuggerEngine> m_engine; Internal::AbstractRemoteLinuxDebugSupportPrivate * const m_d;
const QPointer<RemoteLinuxRunConfiguration> m_runConfig;
const QSharedPointer<const LinuxDeviceConfiguration> m_deviceConfig;
const RemoteLinuxRunConfiguration::DebuggingType m_debuggingType;
QByteArray m_gdbserverOutput;
State m_state;
int m_gdbServerPort;
int m_qmlPort;
}; };
@@ -102,9 +95,9 @@ public:
~RemoteLinuxDebugSupport(); ~RemoteLinuxDebugSupport();
private: private:
AbstractRemoteLinuxApplicationRunner *runner() const { return m_runner; } AbstractRemoteLinuxApplicationRunner *runner() const;
AbstractRemoteLinuxApplicationRunner * const m_runner; Internal::RemoteLinuxDebugSupportPrivate * const m_d;
}; };
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -53,6 +53,7 @@ class REMOTELINUX_EXPORT RemoteLinuxDeployConfiguration
: public ProjectExplorer::DeployConfiguration : public ProjectExplorer::DeployConfiguration
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(RemoteLinuxDeployConfiguration)
public: public:
RemoteLinuxDeployConfiguration(ProjectExplorer::Target *target, const QString &id, RemoteLinuxDeployConfiguration(ProjectExplorer::Target *target, const QString &id,
const QString &defaultDisplayName, const QString &supportedOsType); const QString &defaultDisplayName, const QString &supportedOsType);

View File

@@ -35,8 +35,6 @@
#include <projectexplorer/deployconfiguration.h> #include <projectexplorer/deployconfiguration.h>
#include <QtGui/QWidget>
namespace RemoteLinux { namespace RemoteLinux {
class DeployableFilesPerProFile; class DeployableFilesPerProFile;
class RemoteLinuxDeployConfiguration; class RemoteLinuxDeployConfiguration;

View File

@@ -38,7 +38,8 @@
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
RemoteLinuxEnvironmentReader::RemoteLinuxEnvironmentReader(QObject *parent, RemoteLinuxRunConfiguration *config) RemoteLinuxEnvironmentReader::RemoteLinuxEnvironmentReader(RemoteLinuxRunConfiguration *config,
QObject *parent)
: QObject(parent) : QObject(parent)
, m_stop(false) , m_stop(false)
, m_devConfig(config->deviceConfig()) , m_devConfig(config->deviceConfig())

View File

@@ -51,7 +51,7 @@ class RemoteLinuxEnvironmentReader : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
RemoteLinuxEnvironmentReader(QObject *parent, RemoteLinuxRunConfiguration *config); RemoteLinuxEnvironmentReader(RemoteLinuxRunConfiguration *config, QObject *parent = 0);
~RemoteLinuxEnvironmentReader(); ~RemoteLinuxEnvironmentReader();
void start(const QString &environmentSetupCommand); void start(const QString &environmentSetupCommand);

View File

@@ -35,7 +35,6 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QSharedPointer> #include <QtCore/QSharedPointer>
#include <QtCore/QString> #include <QtCore/QString>

View File

@@ -34,15 +34,13 @@
#include "deploymentinfo.h" #include "deploymentinfo.h"
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include "maemoqtversion.h" #include "portlist.h"
#include "maemotoolchain.h"
#include "qt4maemotarget.h"
#include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeployconfiguration.h"
#include "remotelinuxrunconfigurationwidget.h" #include "remotelinuxrunconfigurationwidget.h"
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <projectexplorer/toolchain.h>
#include <qtsupport/qtoutputformatter.h> #include <qtsupport/qtoutputformatter.h>
#include <qt4projectmanager/qt4buildconfiguration.h> #include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4nodes.h> #include <qt4projectmanager/qt4nodes.h>
@@ -50,9 +48,6 @@
#include <qt4projectmanager/qt4target.h> #include <qt4projectmanager/qt4target.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <QtCore/QStringBuilder>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;

View File

@@ -33,27 +33,20 @@
#ifndef REMOTELINUXRUNCONFIGURATION_H #ifndef REMOTELINUXRUNCONFIGURATION_H
#define REMOTELINUXRUNCONFIGURATION_H #define REMOTELINUXRUNCONFIGURATION_H
#include "portlist.h"
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <utils/environment.h>
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <utils/environment.h>
#include <QtCore/QDateTime>
#include <QtCore/QStringList>
QT_FORWARD_DECLARE_CLASS(QWidget)
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
class Qt4BuildConfiguration; class Qt4BuildConfiguration;
class Qt4Project;
class Qt4BaseTarget; class Qt4BaseTarget;
class Qt4ProFileNode; class Qt4ProFileNode;
} // namespace Qt4ProjectManager } // namespace Qt4ProjectManager
namespace RemoteLinux { namespace RemoteLinux {
class LinuxDeviceConfiguration; class LinuxDeviceConfiguration;
class PortList;
class RemoteLinuxRunConfigurationWidget; class RemoteLinuxRunConfigurationWidget;
class RemoteLinuxDeployConfiguration; class RemoteLinuxDeployConfiguration;
@@ -65,6 +58,7 @@ class RemoteLinuxRunConfigurationFactory;
class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public ProjectExplorer::RunConfiguration class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public ProjectExplorer::RunConfiguration
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(RemoteLinuxRunConfiguration)
friend class Internal::RemoteLinuxRunConfigurationFactory; friend class Internal::RemoteLinuxRunConfigurationFactory;
friend class RemoteLinuxRunConfigurationWidget; friend class RemoteLinuxRunConfigurationWidget;

View File

@@ -60,194 +60,214 @@
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
namespace { namespace {
const QString FetchEnvButtonText const QString FetchEnvButtonText
= QCoreApplication::translate("RemoteLinux::RemoteLinuxRunConfigurationWidget", = QCoreApplication::translate("RemoteLinux::RemoteLinuxRunConfigurationWidget",
"Fetch Device Environment"); "Fetch Device Environment");
} // anonymous namespace } // anonymous namespace
class RemoteLinuxRunConfigurationWidgetPrivate
{
public:
RemoteLinuxRunConfigurationWidgetPrivate(RemoteLinuxRunConfiguration *runConfig)
: runConfiguration(runConfig), deviceEnvReader(runConfiguration), ignoreChange(false)
{
}
RemoteLinuxRunConfiguration * const runConfiguration;
RemoteLinuxEnvironmentReader deviceEnvReader;
bool ignoreChange;
QWidget topWidget;
QLabel disabledIcon;
QLabel disabledReason;
QLineEdit argsLineEdit;
QLabel localExecutableLabel;
QLabel remoteExecutableLabel;
QLabel devConfLabel;
QLabel debuggingLanguagesLabel;
QRadioButton debugCppOnlyButton;
QRadioButton debugQmlOnlyButton;
QRadioButton debugCppAndQmlButton;
QPushButton fetchEnvButton;
QComboBox baseEnvironmentComboBox;
ProjectExplorer::EnvironmentWidget *environmentWidget;
};
} // namespace Internal
using namespace Internal; using namespace Internal;
RemoteLinuxRunConfigurationWidget::RemoteLinuxRunConfigurationWidget(RemoteLinuxRunConfiguration *runConfiguration, RemoteLinuxRunConfigurationWidget::RemoteLinuxRunConfigurationWidget(RemoteLinuxRunConfiguration *runConfiguration,
QWidget *parent) QWidget *parent)
: QWidget(parent), : QWidget(parent), m_d(new RemoteLinuxRunConfigurationWidgetPrivate(runConfiguration))
m_runConfiguration(runConfiguration),
m_ignoreChange(false),
m_deviceEnvReader(new RemoteLinuxEnvironmentReader(this, runConfiguration))
{ {
QVBoxLayout *topLayout = new QVBoxLayout(this); QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setMargin(0); topLayout->setMargin(0);
addDisabledLabel(topLayout); addDisabledLabel(topLayout);
topWidget = new QWidget; topLayout->addWidget(&m_d->topWidget);
topLayout->addWidget(topWidget); QVBoxLayout *mainLayout = new QVBoxLayout(&m_d->topWidget);
QVBoxLayout *mainLayout = new QVBoxLayout(topWidget);
mainLayout->setMargin(0); mainLayout->setMargin(0);
addGenericWidgets(mainLayout); addGenericWidgets(mainLayout);
addEnvironmentWidgets(mainLayout); addEnvironmentWidgets(mainLayout);
connect(m_runConfiguration,
SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
this, SLOT(handleCurrentDeviceConfigChanged()));
handleCurrentDeviceConfigChanged();
connect(m_runConfiguration, SIGNAL(isEnabledChanged(bool)), connect(m_d->runConfiguration, SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
this, SLOT(runConfigurationEnabledChange(bool))); SLOT(handleCurrentDeviceConfigChanged()));
runConfigurationEnabledChange(m_runConfiguration->isEnabled()); handleCurrentDeviceConfigChanged();
connect(m_d->runConfiguration, SIGNAL(isEnabledChanged(bool)),
SLOT(runConfigurationEnabledChange(bool)));
runConfigurationEnabledChange(m_d->runConfiguration->isEnabled());
}
RemoteLinuxRunConfigurationWidget::~RemoteLinuxRunConfigurationWidget()
{
delete m_d;
} }
void RemoteLinuxRunConfigurationWidget::addDisabledLabel(QVBoxLayout *topLayout) void RemoteLinuxRunConfigurationWidget::addDisabledLabel(QVBoxLayout *topLayout)
{ {
QHBoxLayout *hl = new QHBoxLayout; QHBoxLayout * const hl = new QHBoxLayout;
hl->addStretch(); hl->addStretch();
m_disabledIcon = new QLabel(this); m_d->disabledIcon.setPixmap(QPixmap(QString::fromUtf8(":/projectexplorer/images/compile_warning.png")));
m_disabledIcon->setPixmap(QPixmap(QString::fromUtf8(":/projectexplorer/images/compile_warning.png"))); hl->addWidget(&m_d->disabledIcon);
hl->addWidget(m_disabledIcon); m_d->disabledReason.setVisible(false);
m_disabledReason = new QLabel(this); hl->addWidget(&m_d->disabledReason);
m_disabledReason->setVisible(false);
hl->addWidget(m_disabledReason);
hl->addStretch(); hl->addStretch();
topLayout->addLayout(hl); topLayout->addLayout(hl);
} }
void RemoteLinuxRunConfigurationWidget::suppressQmlDebuggingOptions() void RemoteLinuxRunConfigurationWidget::suppressQmlDebuggingOptions()
{ {
m_debuggingLanguagesLabel->hide(); m_d->debuggingLanguagesLabel.hide();
m_debugCppOnlyButton->hide(); m_d->debugCppOnlyButton.hide();
m_debugQmlOnlyButton->hide(); m_d->debugQmlOnlyButton.hide();
m_debugCppAndQmlButton->hide(); m_d->debugCppAndQmlButton.hide();
} }
void RemoteLinuxRunConfigurationWidget::runConfigurationEnabledChange(bool enabled) void RemoteLinuxRunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
{ topWidget->setEnabled(enabled); {
m_disabledIcon->setVisible(!enabled); m_d->topWidget.setEnabled(enabled);
m_disabledReason->setVisible(!enabled); m_d->disabledIcon.setVisible(!enabled);
m_disabledReason->setText(m_runConfiguration->disabledReason()); m_d->disabledReason.setVisible(!enabled);
m_d->disabledReason.setText(m_d->runConfiguration->disabledReason());
} }
void RemoteLinuxRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout) void RemoteLinuxRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
{ {
QFormLayout *formLayout = new QFormLayout; QFormLayout * const formLayout = new QFormLayout;
mainLayout->addLayout(formLayout); mainLayout->addLayout(formLayout);
formLayout->setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter); formLayout->setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter);
QWidget *devConfWidget = new QWidget; QWidget * const devConfWidget = new QWidget;
QHBoxLayout *devConfLayout = new QHBoxLayout(devConfWidget); QHBoxLayout * const devConfLayout = new QHBoxLayout(devConfWidget);
m_devConfLabel = new QLabel;
devConfLayout->setMargin(0); devConfLayout->setMargin(0);
devConfLayout->addWidget(m_devConfLabel); devConfLayout->addWidget(&m_d->devConfLabel);
QLabel *addDevConfLabel= new QLabel(tr("<a href=\"%1\">Manage device configurations</a>") QLabel * const addDevConfLabel= new QLabel(tr("<a href=\"%1\">Manage device configurations</a>")
.arg(QLatin1String("deviceconfig"))); .arg(QLatin1String("deviceconfig")));
addDevConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); addDevConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
devConfLayout->addWidget(addDevConfLabel); devConfLayout->addWidget(addDevConfLabel);
QLabel *debuggerConfLabel = new QLabel(tr("<a href=\"%1\">Set Debugger</a>") QLabel * const debuggerConfLabel = new QLabel(tr("<a href=\"%1\">Set Debugger</a>")
.arg(QLatin1String("debugger"))); .arg(QLatin1String("debugger")));
debuggerConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); debuggerConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
devConfLayout->addWidget(debuggerConfLabel); devConfLayout->addWidget(debuggerConfLabel);
formLayout->addRow(new QLabel(tr("Device configuration:")), devConfWidget); formLayout->addRow(new QLabel(tr("Device configuration:")), devConfWidget);
m_localExecutableLabel m_d->localExecutableLabel.setText(m_d->runConfiguration->localExecutableFilePath());
= new QLabel(m_runConfiguration->localExecutableFilePath()); formLayout->addRow(tr("Executable on host:"), &m_d->localExecutableLabel);
formLayout->addRow(tr("Executable on host:"), m_localExecutableLabel); formLayout->addRow(tr("Executable on device:"), &m_d->remoteExecutableLabel);
m_remoteExecutableLabel = new QLabel; m_d->argsLineEdit.setText(m_d->runConfiguration->arguments());
formLayout->addRow(tr("Executable on device:"), m_remoteExecutableLabel); formLayout->addRow(tr("Arguments:"), &m_d->argsLineEdit);
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments());
formLayout->addRow(tr("Arguments:"), m_argsLineEdit);
QHBoxLayout * const debugButtonsLayout = new QHBoxLayout; QHBoxLayout * const debugButtonsLayout = new QHBoxLayout;
m_debugCppOnlyButton = new QRadioButton(tr("C++ only")); m_d->debugCppOnlyButton.setText(tr("C++ only"));
m_debugQmlOnlyButton = new QRadioButton(tr("QML only")); m_d->debugQmlOnlyButton.setText(tr("QML only"));
m_debugCppAndQmlButton = new QRadioButton(tr("C++ and QML")); m_d->debugCppAndQmlButton.setText(tr("C++ and QML"));
m_debuggingLanguagesLabel = new QLabel(tr("Debugging type:")); m_d->debuggingLanguagesLabel.setText(tr("Debugging type:"));
QButtonGroup * const buttonGroup = new QButtonGroup; QButtonGroup * const buttonGroup = new QButtonGroup;
buttonGroup->addButton(m_debugCppOnlyButton); buttonGroup->addButton(&m_d->debugCppOnlyButton);
buttonGroup->addButton(m_debugQmlOnlyButton); buttonGroup->addButton(&m_d->debugQmlOnlyButton);
buttonGroup->addButton(m_debugCppAndQmlButton); buttonGroup->addButton(&m_d->debugCppAndQmlButton);
debugButtonsLayout->addWidget(m_debugCppOnlyButton); debugButtonsLayout->addWidget(&m_d->debugCppOnlyButton);
debugButtonsLayout->addWidget(m_debugQmlOnlyButton); debugButtonsLayout->addWidget(&m_d->debugQmlOnlyButton);
debugButtonsLayout->addWidget(m_debugCppAndQmlButton); debugButtonsLayout->addWidget(&m_d->debugCppAndQmlButton);
debugButtonsLayout->addStretch(1); debugButtonsLayout->addStretch(1);
formLayout->addRow(m_debuggingLanguagesLabel, debugButtonsLayout); formLayout->addRow(&m_d->debuggingLanguagesLabel, debugButtonsLayout);
if (m_runConfiguration->useCppDebugger()) { if (m_d->runConfiguration->useCppDebugger()) {
if (m_runConfiguration->useQmlDebugger()) if (m_d->runConfiguration->useQmlDebugger())
m_debugCppAndQmlButton->setChecked(true); m_d->debugCppAndQmlButton.setChecked(true);
else else
m_debugCppOnlyButton->setChecked(true); m_d->debugCppOnlyButton.setChecked(true);
} else { } else {
m_debugQmlOnlyButton->setChecked(true); m_d->debugQmlOnlyButton.setChecked(true);
} }
connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this, connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this,
SLOT(showDeviceConfigurationsDialog(QString))); SLOT(showDeviceConfigurationsDialog(QString)));
connect(debuggerConfLabel, SIGNAL(linkActivated(QString)), this, connect(debuggerConfLabel, SIGNAL(linkActivated(QString)), this,
SLOT(showDeviceConfigurationsDialog(QString))); SLOT(showDeviceConfigurationsDialog(QString)));
connect(m_argsLineEdit, SIGNAL(textEdited(QString)), this, connect(&m_d->argsLineEdit, SIGNAL(textEdited(QString)), SLOT(argumentsEdited(QString)));
SLOT(argumentsEdited(QString))); connect(&m_d->debugCppOnlyButton, SIGNAL(toggled(bool)), SLOT(handleDebuggingTypeChanged()));
connect(m_debugCppOnlyButton, SIGNAL(toggled(bool)), this, connect(&m_d->debugQmlOnlyButton, SIGNAL(toggled(bool)), SLOT(handleDebuggingTypeChanged()));
SLOT(handleDebuggingTypeChanged())); connect(&m_d->debugCppAndQmlButton, SIGNAL(toggled(bool)), SLOT(handleDebuggingTypeChanged()));
connect(m_debugQmlOnlyButton, SIGNAL(toggled(bool)), this, connect(m_d->runConfiguration, SIGNAL(targetInformationChanged()), this,
SLOT(handleDebuggingTypeChanged()));
connect(m_debugCppAndQmlButton, SIGNAL(toggled(bool)), this,
SLOT(handleDebuggingTypeChanged()));
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
SLOT(updateTargetInformation())); SLOT(updateTargetInformation()));
connect(m_runConfiguration, SIGNAL(deploySpecsChanged()), SLOT(handleDeploySpecsChanged())); connect(m_d->runConfiguration, SIGNAL(deploySpecsChanged()), SLOT(handleDeploySpecsChanged()));
handleDeploySpecsChanged(); handleDeploySpecsChanged();
} }
void RemoteLinuxRunConfigurationWidget::addEnvironmentWidgets(QVBoxLayout *mainLayout) void RemoteLinuxRunConfigurationWidget::addEnvironmentWidgets(QVBoxLayout *mainLayout)
{ {
QWidget *baseEnvironmentWidget = new QWidget; QWidget * const baseEnvironmentWidget = new QWidget;
QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget); QHBoxLayout * const baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget);
baseEnvironmentLayout->setMargin(0); baseEnvironmentLayout->setMargin(0);
QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this); QLabel * const label = new QLabel(tr("Base environment for this run configuration:"), this);
baseEnvironmentLayout->addWidget(label); baseEnvironmentLayout->addWidget(label);
m_baseEnvironmentComboBox = new QComboBox(this); m_d->baseEnvironmentComboBox.addItems(QStringList() << tr("Clean Environment")
m_baseEnvironmentComboBox->addItems(QStringList() << tr("Clean Environment")
<< tr("System Environment")); << tr("System Environment"));
m_baseEnvironmentComboBox->setCurrentIndex(m_runConfiguration->baseEnvironmentType()); m_d->baseEnvironmentComboBox.setCurrentIndex(m_d->runConfiguration->baseEnvironmentType());
baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox); baseEnvironmentLayout->addWidget(&m_d->baseEnvironmentComboBox);
m_fetchEnv = new QPushButton(FetchEnvButtonText); m_d->fetchEnvButton.setText(FetchEnvButtonText);
baseEnvironmentLayout->addWidget(m_fetchEnv); baseEnvironmentLayout->addWidget(&m_d->fetchEnvButton);
baseEnvironmentLayout->addStretch(10); baseEnvironmentLayout->addStretch(10);
m_environmentWidget = new ProjectExplorer::EnvironmentWidget(this, baseEnvironmentWidget); m_d->environmentWidget = new ProjectExplorer::EnvironmentWidget(this, baseEnvironmentWidget);
m_environmentWidget->setBaseEnvironment(m_deviceEnvReader->deviceEnvironment()); m_d->environmentWidget->setBaseEnvironment(m_d->deviceEnvReader.deviceEnvironment());
m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText()); m_d->environmentWidget->setBaseEnvironmentText(m_d->runConfiguration->baseEnvironmentText());
m_environmentWidget->setUserChanges(m_runConfiguration->userEnvironmentChanges()); m_d->environmentWidget->setUserChanges(m_d->runConfiguration->userEnvironmentChanges());
mainLayout->addWidget(m_environmentWidget); mainLayout->addWidget(m_d->environmentWidget);
connect(m_environmentWidget, SIGNAL(userChangesChanged()), this, connect(m_d->environmentWidget, SIGNAL(userChangesChanged()), SLOT(userChangesEdited()));
SLOT(userChangesEdited())); connect(&m_d->baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)),
connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(baseEnvironmentSelected(int))); this, SLOT(baseEnvironmentSelected(int)));
connect(m_runConfiguration, SIGNAL(baseEnvironmentChanged()), connect(m_d->runConfiguration, SIGNAL(baseEnvironmentChanged()),
this, SLOT(baseEnvironmentChanged())); this, SLOT(baseEnvironmentChanged()));
connect(m_runConfiguration, SIGNAL(systemEnvironmentChanged()), connect(m_d->runConfiguration, SIGNAL(systemEnvironmentChanged()),
this, SLOT(systemEnvironmentChanged())); this, SLOT(systemEnvironmentChanged()));
connect(m_runConfiguration, connect(m_d->runConfiguration,
SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)), SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)),
this, SLOT(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>))); SLOT(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)));
connect(m_fetchEnv, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); connect(&m_d->fetchEnvButton, SIGNAL(clicked()), this, SLOT(fetchEnvironment()));
connect(m_deviceEnvReader, SIGNAL(finished()), this, SLOT(fetchEnvironmentFinished())); connect(&m_d->deviceEnvReader, SIGNAL(finished()), this, SLOT(fetchEnvironmentFinished()));
connect(m_deviceEnvReader, SIGNAL(error(QString)), this, connect(&m_d->deviceEnvReader, SIGNAL(error(QString)), SLOT(fetchEnvironmentError(QString)));
SLOT(fetchEnvironmentError(QString)));
} }
void RemoteLinuxRunConfigurationWidget::argumentsEdited(const QString &text) void RemoteLinuxRunConfigurationWidget::argumentsEdited(const QString &text)
{ {
m_runConfiguration->setArguments(text); m_d->runConfiguration->setArguments(text);
} }
void RemoteLinuxRunConfigurationWidget::updateTargetInformation() void RemoteLinuxRunConfigurationWidget::updateTargetInformation()
{ {
m_localExecutableLabel m_d->localExecutableLabel
->setText(QDir::toNativeSeparators(m_runConfiguration->localExecutableFilePath())); .setText(QDir::toNativeSeparators(m_d->runConfiguration->localExecutableFilePath()));
} }
void RemoteLinuxRunConfigurationWidget::handleDeploySpecsChanged() void RemoteLinuxRunConfigurationWidget::handleDeploySpecsChanged()
{ {
m_remoteExecutableLabel->setText(m_runConfiguration->remoteExecutableFilePath()); m_d->remoteExecutableLabel.setText(m_d->runConfiguration->remoteExecutableFilePath());
} }
void RemoteLinuxRunConfigurationWidget::showDeviceConfigurationsDialog(const QString &link) void RemoteLinuxRunConfigurationWidget::showDeviceConfigurationsDialog(const QString &link)
@@ -263,83 +283,81 @@ void RemoteLinuxRunConfigurationWidget::showDeviceConfigurationsDialog(const QSt
void RemoteLinuxRunConfigurationWidget::handleCurrentDeviceConfigChanged() void RemoteLinuxRunConfigurationWidget::handleCurrentDeviceConfigChanged()
{ {
m_devConfLabel->setText(RemoteLinuxUtils::deviceConfigurationName(m_runConfiguration->deviceConfig())); m_d->devConfLabel.setText(RemoteLinuxUtils::deviceConfigurationName(m_d->runConfiguration->deviceConfig()));
} }
void RemoteLinuxRunConfigurationWidget::fetchEnvironment() void RemoteLinuxRunConfigurationWidget::fetchEnvironment()
{ {
disconnect(m_fetchEnv, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); disconnect(&m_d->fetchEnvButton, SIGNAL(clicked()), this, SLOT(fetchEnvironment()));
connect(m_fetchEnv, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment())); connect(&m_d->fetchEnvButton, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment()));
m_fetchEnv->setText(tr("Cancel Fetch Operation")); m_d->fetchEnvButton.setText(tr("Cancel Fetch Operation"));
m_deviceEnvReader->start(m_runConfiguration->environmentPreparationCommand()); m_d->deviceEnvReader.start(m_d->runConfiguration->environmentPreparationCommand());
} }
void RemoteLinuxRunConfigurationWidget::stopFetchEnvironment() void RemoteLinuxRunConfigurationWidget::stopFetchEnvironment()
{ {
m_deviceEnvReader->stop(); m_d->deviceEnvReader.stop();
fetchEnvironmentFinished(); fetchEnvironmentFinished();
} }
void RemoteLinuxRunConfigurationWidget::fetchEnvironmentFinished() void RemoteLinuxRunConfigurationWidget::fetchEnvironmentFinished()
{ {
disconnect(m_fetchEnv, SIGNAL(clicked()), this, disconnect(&m_d->fetchEnvButton, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment()));
SLOT(stopFetchEnvironment())); connect(&m_d->fetchEnvButton, SIGNAL(clicked()), this, SLOT(fetchEnvironment()));
connect(m_fetchEnv, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); m_d->fetchEnvButton.setText(FetchEnvButtonText);
m_fetchEnv->setText(FetchEnvButtonText); m_d->runConfiguration->setSystemEnvironment(m_d->deviceEnvReader.deviceEnvironment());
m_runConfiguration->setSystemEnvironment(m_deviceEnvReader->deviceEnvironment());
} }
void RemoteLinuxRunConfigurationWidget::fetchEnvironmentError(const QString &error) void RemoteLinuxRunConfigurationWidget::fetchEnvironmentError(const QString &error)
{ {
QMessageBox::warning(this, tr("Device error"), QMessageBox::warning(this, tr("Device Error"),
tr("Fetching environment failed: %1").arg(error)); tr("Fetching environment failed: %1").arg(error));
} }
void RemoteLinuxRunConfigurationWidget::userChangesEdited() void RemoteLinuxRunConfigurationWidget::userChangesEdited()
{ {
m_ignoreChange = true; m_d->ignoreChange = true;
m_runConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges()); m_d->runConfiguration->setUserEnvironmentChanges(m_d->environmentWidget->userChanges());
m_ignoreChange = false; m_d->ignoreChange = false;
} }
void RemoteLinuxRunConfigurationWidget::baseEnvironmentSelected(int index) void RemoteLinuxRunConfigurationWidget::baseEnvironmentSelected(int index)
{ {
m_ignoreChange = true; m_d->ignoreChange = true;
m_runConfiguration->setBaseEnvironmentType(RemoteLinuxRunConfiguration::BaseEnvironmentType(index)); m_d->runConfiguration->setBaseEnvironmentType(RemoteLinuxRunConfiguration::BaseEnvironmentType(index));
m_d->environmentWidget->setBaseEnvironment(m_d->runConfiguration->baseEnvironment());
m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment()); m_d->environmentWidget->setBaseEnvironmentText(m_d->runConfiguration->baseEnvironmentText());
m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText()); m_d->ignoreChange = false;
m_ignoreChange = false;
} }
void RemoteLinuxRunConfigurationWidget::baseEnvironmentChanged() void RemoteLinuxRunConfigurationWidget::baseEnvironmentChanged()
{ {
if (m_ignoreChange) if (m_d->ignoreChange)
return; return;
m_baseEnvironmentComboBox->setCurrentIndex(m_runConfiguration->baseEnvironmentType()); m_d->baseEnvironmentComboBox.setCurrentIndex(m_d->runConfiguration->baseEnvironmentType());
m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment()); m_d->environmentWidget->setBaseEnvironment(m_d->runConfiguration->baseEnvironment());
m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText()); m_d->environmentWidget->setBaseEnvironmentText(m_d->runConfiguration->baseEnvironmentText());
} }
void RemoteLinuxRunConfigurationWidget::systemEnvironmentChanged() void RemoteLinuxRunConfigurationWidget::systemEnvironmentChanged()
{ {
m_environmentWidget->setBaseEnvironment(m_runConfiguration->systemEnvironment()); m_d->environmentWidget->setBaseEnvironment(m_d->runConfiguration->systemEnvironment());
} }
void RemoteLinuxRunConfigurationWidget::userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges) void RemoteLinuxRunConfigurationWidget::userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges)
{ {
if (m_ignoreChange) if (m_d->ignoreChange)
return; return;
m_environmentWidget->setUserChanges(userChanges); m_d->environmentWidget->setUserChanges(userChanges);
} }
void RemoteLinuxRunConfigurationWidget::handleDebuggingTypeChanged() void RemoteLinuxRunConfigurationWidget::handleDebuggingTypeChanged()
{ {
m_runConfiguration->setUseCppDebugger(m_debugCppOnlyButton->isChecked() m_d->runConfiguration->setUseCppDebugger(m_d->debugCppOnlyButton.isChecked()
|| m_debugCppAndQmlButton->isChecked()); || m_d->debugCppAndQmlButton.isChecked());
m_runConfiguration->setUseQmlDebugger(m_debugQmlOnlyButton->isChecked() m_d->runConfiguration->setUseQmlDebugger(m_d->debugQmlOnlyButton.isChecked()
|| m_debugCppAndQmlButton->isChecked()); || m_d->debugCppAndQmlButton.isChecked());
} }
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -37,22 +37,17 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QComboBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QRadioButton;
class QVBoxLayout; class QVBoxLayout;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace ProjectExplorer { class EnvironmentWidget; }
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
namespace Utils { class EnvironmentItem; } namespace Utils { class EnvironmentItem; }
namespace RemoteLinux { namespace RemoteLinux {
class RemoteLinuxRunConfiguration; class RemoteLinuxRunConfiguration;
namespace Internal { class RemoteLinuxEnvironmentReader; } namespace Internal {
class RemoteLinuxRunConfigurationWidgetPrivate;
} // namespace Internal
class REMOTELINUX_EXPORT RemoteLinuxRunConfigurationWidget : public QWidget class REMOTELINUX_EXPORT RemoteLinuxRunConfigurationWidget : public QWidget
{ {
@@ -60,6 +55,7 @@ class REMOTELINUX_EXPORT RemoteLinuxRunConfigurationWidget : public QWidget
public: public:
explicit RemoteLinuxRunConfigurationWidget(RemoteLinuxRunConfiguration *runConfiguration, explicit RemoteLinuxRunConfigurationWidget(RemoteLinuxRunConfiguration *runConfiguration,
QWidget *parent = 0); QWidget *parent = 0);
~RemoteLinuxRunConfigurationWidget();
void addDisabledLabel(QVBoxLayout *topLayout); void addDisabledLabel(QVBoxLayout *topLayout);
void suppressQmlDebuggingOptions(); void suppressQmlDebuggingOptions();
@@ -86,24 +82,7 @@ private:
void addGenericWidgets(QVBoxLayout *mainLayout); void addGenericWidgets(QVBoxLayout *mainLayout);
void addEnvironmentWidgets(QVBoxLayout *mainLayout); void addEnvironmentWidgets(QVBoxLayout *mainLayout);
RemoteLinuxRunConfiguration *m_runConfiguration; Internal::RemoteLinuxRunConfigurationWidgetPrivate * const m_d;
QWidget *topWidget;
QLabel *m_disabledIcon;
QLabel *m_disabledReason;
QLineEdit *m_argsLineEdit;
QLabel *m_localExecutableLabel;
QLabel *m_remoteExecutableLabel;
QLabel *m_devConfLabel;
QLabel *m_debuggingLanguagesLabel;
QRadioButton *m_debugCppOnlyButton;
QRadioButton *m_debugQmlOnlyButton;
QRadioButton *m_debugCppAndQmlButton;
bool m_ignoreChange;
QPushButton *m_fetchEnv;
QComboBox *m_baseEnvironmentComboBox;
Internal::RemoteLinuxEnvironmentReader *m_deviceEnvReader;
ProjectExplorer::EnvironmentWidget *m_environmentWidget;
}; };
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -37,6 +37,7 @@
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QString>
#include <QtGui/QMessageBox> #include <QtGui/QMessageBox>
using namespace ProjectExplorer; using namespace ProjectExplorer;
@@ -147,7 +148,7 @@ void AbstractRemoteLinuxRunControl::setFinished()
RemoteLinuxRunControl::RemoteLinuxRunControl(ProjectExplorer::RunConfiguration *runConfig) RemoteLinuxRunControl::RemoteLinuxRunControl(ProjectExplorer::RunConfiguration *runConfig)
: AbstractRemoteLinuxRunControl(runConfig), : AbstractRemoteLinuxRunControl(runConfig),
m_runner(new GenericRemoteLinuxApplicationRunner(this, qobject_cast<RemoteLinuxRunConfiguration *>(runConfig))) m_runner(new GenericRemoteLinuxApplicationRunner(qobject_cast<RemoteLinuxRunConfiguration *>(runConfig), this))
{ {
} }

View File

@@ -36,7 +36,7 @@
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <QtCore/QString> QT_FORWARD_DECLARE_CLASS(QString)
namespace RemoteLinux { namespace RemoteLinux {
class AbstractRemoteLinuxApplicationRunner; class AbstractRemoteLinuxApplicationRunner;
@@ -44,6 +44,7 @@ class AbstractRemoteLinuxApplicationRunner;
class REMOTELINUX_EXPORT AbstractRemoteLinuxRunControl : public ProjectExplorer::RunControl class REMOTELINUX_EXPORT AbstractRemoteLinuxRunControl : public ProjectExplorer::RunControl
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(AbstractRemoteLinuxRunControl)
public: public:
explicit AbstractRemoteLinuxRunControl(ProjectExplorer::RunConfiguration *runConfig); explicit AbstractRemoteLinuxRunControl(ProjectExplorer::RunConfiguration *runConfig);
virtual ~AbstractRemoteLinuxRunControl(); virtual ~AbstractRemoteLinuxRunControl();
@@ -65,7 +66,6 @@ private slots:
void handleProgressReport(const QString &progressString); void handleProgressReport(const QString &progressString);
private: private:
void setFinished(); void setFinished();
void handleError(const QString &errString); void handleError(const QString &errString);

View File

@@ -31,6 +31,7 @@
#include "remotelinuxruncontrolfactory.h" #include "remotelinuxruncontrolfactory.h"
#include "portlist.h"
#include "remotelinuxdebugsupport.h" #include "remotelinuxdebugsupport.h"
#include "remotelinuxrunconfiguration.h" #include "remotelinuxrunconfiguration.h"
#include "remotelinuxruncontrol.h" #include "remotelinuxruncontrol.h"
@@ -38,6 +39,7 @@
#include <debugger/debuggerconstants.h> #include <debugger/debuggerconstants.h>
#include <debugger/debuggerplugin.h> #include <debugger/debuggerplugin.h>
#include <debugger/debuggerrunner.h> #include <debugger/debuggerrunner.h>
#include <debugger/debuggerstartparameters.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
using namespace Debugger; using namespace Debugger;

View File

@@ -31,6 +31,7 @@
#include "remotelinuxusedportsgatherer.h" #include "remotelinuxusedportsgatherer.h"
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include "portlist.h"
#include <utils/ssh/sshremoteprocessrunner.h> #include <utils/ssh/sshremoteprocessrunner.h>

View File

@@ -54,6 +54,7 @@ class RemoteLinuxUsedPortsGathererPrivate;
class REMOTELINUX_EXPORT RemoteLinuxUsedPortsGatherer : public QObject class REMOTELINUX_EXPORT RemoteLinuxUsedPortsGatherer : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(RemoteLinuxUsedPortsGatherer)
public: public:
explicit RemoteLinuxUsedPortsGatherer(QObject *parent = 0); explicit RemoteLinuxUsedPortsGatherer(QObject *parent = 0);
~RemoteLinuxUsedPortsGatherer(); ~RemoteLinuxUsedPortsGatherer();

View File

@@ -34,25 +34,37 @@
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <QtCore/QFile> #include <QtCore/QFile>
#include <QtCore/QSharedPointer>
using namespace Utils; using namespace Utils;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
SshKeyDeployer::SshKeyDeployer(QObject *parent) : QObject(parent) class SshKeyDeployerPrivate
{
public:
SshRemoteProcessRunner::Ptr deployProcess;
};
} // namespace Internal
SshKeyDeployer::SshKeyDeployer(QObject *parent)
: QObject(parent), m_d(new Internal::SshKeyDeployerPrivate)
{ {
} }
SshKeyDeployer::~SshKeyDeployer() SshKeyDeployer::~SshKeyDeployer()
{ {
cleanup(); cleanup();
delete m_d;
} }
void SshKeyDeployer::deployPublicKey(const SshConnectionParameters &sshParams, void SshKeyDeployer::deployPublicKey(const SshConnectionParameters &sshParams,
const QString &keyFilePath) const QString &keyFilePath)
{ {
cleanup(); cleanup();
m_deployProcess = SshRemoteProcessRunner::create(sshParams); m_d->deployProcess = SshRemoteProcessRunner::create(sshParams);
Utils::FileReader reader; Utils::FileReader reader;
if (!reader.fetch(keyFilePath)) { if (!reader.fetch(keyFilePath)) {
@@ -60,21 +72,21 @@ void SshKeyDeployer::deployPublicKey(const SshConnectionParameters &sshParams,
return; return;
} }
connect(m_deployProcess.data(), SIGNAL(connectionError(Utils::SshError)), this, connect(m_d->deployProcess.data(), SIGNAL(connectionError(Utils::SshError)), this,
SLOT(handleConnectionFailure())); SLOT(handleConnectionFailure()));
connect(m_deployProcess.data(), SIGNAL(processClosed(int)), this, connect(m_d->deployProcess.data(), SIGNAL(processClosed(int)), this,
SLOT(handleKeyUploadFinished(int))); SLOT(handleKeyUploadFinished(int)));
const QByteArray command = "test -d .ssh " const QByteArray command = "test -d .ssh "
"|| mkdir .ssh && chmod 0700 .ssh && echo '" "|| mkdir .ssh && chmod 0700 .ssh && echo '"
+ reader.data() + "' >> .ssh/authorized_keys && chmod 0600 .ssh/authorized_keys"; + reader.data() + "' >> .ssh/authorized_keys && chmod 0600 .ssh/authorized_keys";
m_deployProcess->run(command); m_d->deployProcess->run(command);
} }
void SshKeyDeployer::handleConnectionFailure() void SshKeyDeployer::handleConnectionFailure()
{ {
if (!m_deployProcess) if (!m_d->deployProcess)
return; return;
const QString errorMsg = m_deployProcess->connection()->errorString(); const QString errorMsg = m_d->deployProcess->connection()->errorString();
cleanup(); cleanup();
emit error(tr("Connection failed: %1").arg(errorMsg)); emit error(tr("Connection failed: %1").arg(errorMsg));
} }
@@ -85,11 +97,11 @@ void SshKeyDeployer::handleKeyUploadFinished(int exitStatus)
|| exitStatus == SshRemoteProcess::KilledBySignal || exitStatus == SshRemoteProcess::KilledBySignal
|| exitStatus == SshRemoteProcess::ExitedNormally); || exitStatus == SshRemoteProcess::ExitedNormally);
if (!m_deployProcess) if (!m_d->deployProcess)
return; return;
const int exitCode = m_deployProcess->process()->exitCode(); const int exitCode = m_d->deployProcess->process()->exitCode();
const QString errorMsg = m_deployProcess->process()->errorString(); const QString errorMsg = m_d->deployProcess->process()->errorString();
cleanup(); cleanup();
if (exitStatus == SshRemoteProcess::ExitedNormally && exitCode == 0) if (exitStatus == SshRemoteProcess::ExitedNormally && exitCode == 0)
emit finishedSuccessfully(); emit finishedSuccessfully();
@@ -104,9 +116,9 @@ void SshKeyDeployer::stopDeployment()
void SshKeyDeployer::cleanup() void SshKeyDeployer::cleanup()
{ {
if (m_deployProcess) { if (m_d->deployProcess) {
disconnect(m_deployProcess.data(), 0, this, 0); disconnect(m_d->deployProcess.data(), 0, this, 0);
m_deployProcess.clear(); m_d->deployProcess.clear();
} }
} }

View File

@@ -34,18 +34,20 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QSharedPointer>
namespace Utils { namespace Utils {
class SshConnectionParameters; class SshConnectionParameters;
class SshRemoteProcessRunner;
} }
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal {
class SshKeyDeployerPrivate;
}
class REMOTELINUX_EXPORT SshKeyDeployer : public QObject class REMOTELINUX_EXPORT SshKeyDeployer : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(SshKeyDeployer)
public: public:
explicit SshKeyDeployer(QObject *parent = 0); explicit SshKeyDeployer(QObject *parent = 0);
~SshKeyDeployer(); ~SshKeyDeployer();
@@ -65,7 +67,7 @@ private slots:
private: private:
void cleanup(); void cleanup();
QSharedPointer<Utils::SshRemoteProcessRunner> m_deployProcess; Internal::SshKeyDeployerPrivate * const m_d;
}; };
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -41,13 +41,10 @@ using namespace ProjectExplorer;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
class UploadAndInstallTarPackageActionPrivate class UploadAndInstallTarPackageServicePrivate
{ {
public: public:
UploadAndInstallTarPackageActionPrivate() : installer(new RemoteLinuxTarPackageInstaller) { } RemoteLinuxTarPackageInstaller installer;
~UploadAndInstallTarPackageActionPrivate() { delete installer; }
RemoteLinuxTarPackageInstaller * const installer;
}; };
} // namespace Internal } // namespace Internal
@@ -55,7 +52,7 @@ using namespace Internal;
UploadAndInstallTarPackageService::UploadAndInstallTarPackageService(QObject *parent) UploadAndInstallTarPackageService::UploadAndInstallTarPackageService(QObject *parent)
: AbstractUploadAndInstallPackageService(parent), : AbstractUploadAndInstallPackageService(parent),
m_d(new UploadAndInstallTarPackageActionPrivate) m_d(new UploadAndInstallTarPackageServicePrivate)
{ {
} }
@@ -66,7 +63,7 @@ UploadAndInstallTarPackageService::~UploadAndInstallTarPackageService()
AbstractRemoteLinuxPackageInstaller *UploadAndInstallTarPackageService::packageInstaller() const AbstractRemoteLinuxPackageInstaller *UploadAndInstallTarPackageService::packageInstaller() const
{ {
return m_d->installer; return &m_d->installer;
} }

View File

@@ -39,7 +39,7 @@ namespace RemoteLinux {
class AbstractRemoteLinuxPackageInstaller; class AbstractRemoteLinuxPackageInstaller;
namespace Internal { namespace Internal {
class UploadAndInstallTarPackageActionPrivate; class UploadAndInstallTarPackageServicePrivate;
} }
class REMOTELINUX_EXPORT UploadAndInstallTarPackageService : public AbstractUploadAndInstallPackageService class REMOTELINUX_EXPORT UploadAndInstallTarPackageService : public AbstractUploadAndInstallPackageService
@@ -53,7 +53,7 @@ public:
private: private:
AbstractRemoteLinuxPackageInstaller *packageInstaller() const; AbstractRemoteLinuxPackageInstaller *packageInstaller() const;
Internal::UploadAndInstallTarPackageActionPrivate *m_d; Internal::UploadAndInstallTarPackageServicePrivate *m_d;
}; };