aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2014-12-15 13:36:15 +0100
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2014-12-15 16:22:02 +0100
commitb74ec693474937e397ed9c80021e92ad8ace3656 (patch)
tree0b10fe06dc880d5abb3dca2805aec7052b58b8c1
parent67d039b96849fd1a6f45c8fd8ff72c54946519a6 (diff)
Fix ResolvedFileContext comparison.
The order of JS extensions and imports does not matter. Change-Id: I452e8e6e64f588b061211031968d5741c01339d8 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r--src/lib/corelib/language/jsimports.h2
-rw-r--r--src/lib/corelib/language/resolvedfilecontext.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/corelib/language/jsimports.h b/src/lib/corelib/language/jsimports.h
index 089dcabc3..5a0d13f66 100644
--- a/src/lib/corelib/language/jsimports.h
+++ b/src/lib/corelib/language/jsimports.h
@@ -32,6 +32,7 @@
#define QBS_JSIMPORTS_H
#include <tools/codelocation.h>
+#include <QHash>
#include <QSet>
#include <QStringList>
@@ -52,6 +53,7 @@ public:
QStringList filePaths;
CodeLocation location;
};
+inline uint qHash(const JsImport &jsi) { return qHash(jsi.location.toString()); }
typedef QList<JsImport> JsImports;
diff --git a/src/lib/corelib/language/resolvedfilecontext.cpp b/src/lib/corelib/language/resolvedfilecontext.cpp
index 999b736a6..a9078ace6 100644
--- a/src/lib/corelib/language/resolvedfilecontext.cpp
+++ b/src/lib/corelib/language/resolvedfilecontext.cpp
@@ -75,8 +75,8 @@ void ResolvedFileContext::store(PersistentPool &pool) const
bool operator==(const ResolvedFileContext &a, const ResolvedFileContext &b)
{
return a.filePath() == b.filePath()
- && a.jsExtensions() == b.jsExtensions()
- && a.jsImports() == b.jsImports();
+ && a.jsExtensions().toSet() == b.jsExtensions().toSet()
+ && a.jsImports().toSet() == b.jsImports().toSet();
}
} // namespace Internal