forked from qt-creator/qt-creator
Qt4ProFileNode: Make a project's INSTALLS settings available.
Task-number: QTCREATORBUG-2679 Reviewed-by: dt
This commit is contained in:
@@ -1603,6 +1603,8 @@ void Qt4ProFileNode::applyEvaluate(bool parseResult, bool async)
|
|||||||
// update TargetInformation
|
// update TargetInformation
|
||||||
m_qt4targetInformation = targetInformation(m_readerExact);
|
m_qt4targetInformation = targetInformation(m_readerExact);
|
||||||
|
|
||||||
|
setupInstallsList(m_readerExact);
|
||||||
|
|
||||||
// update other variables
|
// update other variables
|
||||||
QHash<Qt4Variable, QStringList> newVarValues;
|
QHash<Qt4Variable, QStringList> newVarValues;
|
||||||
|
|
||||||
@@ -1932,6 +1934,51 @@ TargetInformation Qt4ProFileNode::targetInformation() const
|
|||||||
return m_qt4targetInformation;
|
return m_qt4targetInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Qt4ProFileNode::setupInstallsList(const ProFileReader *reader)
|
||||||
|
{
|
||||||
|
m_installsList.clear();
|
||||||
|
if (!reader)
|
||||||
|
return;
|
||||||
|
const QStringList &itemList = reader->values(QLatin1String("INSTALLS"));
|
||||||
|
foreach (const QString &item, itemList) {
|
||||||
|
QString itemPath;
|
||||||
|
const QString pathVar = item + QLatin1String(".path");
|
||||||
|
const QStringList &itemPaths = reader->values(pathVar);
|
||||||
|
if (itemPaths.count() != 1) {
|
||||||
|
qDebug("Invalid RHS: Variable '%s' has %d values.",
|
||||||
|
qPrintable(pathVar), itemPaths.count());
|
||||||
|
if (itemPaths.isEmpty()) {
|
||||||
|
qDebug("Ignoring INSTALLS item '%s', because it has no path.",
|
||||||
|
qPrintable(item));
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
itemPath = itemPaths.last();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const QStringList &itemFiles
|
||||||
|
= reader->absoluteFileValues(item + QLatin1String(".files"),
|
||||||
|
m_projectDir, QStringList() << m_projectDir, 0);
|
||||||
|
if (item == QLatin1String("target")) {
|
||||||
|
if (!m_installsList.targetPath.isEmpty())
|
||||||
|
qDebug("Overwriting existing target.path in INSTALLS list.");
|
||||||
|
m_installsList.targetPath = itemPath;
|
||||||
|
} else {
|
||||||
|
if (itemFiles.isEmpty()) {
|
||||||
|
qDebug("Ignoring INSTALLS item '%s', because it has no files.",
|
||||||
|
qPrintable(item));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
m_installsList.items << InstallsItem(itemPath, itemFiles);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
InstallsList Qt4ProFileNode::installsList() const
|
||||||
|
{
|
||||||
|
return m_installsList;
|
||||||
|
}
|
||||||
|
|
||||||
QString Qt4ProFileNode::buildDir() const
|
QString Qt4ProFileNode::buildDir() const
|
||||||
{
|
{
|
||||||
const QDir srcDirRoot = QFileInfo(m_project->rootProjectNode()->path()).absoluteDir();
|
const QDir srcDirRoot = QFileInfo(m_project->rootProjectNode()->path()).absoluteDir();
|
||||||
|
|||||||
@@ -248,6 +248,18 @@ struct TargetInformation
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct InstallsItem {
|
||||||
|
InstallsItem(QString p, QStringList f) : path(p), files(f) {}
|
||||||
|
QString path;
|
||||||
|
QStringList files;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct InstallsList {
|
||||||
|
void clear() { targetPath.clear(); items.clear(); }
|
||||||
|
QString targetPath;
|
||||||
|
QList<InstallsItem> items;
|
||||||
|
};
|
||||||
|
|
||||||
// Implements ProjectNode for qt4 pro files
|
// Implements ProjectNode for qt4 pro files
|
||||||
class Qt4ProFileNode : public Qt4PriFileNode
|
class Qt4ProFileNode : public Qt4PriFileNode
|
||||||
{
|
{
|
||||||
@@ -279,6 +291,8 @@ public:
|
|||||||
TargetInformation targetInformation(const QString &fileName) const;
|
TargetInformation targetInformation(const QString &fileName) const;
|
||||||
TargetInformation targetInformation() const;
|
TargetInformation targetInformation() const;
|
||||||
|
|
||||||
|
InstallsList installsList() const;
|
||||||
|
|
||||||
QString makefile() const;
|
QString makefile() const;
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
@@ -309,6 +323,7 @@ private:
|
|||||||
QStringList libDirectories(ProFileReader *reader) const;
|
QStringList libDirectories(ProFileReader *reader) const;
|
||||||
QStringList subDirsPaths(ProFileReader *reader) const;
|
QStringList subDirsPaths(ProFileReader *reader) const;
|
||||||
TargetInformation targetInformation(ProFileReader *reader) const;
|
TargetInformation targetInformation(ProFileReader *reader) const;
|
||||||
|
void setupInstallsList(const ProFileReader *reader);
|
||||||
|
|
||||||
void invalidate();
|
void invalidate();
|
||||||
|
|
||||||
@@ -317,6 +332,7 @@ private:
|
|||||||
|
|
||||||
QMap<QString, QDateTime> m_uitimestamps;
|
QMap<QString, QDateTime> m_uitimestamps;
|
||||||
TargetInformation m_qt4targetInformation;
|
TargetInformation m_qt4targetInformation;
|
||||||
|
InstallsList m_installsList;
|
||||||
friend class Qt4NodeHierarchy;
|
friend class Qt4NodeHierarchy;
|
||||||
|
|
||||||
// Async stuff
|
// Async stuff
|
||||||
|
|||||||
Reference in New Issue
Block a user