summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppmodelmanager.cpp
diff options
context:
space:
mode:
authorcon <qtc-committer@nokia.com>2009-10-01 17:01:13 +0200
committercon <qtc-committer@nokia.com>2009-10-01 17:02:18 +0200
commitf006183b3d836627ccd9e85d0e9725ddfa45a8a9 (patch)
tree1f96598d1e3023218702ef9126ad87b0b44726af /src/plugins/cpptools/cppmodelmanager.cpp
parent742740634e07308f1ef69527f59286b6796d94cb (diff)
downloadqt-creator-f006183b3d836627ccd9e85d0e9725ddfa45a8a9.tar.gz
Support include completion for frameworks on Mac.
Which is 'quite' important, since Qt builds by default generate frameworks.
Diffstat (limited to 'src/plugins/cpptools/cppmodelmanager.cpp')
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index efb5e43ba2..8aa6bdf767 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -809,6 +809,7 @@ void CppModelManager::updateProjectInfo(const ProjectInfo &pinfo)
QFuture<void> result = QtConcurrent::run(&CppModelManager::updateIncludesInPaths,
this,
pinfo.includePaths,
+ pinfo.frameworkPaths,
m_headerSuffixes);
if (pinfo.includePaths.size() > 1) {
@@ -1127,6 +1128,7 @@ void CppModelManager::onAboutToUnloadSession()
void CppModelManager::updateIncludesInPaths(QFutureInterface<void> &future,
CppModelManager *manager,
QStringList paths,
+ QStringList frameworkPaths,
QStringList suffixes)
{
QMap<QString, QStringList> entriesInPaths;
@@ -1137,6 +1139,24 @@ void CppModelManager::updateIncludesInPaths(QFutureInterface<void> &future,
future.setProgressRange(0, paths.size());
+ // Add framework header directories to path list
+ QStringList frameworkFilter;
+ frameworkFilter << QLatin1String("*.framework");
+ QStringListIterator fwPathIt(frameworkPaths);
+ while (fwPathIt.hasNext()) {
+ const QString &fwPath = fwPathIt.next();
+ QStringList entriesInFrameworkPath;
+ const QStringList &frameworks = QDir(fwPath).entryList(frameworkFilter, QDir::Dirs | QDir::NoDotAndDotDot);
+ QStringListIterator fwIt(frameworks);
+ while (fwIt.hasNext()) {
+ QString framework = fwIt.next();
+ paths.append(fwPath + QLatin1Char('/') + framework + QLatin1String("/Headers"));
+ framework.chop(10); // remove the ".framework"
+ entriesInFrameworkPath.append(framework + QLatin1Char('/'));
+ }
+ entriesInPaths.insert(fwPath, entriesInFrameworkPath);
+ }
+
while (!paths.isEmpty()) {
if (future.isPaused())
future.waitForResume();