Keep the locator database in sync with the current snapshot.

Thanks to this patch we can move the filtering of C++ symbols
in a background thread.

Done-with: Erik Verbruggen
This commit is contained in:
Roberto Raggi
2010-09-06 16:46:23 +02:00
parent 6863b02e03
commit 86799309aa
6 changed files with 33 additions and 34 deletions

View File

@@ -67,6 +67,7 @@ QList<ModelItemInfo> SearchSymbols::operator()(Document::Ptr doc, const QString
accept(doc->globalSymbolAt(i));
}
(void) switchScope(previousScope);
strings.clear();
return items;
}
@@ -216,10 +217,17 @@ void SearchSymbols::appendItem(const QString &name,
QStringList fullyQualifiedName;
foreach (const Name *name, LookupContext::fullyQualifiedName(symbol))
fullyQualifiedName.append(overview.prettyName(name));
QString path = m_paths.value(symbol->fileId(), QString());
if (path.isEmpty()) {
path = QString::fromUtf8(symbol->fileName(), symbol->fileNameLength());
m_paths.insert(symbol->fileId(), path);
}
const QIcon icon = icons.iconForSymbol(symbol);
items.append(ModelItemInfo(name, info, type,
fullyQualifiedName,
QString::fromUtf8(symbol->fileName(), symbol->fileNameLength()),
path,
symbol->line(),
symbol->column() - 1, // 1-based vs 0-based column
icon));