forked from qt-creator/qt-creator
RemoteLinux: Introduce installation prefix to deployment information.
Now if some platform interprets deploy paths in project files relative to some base directory, it can make this visible to users. Change-Id: Ie9098e57b05f19568131e33df43a0b0f5f5888a3 Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -53,17 +53,17 @@ public:
|
||||
|
||||
QList<DeployableFilesPerProFile *> 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<Qt4PriFileNode *> &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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user