Support include completion for frameworks on Mac.

Which is 'quite' important, since Qt builds by default generate
frameworks.
This commit is contained in:
con
2009-10-01 17:01:13 +02:00
parent 742740634e
commit f006183b3d
3 changed files with 38 additions and 0 deletions

View File

@@ -1239,6 +1239,23 @@ bool CppCodeCompletion::completeInclude(const QTextCursor &cursor)
m_completions.append(item);
}
}
QStringList frameworkPaths = m_manager->projectInfo(project).frameworkPaths;
foreach (const QString &frameworkPath, frameworkPaths) {
QString realPath = frameworkPath;
if (!directoryPrefix.isEmpty()) {
realPath += QLatin1Char('/');
realPath += directoryPrefix;
realPath += QLatin1String(".framework/Headers");
}
foreach (const QString &itemText, m_manager->includesInPath(realPath)) {
TextEditor::CompletionItem item(this);
item.m_text += itemText;
// TODO: Icon for include files
item.m_icon = m_icons.keywordIcon();
m_completions.append(item);
}
}
}
return !m_completions.isEmpty();