aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmakeprojectmanager/qmakeparsernodes.h
diff options
context:
space:
mode:
authorChristian Kandeler <[email protected]>2019-08-20 14:48:48 +0200
committerChristian Kandeler <[email protected]>2019-08-22 11:57:45 +0000
commitac37c5c9502a8e137542ea399b4a002c3b3cf628 (patch)
tree5e957656f8c5cd2426074775d95216510b25a2ab /src/plugins/qmakeprojectmanager/qmakeparsernodes.h
parentf4d30a6798f13b434630226649e1d1ec82d14c29 (diff)
QmakeProjectManager: Mark disabled source files in project tree
We show all source files in the project tree, including those which are listed in scopes that evaluate to false in the current configuration. This is intended, as we want users to be able to navigate to all files, not just the ones that are part of the build for the current target. However, it'd be nice for users to be able to tell which files are "active" and which ones are not. Therefore, we now mark the non-active ones as "disabled" in the project tree, just like the QbsProjectManager does. Task-number: QTCREATORBUG-22855 Change-Id: Icfb48d4f6a247de76fc109acb84b34f03866e754 Reviewed-by: Jörg Bornemann <[email protected]>
Diffstat (limited to 'src/plugins/qmakeprojectmanager/qmakeparsernodes.h')
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeparsernodes.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h
index 94eaffe267d..a6e7fa4ad56 100644
--- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h
+++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h
@@ -33,10 +33,11 @@
#include <cpptools/generatedcodemodelsupport.h>
#include <utils/textfileformat.h>
+#include <QFutureWatcher>
#include <QHash>
-#include <QStringList>
#include <QMap>
-#include <QFutureWatcher>
+#include <QPair>
+#include <QStringList>
#include <memory>
@@ -112,6 +113,11 @@ class QmakePriFileEvalResult;
class InstallsList;
+enum class FileOrigin { ExactParse, CumulativeParse };
+uint qHash(FileOrigin fo);
+using SourceFile = QPair<Utils::FilePath, FileOrigin>;
+using SourceFiles = QSet<SourceFile>;
+
// Implements ProjectNode for qmake .pri files
class QMAKEPROJECTMANAGER_EXPORT QmakePriFile
{
@@ -135,7 +141,7 @@ public:
void makeEmpty();
// Files of the specified type declared in this file.
- QSet<Utils::FilePath> files(const ProjectExplorer::FileType &type) const;
+ SourceFiles files(const ProjectExplorer::FileType &type) const;
// Files of the specified type declared in this file and in included .pri files.
const QSet<Utils::FilePath> collectFiles(const ProjectExplorer::FileType &type) const;
@@ -210,10 +216,9 @@ private:
QStringList formResources(const QString &formFile) const;
static QStringList baseVPaths(QtSupport::ProFileReader *reader, const QString &projectDir, const QString &buildDir);
static QStringList fullVPaths(const QStringList &baseVPaths, QtSupport::ProFileReader *reader, const QString &qmakeVariable, const QString &projectDir);
- static void extractSources(
- QHash<int, Internal::QmakePriFileEvalResult *> proToResult,
+ static void extractSources(QHash<int, Internal::QmakePriFileEvalResult *> proToResult,
Internal::QmakePriFileEvalResult *fallback,
- QVector<ProFileEvaluator::SourceFile> sourceFiles, ProjectExplorer::FileType type);
+ QVector<ProFileEvaluator::SourceFile> sourceFiles, ProjectExplorer::FileType type, bool cumulative);
static void extractInstalls(
QHash<int, Internal::QmakePriFileEvalResult *> proToResult,
Internal::QmakePriFileEvalResult *fallback,
@@ -232,7 +237,7 @@ private:
Utils::TextFileFormat m_textFormat;
// Memory is cheap...
- QMap<ProjectExplorer::FileType, QSet<Utils::FilePath>> m_files;
+ QMap<ProjectExplorer::FileType, SourceFiles> m_files;
QSet<Utils::FilePath> m_recursiveEnumerateFiles; // FIXME: Remove this?!
QSet<QString> m_watchedFolders;
bool m_includedInExactParse = true;