forked from qt-creator/qt-creator
Maemo: Remove additional parsing step.
Instead, utilize the newly added INSTALLS information of Qt4ProFileNode. Task-number: QTCREATORBUG-2679
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "maemodeployablelistmodel.h"
|
||||
|
||||
#include "maemoprofilewrapper.h"
|
||||
#include "maemotoolchain.h"
|
||||
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
@@ -47,16 +46,15 @@ namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFileNode,
|
||||
const QSharedPointer<ProFileOption> &proFileOption,
|
||||
ProFileUpdateSetting updateSetting, QObject *parent)
|
||||
: QAbstractTableModel(parent),
|
||||
m_projectType(proFileNode->projectType()),
|
||||
m_proFilePath(proFileNode->path()),
|
||||
m_projectName(proFileNode->displayName()),
|
||||
m_targetInfo(proFileNode->targetInformation()),
|
||||
m_installsList(proFileNode->installsList()),
|
||||
m_config(proFileNode->variableValue(ConfigVar)),
|
||||
m_modified(false),
|
||||
m_proFileWrapper(new MaemoProFileWrapper(m_proFilePath,
|
||||
proFileNode->buildDir(), proFileOption)),
|
||||
m_proFileUpdateSetting(updateSetting),
|
||||
m_hasTargetPath(false)
|
||||
{
|
||||
@@ -69,8 +67,7 @@ bool MaemoDeployableListModel::buildModel()
|
||||
{
|
||||
m_deployables.clear();
|
||||
|
||||
const MaemoProFileWrapper::InstallsList &installs = m_proFileWrapper->installs();
|
||||
m_hasTargetPath = !installs.targetPath.isEmpty();
|
||||
m_hasTargetPath = !m_installsList.targetPath.isEmpty();
|
||||
if (!m_hasTargetPath && m_proFileUpdateSetting == UpdateProFile) {
|
||||
const QString remoteDirSuffix
|
||||
= QLatin1String(m_projectType == LibraryTemplate
|
||||
@@ -98,14 +95,14 @@ bool MaemoDeployableListModel::buildModel()
|
||||
}
|
||||
} else {
|
||||
m_deployables.prepend(MaemoDeployable(localExecutableFilePath(),
|
||||
installs.targetPath));
|
||||
m_installsList.targetPath));
|
||||
}
|
||||
foreach (const MaemoProFileWrapper::InstallsElem &elem, installs.normalElems) {
|
||||
foreach (const InstallsItem &elem, m_installsList.items) {
|
||||
foreach (const QString &file, elem.files)
|
||||
m_deployables << MaemoDeployable(file, elem.path);
|
||||
}
|
||||
|
||||
m_modified = true; // ???
|
||||
m_modified = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -115,43 +112,6 @@ MaemoDeployable MaemoDeployableListModel::deployableAt(int row) const
|
||||
return m_deployables.at(row);
|
||||
}
|
||||
|
||||
bool MaemoDeployableListModel::addDeployable(const MaemoDeployable &deployable,
|
||||
QString *error)
|
||||
{
|
||||
if (m_deployables.contains(deployable)) {
|
||||
*error = tr("File already in list.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_proFileWrapper->addInstallsElem(deployable.remoteDir,
|
||||
deployable.localFilePath)) {
|
||||
*error = tr("Failed to update .pro file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
beginInsertRows(QModelIndex(), rowCount(), rowCount());
|
||||
m_deployables << deployable;
|
||||
endInsertRows();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MaemoDeployableListModel::removeDeployableAt(int row, QString *error)
|
||||
{
|
||||
Q_ASSERT(row > 0 && row < rowCount());
|
||||
|
||||
const MaemoDeployable &deployable = deployableAt(row);
|
||||
if (!m_proFileWrapper->removeInstallsElem(deployable.remoteDir,
|
||||
deployable.localFilePath)) {
|
||||
*error = tr("Could not update .pro file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
beginRemoveRows(QModelIndex(), row, row);
|
||||
m_deployables.removeAt(row);
|
||||
endRemoveRows();
|
||||
return true;
|
||||
}
|
||||
|
||||
int MaemoDeployableListModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
return parent.isValid() ? 0 : m_deployables.count();
|
||||
@@ -226,11 +186,8 @@ QString MaemoDeployableListModel::localExecutableFilePath() const
|
||||
QString fileName;
|
||||
if (isLib) {
|
||||
fileName += QLatin1String("lib");
|
||||
const QStringList &config
|
||||
= m_proFileWrapper->varValues(QLatin1String("CONFIG"));
|
||||
isStatic = config.contains(QLatin1String("static"))
|
||||
|| config.contains(QLatin1String("staticlib"))
|
||||
|| config.contains(QLatin1String("plugin"));
|
||||
isStatic = m_config.contains(QLatin1String("static"))
|
||||
|| m_config.contains(QLatin1String("staticlib"));
|
||||
}
|
||||
fileName += m_targetInfo.target;
|
||||
if (isLib)
|
||||
|
||||
@@ -38,16 +38,10 @@
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QScopedPointer>
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QString>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
struct ProFileOption;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
class MaemoProFileWrapper;
|
||||
class MaemoToolChain;
|
||||
|
||||
class MaemoDeployableListModel : public QAbstractTableModel
|
||||
@@ -59,15 +53,12 @@ public:
|
||||
};
|
||||
|
||||
MaemoDeployableListModel(const Qt4ProFileNode *proFileNode,
|
||||
const QSharedPointer<ProFileOption> &proFileOption,
|
||||
ProFileUpdateSetting updateSetting, QObject *parent);
|
||||
~MaemoDeployableListModel();
|
||||
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
||||
MaemoDeployable deployableAt(int row) const;
|
||||
bool addDeployable(const MaemoDeployable &deployable, QString *error);
|
||||
bool removeDeployableAt(int row, QString *error);
|
||||
bool isModified() const { return m_modified; }
|
||||
void setUnModified() { m_modified = false; }
|
||||
QString localExecutableFilePath() const;
|
||||
@@ -102,9 +93,10 @@ private:
|
||||
const QString m_proFilePath;
|
||||
const QString m_projectName;
|
||||
const TargetInformation m_targetInfo;
|
||||
const InstallsList m_installsList;
|
||||
const QStringList m_config;
|
||||
QList<MaemoDeployable> m_deployables;
|
||||
mutable bool m_modified;
|
||||
const QScopedPointer<MaemoProFileWrapper> m_proFileWrapper;
|
||||
ProFileUpdateSetting m_proFileUpdateSetting;
|
||||
bool m_hasTargetPath;
|
||||
};
|
||||
|
||||
@@ -84,10 +84,6 @@ void MaemoDeployables::createModels()
|
||||
if (!rootNode) // Happens on project creation by wizard.
|
||||
return;
|
||||
m_updateTimer->stop();
|
||||
m_proFileOption = QSharedPointer<ProFileOption>(new ProFileOption);
|
||||
m_proFileOption->properties
|
||||
= qt4BuildConfiguration()->qtVersion()->versionInfo();
|
||||
m_proFileOption->target_mode = ProFileOption::TARG_UNIX_MODE;
|
||||
disconnect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
m_updateTimer, SLOT(start()));
|
||||
@@ -137,8 +133,7 @@ void MaemoDeployables::createModels(const Qt4ProFileNode *proFileNode)
|
||||
= it != m_updateSettings.end()
|
||||
? it.value() : MaemoDeployableListModel::AskToUpdateProFile;
|
||||
MaemoDeployableListModel *const newModel
|
||||
= new MaemoDeployableListModel(proFileNode, m_proFileOption,
|
||||
updateSetting, this);
|
||||
= new MaemoDeployableListModel(proFileNode, updateSetting, this);
|
||||
m_listModels << newModel;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -48,10 +48,8 @@
|
||||
#include <QtCore/QAbstractListModel>
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QSharedPointer>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QTimer);
|
||||
QT_FORWARD_DECLARE_STRUCT(ProFileOption)
|
||||
|
||||
namespace ProjectExplorer { class BuildStep; }
|
||||
|
||||
@@ -88,7 +86,6 @@ private:
|
||||
const Qt4BuildConfiguration *qt4BuildConfiguration() const;
|
||||
|
||||
QList<MaemoDeployableListModel *> m_listModels;
|
||||
QSharedPointer<ProFileOption> m_proFileOption;
|
||||
UpdateSettingsMap m_updateSettings;
|
||||
const ProjectExplorer::BuildStep * const m_buildStep;
|
||||
QTimer *const m_updateTimer;
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#include "maemodeploystep.h"
|
||||
#include "maemoglobal.h"
|
||||
#include "maemopackagecreationwidget.h"
|
||||
#include "maemoprofilewrapper.h"
|
||||
#include "maemotemplatesmanager.h"
|
||||
#include "maemotoolchain.h"
|
||||
|
||||
|
||||
@@ -1,302 +0,0 @@
|
||||
#include "maemoprofilewrapper.h"
|
||||
|
||||
#include <prowriter.h>
|
||||
#include <qt4projectmanager/profilereader.h>
|
||||
|
||||
#include <QtCore/QCryptographicHash>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
namespace {
|
||||
QString pathVar(const QString &var)
|
||||
{
|
||||
return var + QLatin1String(".path");
|
||||
}
|
||||
|
||||
QString filesVar(const QString &var)
|
||||
{
|
||||
return var + QLatin1String(".files");
|
||||
}
|
||||
|
||||
const QLatin1String InstallsVar("INSTALLS");
|
||||
const QLatin1String TargetVar("target");
|
||||
}
|
||||
|
||||
|
||||
MaemoProFileWrapper::MaemoProFileWrapper(const QString &proFileName,
|
||||
const QString &buildDir, const QSharedPointer<ProFileOption> &proFileOption)
|
||||
: m_proFileName(proFileName), m_proDir(QFileInfo(m_proFileName).dir()),
|
||||
m_buildDir(buildDir), m_proFileOption(proFileOption)
|
||||
{
|
||||
parseProFile(ParseFromFile);
|
||||
}
|
||||
|
||||
MaemoProFileWrapper::~MaemoProFileWrapper() {}
|
||||
|
||||
void MaemoProFileWrapper::reload()
|
||||
{
|
||||
parseProFile(ParseFromFile);
|
||||
}
|
||||
|
||||
MaemoProFileWrapper::InstallsList MaemoProFileWrapper::installs() const
|
||||
{
|
||||
InstallsList list;
|
||||
|
||||
const QStringList &elemList = varValues(InstallsVar);
|
||||
foreach (const QString &elem, elemList) {
|
||||
const QStringList &paths = varValues(pathVar(elem));
|
||||
if (paths.count() != 1) {
|
||||
qWarning("Error: Variable %s has %d values.",
|
||||
qPrintable(pathVar(elem)), paths.count());
|
||||
continue;
|
||||
}
|
||||
|
||||
const QStringList &files
|
||||
= m_proFileReader->absoluteFileValues(filesVar(elem),
|
||||
m_proDir.path(), QStringList() << m_proDir.path(), 0);
|
||||
|
||||
if (elem == TargetVar) {
|
||||
if (!list.targetPath.isEmpty()) {
|
||||
qWarning("Error: More than one target in INSTALLS list.");
|
||||
continue;
|
||||
}
|
||||
list.targetPath = paths.first();
|
||||
} else {
|
||||
if (files.isEmpty())
|
||||
continue;
|
||||
list.normalElems << InstallsElem(elem, paths.first(), files);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::addInstallsElem(const QString &path,
|
||||
const QString &absFilePath, const QString &var)
|
||||
{
|
||||
QString varName = var;
|
||||
if (varName.isEmpty()) {
|
||||
QCryptographicHash elemHash(QCryptographicHash::Md5);
|
||||
elemHash.addData(absFilePath.toUtf8());
|
||||
varName = QString::fromAscii(elemHash.result().toHex());
|
||||
}
|
||||
|
||||
// TODO: Use lower-level calls here to make operation atomic.
|
||||
if (varName != TargetVar && !addFile(filesVar(varName), absFilePath))
|
||||
return false;
|
||||
return addVarValue(pathVar(varName), path)
|
||||
&& addVarValue(InstallsVar, varName);
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::addInstallsTarget(const QString &path)
|
||||
{
|
||||
return addInstallsElem(path, QString(), TargetVar);
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::removeInstallsElem(const QString &path,
|
||||
const QString &file)
|
||||
{
|
||||
const InstallsElem &elem = findInstallsElem(path, file);
|
||||
if (elem.varName.isEmpty())
|
||||
return false;
|
||||
|
||||
// TODO: Use lower-level calls here to make operation atomic.
|
||||
if (elem.varName != TargetVar && !removeFile(filesVar(elem.varName), file))
|
||||
return false;
|
||||
if (elem.files.count() <= 1) {
|
||||
if (!removeVarValue(pathVar(elem.varName), path))
|
||||
return false;
|
||||
if (!removeVarValue(InstallsVar, elem.varName))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::replaceInstallPath(const QString &oldPath,
|
||||
const QString &file, const QString &newPath)
|
||||
{
|
||||
const InstallsElem &elem = findInstallsElem(oldPath, file);
|
||||
if (elem.varName.isEmpty())
|
||||
return false;
|
||||
|
||||
// Simple case: Variable has only one file, so just replace the path.
|
||||
if (elem.varName == TargetVar || elem.files.count() == 1)
|
||||
return replaceVarValue(pathVar(elem.varName), oldPath, newPath);
|
||||
|
||||
// Complicated case: Variable has other files, so remove our file from it
|
||||
// and introduce a new one.
|
||||
if (!removeInstallsElem(oldPath, file))
|
||||
return false;
|
||||
return addInstallsElem(newPath, file);
|
||||
}
|
||||
|
||||
QStringList MaemoProFileWrapper::varValues(const QString &var) const
|
||||
{
|
||||
return m_proFileReader->values(var);
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::addVarValue(const QString &var, const QString &value)
|
||||
{
|
||||
if (varValues(var).contains(value))
|
||||
return true;
|
||||
|
||||
if (!readProFileContents())
|
||||
return false;
|
||||
ProWriter::addVarValues(m_proFile, &m_proFileContents, m_proDir,
|
||||
QStringList(value), var);
|
||||
parseProFile(ParseFromLines);
|
||||
return writeProFileContents();
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::addFile(const QString &var, const QString &absFilePath)
|
||||
{
|
||||
if (!readProFileContents())
|
||||
return false;
|
||||
ProWriter::addFiles(m_proFile, &m_proFileContents, m_proDir,
|
||||
QStringList(absFilePath), var);
|
||||
parseProFile(ParseFromLines);
|
||||
return writeProFileContents();
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::removeVarValue(const QString &var, const QString &value)
|
||||
{
|
||||
if (!readProFileContents())
|
||||
return false;
|
||||
const bool success = ProWriter::removeVarValues(m_proFile,
|
||||
&m_proFileContents, m_proDir, QStringList(value), QStringList(var))
|
||||
.isEmpty();
|
||||
if (success) {
|
||||
parseProFile(ParseFromLines);
|
||||
return writeProFileContents();
|
||||
} else {
|
||||
parseProFile(ParseFromFile);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::removeFile(const QString &var, const QString &absFilePath)
|
||||
{
|
||||
if (!readProFileContents())
|
||||
return false;
|
||||
const bool success = ProWriter::removeFiles(m_proFile, &m_proFileContents,
|
||||
m_proDir, QStringList(absFilePath), QStringList(var)).isEmpty();
|
||||
if (success) {
|
||||
parseProFile(ParseFromLines);
|
||||
return writeProFileContents();
|
||||
} else {
|
||||
parseProFile(ParseFromFile);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::replaceVarValue(const QString &var,
|
||||
const QString &oldValue, const QString &newValue)
|
||||
{
|
||||
if (!readProFileContents())
|
||||
return false;
|
||||
const bool success = ProWriter::removeVarValues(m_proFile,
|
||||
&m_proFileContents, m_proDir, QStringList(oldValue), QStringList(var))
|
||||
.isEmpty();
|
||||
if (!success) {
|
||||
parseProFile(ParseFromFile);
|
||||
return false;
|
||||
}
|
||||
ProWriter::addVarValues(m_proFile, &m_proFileContents, m_proDir,
|
||||
QStringList(newValue), var);
|
||||
parseProFile(ParseFromLines);
|
||||
return writeProFileContents();
|
||||
}
|
||||
|
||||
QString MaemoProFileWrapper::absFilePath(const QString &relFilePath) const
|
||||
{
|
||||
// I'd rather use QDir::cleanPath(), but that doesn't work well
|
||||
// enough for redundant ".." dirs.
|
||||
QFileInfo fi(relFilePath);
|
||||
return fi.isAbsolute() ? fi.canonicalFilePath()
|
||||
: QFileInfo(m_proFile->directoryName() + '/' + relFilePath)
|
||||
.canonicalFilePath();
|
||||
}
|
||||
|
||||
void MaemoProFileWrapper::parseProFile(ParseType type) const
|
||||
{
|
||||
if (m_proFileReader)
|
||||
m_proFile->deref();
|
||||
m_proFileReader.reset(new ProFileReader(m_proFileOption.data()));
|
||||
m_proFileReader->setOutputDir(m_buildDir);
|
||||
m_proFileReader->setCumulative(false);
|
||||
// TODO: Set output dir to build dir?
|
||||
if (type == ParseFromLines) {
|
||||
m_proFile = m_proFileReader->parsedProBlock(m_proFileName,
|
||||
m_proFileContents.join("\n"));
|
||||
} else {
|
||||
m_proFileContents.clear();
|
||||
m_proFile = m_proFileReader->parsedProFile(m_proFileName);
|
||||
}
|
||||
|
||||
if (!m_proFile) {
|
||||
qWarning("Fatal: Could not parse .pro file '%s'.",
|
||||
qPrintable(m_proFileName));
|
||||
return;
|
||||
}
|
||||
|
||||
m_proFileReader->accept(m_proFile);
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::writeProFileContents()
|
||||
{
|
||||
QFile proFileOnDisk(m_proFileName);
|
||||
if (!proFileOnDisk.open(QIODevice::WriteOnly)) {
|
||||
parseProFile(ParseFromFile);
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Disconnect and reconnect FS watcher here.
|
||||
proFileOnDisk.write(m_proFileContents.join("\n").toLatin1());
|
||||
proFileOnDisk.close();
|
||||
if (proFileOnDisk.error() != QFile::NoError) {
|
||||
parseProFile(ParseFromFile);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MaemoProFileWrapper::readProFileContents()
|
||||
{
|
||||
if (!m_proFileContents.isEmpty())
|
||||
return true;
|
||||
|
||||
QFile proFileOnDisk(m_proFileName);
|
||||
if (!proFileOnDisk.open(QIODevice::ReadOnly))
|
||||
return false;
|
||||
const QString proFileContents
|
||||
= QString::fromLatin1(proFileOnDisk.readAll());
|
||||
if (proFileOnDisk.error() != QFile::NoError)
|
||||
return false;
|
||||
m_proFileContents = proFileContents.split('\n');
|
||||
return true;
|
||||
}
|
||||
|
||||
MaemoProFileWrapper::InstallsElem MaemoProFileWrapper::findInstallsElem(const QString &path,
|
||||
const QString &file) const
|
||||
{
|
||||
const QStringList &elems = varValues(InstallsVar);
|
||||
foreach (const QString &elem, elems) {
|
||||
const QStringList &elemPaths = varValues(pathVar(elem));
|
||||
if (elemPaths.count() != 1 || elemPaths.first() != path)
|
||||
continue;
|
||||
if (elem == TargetVar)
|
||||
return InstallsElem(elem, path, QStringList());
|
||||
const QStringList &elemFiles = varValues(filesVar(elem));
|
||||
foreach (const QString &elemFile, elemFiles) {
|
||||
if (absFilePath(elemFile) == file)
|
||||
return InstallsElem(elem, path, elemFiles);
|
||||
}
|
||||
}
|
||||
return InstallsElem(QString(), QString(), QStringList());
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
@@ -1,81 +0,0 @@
|
||||
#ifndef PROFILEWRAPPER_H
|
||||
#define PROFILEWRAPPER_H
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QScopedPointer>
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QString>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class ProFile;
|
||||
struct ProFileOption;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
class ProFileReader;
|
||||
|
||||
class MaemoProFileWrapper
|
||||
{
|
||||
public:
|
||||
MaemoProFileWrapper(const QString &proFileName, const QString &buildDir,
|
||||
const QSharedPointer<ProFileOption> &proFileOption);
|
||||
~MaemoProFileWrapper();
|
||||
|
||||
void reload();
|
||||
|
||||
struct InstallsElem {
|
||||
InstallsElem(QString v, QString p, QStringList f)
|
||||
: varName(v), path(p), files(f) {}
|
||||
QString varName;
|
||||
QString path;
|
||||
QStringList files;
|
||||
};
|
||||
|
||||
struct InstallsList {
|
||||
QString targetPath;
|
||||
QList<InstallsElem> normalElems;
|
||||
};
|
||||
|
||||
// High-level functions for dealing with INSTALLS stuff.
|
||||
InstallsList installs() const;
|
||||
bool addInstallsElem(const QString &path, const QString &file,
|
||||
const QString &var = QString()); // Empty var means make the name up.
|
||||
bool addInstallsTarget(const QString &path);
|
||||
bool removeInstallsElem(const QString &path, const QString &file);
|
||||
bool replaceInstallPath(const QString &oldPath, const QString &file,
|
||||
const QString &newPath);
|
||||
|
||||
// Lower-level functions working on arbitrary variables.
|
||||
QStringList varValues(const QString &var) const;
|
||||
bool addVarValue(const QString &var, const QString &value);
|
||||
bool addFile(const QString &var, const QString &absFilePath);
|
||||
bool removeVarValue(const QString &var, const QString &value);
|
||||
bool removeFile(const QString &var, const QString &absFilePath);
|
||||
bool replaceVarValue(const QString &var, const QString &oldValue,
|
||||
const QString &newValue);
|
||||
|
||||
QString absFilePath(const QString &relFilePath) const;
|
||||
|
||||
private:
|
||||
enum ParseType { ParseFromFile, ParseFromLines };
|
||||
void parseProFile(ParseType type) const;
|
||||
bool writeProFileContents();
|
||||
bool readProFileContents();
|
||||
InstallsElem findInstallsElem(const QString &path,
|
||||
const QString &file) const;
|
||||
|
||||
const QString m_proFileName;
|
||||
const QDir m_proDir;
|
||||
const QString m_buildDir;
|
||||
const QSharedPointer<ProFileOption> m_proFileOption;
|
||||
mutable QStringList m_proFileContents;
|
||||
mutable QScopedPointer<ProFileReader> m_proFileReader;
|
||||
mutable ProFile *m_proFile;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
#endif // PROFILEWRAPPER_H
|
||||
@@ -16,7 +16,6 @@ HEADERS += \
|
||||
$$PWD/maemopackagecreationwidget.h \
|
||||
$$PWD/maemodeployablelistmodel.h \
|
||||
$$PWD/maemoqemumanager.h \
|
||||
$$PWD/maemoprofilewrapper.h \
|
||||
$$PWD/maemodeployables.h \
|
||||
$$PWD/maemodeployable.h \
|
||||
$$PWD/maemodeploystep.h \
|
||||
@@ -53,7 +52,6 @@ SOURCES += \
|
||||
$$PWD/maemopackagecreationwidget.cpp \
|
||||
$$PWD/maemodeployablelistmodel.cpp \
|
||||
$$PWD/maemoqemumanager.cpp \
|
||||
$$PWD/maemoprofilewrapper.cpp \
|
||||
$$PWD/maemodeployables.cpp \
|
||||
$$PWD/maemodeploystep.cpp \
|
||||
$$PWD/maemodeploystepwidget.cpp \
|
||||
|
||||
@@ -1942,7 +1942,7 @@ void Qt4ProFileNode::setupInstallsList(const ProFileReader *reader)
|
||||
const QStringList &itemList = reader->values(QLatin1String("INSTALLS"));
|
||||
foreach (const QString &item, itemList) {
|
||||
QString itemPath;
|
||||
const QString pathVar = item + QLatin1String(".path");
|
||||
const QString pathVar = item + QLatin1String(".path");
|
||||
const QStringList &itemPaths = reader->values(pathVar);
|
||||
if (itemPaths.count() != 1) {
|
||||
qDebug("Invalid RHS: Variable '%s' has %d values.",
|
||||
@@ -1951,10 +1951,9 @@ void Qt4ProFileNode::setupInstallsList(const ProFileReader *reader)
|
||||
qDebug("Ignoring INSTALLS item '%s', because it has no path.",
|
||||
qPrintable(item));
|
||||
continue;
|
||||
} else {
|
||||
itemPath = itemPaths.last();
|
||||
}
|
||||
}
|
||||
itemPath = itemPaths.last();
|
||||
|
||||
const QStringList &itemFiles
|
||||
= reader->absoluteFileValues(item + QLatin1String(".files"),
|
||||
|
||||
Reference in New Issue
Block a user