diff --git a/src/plugins/remotelinux/deployablefilesperprofile.cpp b/src/plugins/remotelinux/deployablefilesperprofile.cpp index 8cfb982aa54..fbe0d68e605 100644 --- a/src/plugins/remotelinux/deployablefilesperprofile.cpp +++ b/src/plugins/remotelinux/deployablefilesperprofile.cpp @@ -74,7 +74,7 @@ public: using namespace Internal; DeployableFilesPerProFile::DeployableFilesPerProFile(const Qt4ProFileNode *proFileNode, - QObject *parent) + const QString &installPrefix, QObject *parent) : QAbstractTableModel(parent), d(new DeployableFilesPerProFilePrivate(proFileNode)) { if (d->projectType == ApplicationTemplate) { @@ -90,6 +90,12 @@ DeployableFilesPerProFile::DeployableFilesPerProFile(const Qt4ProFileNode *proFi foreach (const QString &file, elem.files) d->deployables << DeployableFile(file, elem.path); } + + for (int i = 0; i < d->deployables.count(); ++i) { + QString &remoteDir = d->deployables[i].remoteDir; + if (QFileInfo(remoteDir).isRelative()) + remoteDir.prepend(installPrefix + QLatin1Char('/')); + } } DeployableFilesPerProFile::~DeployableFilesPerProFile() @@ -133,7 +139,7 @@ QVariant DeployableFilesPerProFile::data(const QModelIndex &index, int role) con if (index.column() == 0 && role == Qt::DisplayRole) return QDir::toNativeSeparators(d.localFilePath); if (role == Qt::DisplayRole || role == Qt::EditRole) - return d.remoteDir; + return QDir::cleanPath(d.remoteDir); return QVariant(); } diff --git a/src/plugins/remotelinux/deployablefilesperprofile.h b/src/plugins/remotelinux/deployablefilesperprofile.h index 5fd9695995f..c219f0743c5 100644 --- a/src/plugins/remotelinux/deployablefilesperprofile.h +++ b/src/plugins/remotelinux/deployablefilesperprofile.h @@ -53,7 +53,7 @@ class REMOTELINUX_EXPORT DeployableFilesPerProFile : public QAbstractTableModel Q_OBJECT public: DeployableFilesPerProFile(const Qt4ProjectManager::Qt4ProFileNode *proFileNode, - QObject *parent); + const QString &installPrefix, QObject *parent); ~DeployableFilesPerProFile(); virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; diff --git a/src/plugins/remotelinux/deploymentinfo.cpp b/src/plugins/remotelinux/deploymentinfo.cpp index 42c31dff6dd..9ab125493fd 100644 --- a/src/plugins/remotelinux/deploymentinfo.cpp +++ b/src/plugins/remotelinux/deploymentinfo.cpp @@ -53,17 +53,17 @@ public: QList listModels; const AbstractEmbeddedLinuxTarget * const target; + QString installPrefix; }; } // namespace Internal using namespace Internal; -DeploymentInfo::DeploymentInfo(AbstractEmbeddedLinuxTarget *target) : - QAbstractListModel(target), - d(new DeploymentInfoPrivate(target)) +DeploymentInfo::DeploymentInfo(AbstractEmbeddedLinuxTarget *target, const QString &installPrefix) + : QAbstractListModel(target), d(new DeploymentInfoPrivate(target)) { connect (d->target->qt4Project(), SIGNAL(proParsingDone()), SLOT(createModels())); - createModels(); + setInstallPrefix(installPrefix); } DeploymentInfo::~DeploymentInfo() @@ -102,7 +102,7 @@ void DeploymentInfo::createModels(const Qt4ProFileNode *proFileNode) case ApplicationTemplate: case LibraryTemplate: case AuxTemplate: - d->listModels << new DeployableFilesPerProFile(proFileNode, this); + d->listModels << new DeployableFilesPerProFile(proFileNode, d->installPrefix, this); break; case SubDirsTemplate: { const QList &subProjects = proFileNode->subProjectNodesExact(); @@ -133,6 +133,12 @@ bool DeploymentInfo::isModified() const return false; } +void DeploymentInfo::setInstallPrefix(const QString &installPrefix) +{ + d->installPrefix = installPrefix; + createModels(); +} + int DeploymentInfo::deployableCount() const { int count = 0; diff --git a/src/plugins/remotelinux/deploymentinfo.h b/src/plugins/remotelinux/deploymentinfo.h index 5690b3f7c28..fffa093ac03 100644 --- a/src/plugins/remotelinux/deploymentinfo.h +++ b/src/plugins/remotelinux/deploymentinfo.h @@ -51,11 +51,12 @@ class REMOTELINUX_EXPORT DeploymentInfo : public QAbstractListModel { Q_OBJECT public: - DeploymentInfo(AbstractEmbeddedLinuxTarget *target); + DeploymentInfo(AbstractEmbeddedLinuxTarget *target, const QString &installPrefix = QString()); ~DeploymentInfo(); void setUnmodified(); bool isModified() const; + void setInstallPrefix(const QString &installPrefix); int deployableCount() const; DeployableFile deployableAt(int i) const; QString remoteExecutableFilePath(const QString &localExecutableFilePath) const;