QmlDesigner: Add isSameModule to Import

Change-Id: I5d06ad83adcd48b311d9c270ffcc5d1cf85e3afa
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Marco Bubke
2013-08-14 14:36:21 +02:00
parent 737838c3bf
commit c9938fef82
2 changed files with 9 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ public:
QString toImportString() const;
bool operator==(const Import &other) const;
bool isSameModule(const Import &other) const;
private:
Import(const QString &url, const QString &file, const QString &version, const QString &alias, const QStringList &importPaths);

View File

@@ -95,6 +95,14 @@ bool Import::operator==(const Import &other) const
return url() == other.url() && file() == other.file() && version() == other.version() && alias() == other.alias();
}
bool Import::isSameModule(const Import &other) const
{
if (isLibraryImport())
return url() == other.url();
else
return file() == other.file();
}
uint qHash(const Import &import)
{
return ::qHash(import.url()) ^ ::qHash(import.file()) ^ ::qHash(import.version()) ^ ::qHash(import.alias());