Code model: Fix Windows issues (duplicate matches).

Ensure the code model receives file names with clean paths ('/')
and fix paths in the relevant places of the code model. Pass on clean
paths from Cpp reference find and display them correctly in the search
window tooltip.

Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Friedemann Kleint
2009-11-09 13:53:28 +01:00
parent 6320b06b7c
commit d2bd092b47
6 changed files with 16 additions and 10 deletions

View File

@@ -110,7 +110,6 @@ static void find_helper(QFutureInterface<Usage> &future,
Q_ASSERT(symbolId != 0);
const QString sourceFile = QString::fromUtf8(symbol->fileName(), symbol->fileNameLength());
QStringList files(sourceFile);
if (symbol->isClass() || symbol->isForwardClassDeclaration()) {
@@ -126,9 +125,7 @@ static void find_helper(QFutureInterface<Usage> &future,
} else {
files += snapshot.dependsOn(sourceFile);
}
files.removeDuplicates();
//qDebug() << "done in:" << tm.elapsed() << "number of files to parse:" << files.size();
future.setProgressRange(0, files.size());
@@ -232,7 +229,6 @@ void CppFindReferences::findAll_helper(Symbol *symbol)
const QMap<QString, QString> wl = _modelManager->workingCopy();
Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager();
QFuture<Usage> result = QtConcurrent::run(&find_helper, wl, snapshot, symbol);
m_watcher.setFuture(result);

View File

@@ -532,7 +532,7 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type,
return;
QString contents = tryIncludeFile(fileName, type);
fileName = QDir::cleanPath(fileName);
if (m_currentDoc) {
m_currentDoc->addIncludeFile(fileName, line);