summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2014-07-22 10:34:28 +0200
committerFawzi Mohamed <fawzi.mohamed@digia.com>2014-07-22 14:50:56 +0200
commitd83aa937802defcc5cc685abd6d811ac80d5c4a2 (patch)
tree767e30232ef902065f5eff2ff3d2da06893b15d7 /src/libs/qmljs/qmljsmodelmanagerinterface.cpp
parentaebc90ec08bca9d0b248fccac8a6f8c7e8d57d49 (diff)
downloadqt-creator-d83aa937802defcc5cc685abd6d811ac80d5c4a2.tar.gz
qmljs: fix import search paths collecting
Change-Id: I0b977d3186d8a0ab8f48e1d689e0ab9d045b46e3 Reviewed-by: Marco Bubke <marco.bubke@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.cpp')
-rw-r--r--src/libs/qmljs/qmljsmodelmanagerinterface.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
index 543e0c6955..067a42e4a1 100644
--- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
+++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
@@ -604,7 +604,7 @@ ModelManagerInterface::ProjectInfo ModelManagerInterface::projectInfoForPath(QSt
if (res.qtQmlPath.isEmpty())
res.qtQmlPath = pInfo.qtQmlPath;
foreach (const QString &path, pInfo.importPaths)
- if (res.importPaths.contains(path))
+ if (!res.importPaths.contains(path))
res.importPaths.append(path);
}
return res;
@@ -1105,28 +1105,24 @@ void ModelManagerInterface::updateImportPaths()
while (pInfoIter.hasNext()) {
pInfoIter.next();
QString pathAtt = pInfoIter.value().qtQmlPath;
- if (!pathAtt.isEmpty() && allImportPaths.size() > 0
- && allImportPaths.value(allImportPaths.size()) != pathAtt)
+ if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
allImportPaths.append(pathAtt);
}
{
QString pathAtt = defaultProjectInfo().qtQmlPath;
- if (!pathAtt.isEmpty() && allImportPaths.size() > 0
- && allImportPaths.value(allImportPaths.size()) != pathAtt)
+ if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
allImportPaths.append(pathAtt);
}
pInfoIter.toFront();
while (pInfoIter.hasNext()) {
pInfoIter.next();
QString pathAtt = pInfoIter.value().qtImportsPath;
- if (!pathAtt.isEmpty() && allImportPaths.size() > 0
- && allImportPaths.value(allImportPaths.size()) != pathAtt)
+ if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
allImportPaths.append(pathAtt);
}
{
QString pathAtt = defaultProjectInfo().qtImportsPath;
- if (!pathAtt.isEmpty() && allImportPaths.size() > 0
- && allImportPaths.value(allImportPaths.size()) != pathAtt)
+ if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
allImportPaths.append(pathAtt);
}
allImportPaths += m_defaultImportPaths;