forked from qt-creator/qt-creator
		
	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:
		| @@ -42,6 +42,7 @@ | ||||
|  | ||||
| #include <QtCore/QByteArray> | ||||
| #include <QtCore/QBitArray> | ||||
| #include <QtCore/QDir> | ||||
| #include <QtCore/QtDebug> | ||||
|  | ||||
| /*! | ||||
| @@ -108,7 +109,7 @@ private: | ||||
|  | ||||
|  | ||||
| Document::Document(const QString &fileName) | ||||
|     : _fileName(fileName), | ||||
|     : _fileName(QDir::cleanPath(fileName)), | ||||
|       _globalNamespace(0), | ||||
|       _revision(0) | ||||
| { | ||||
| @@ -173,7 +174,7 @@ QStringList Document::includedFiles() const | ||||
|  | ||||
| void Document::addIncludeFile(const QString &fileName, unsigned line) | ||||
| { | ||||
|     _includes.append(Include(fileName, line)); | ||||
|     _includes.append(Include(QDir::cleanPath(fileName), line)); | ||||
| } | ||||
|  | ||||
| void Document::appendMacro(const Macro ¯o) | ||||
| @@ -569,3 +570,8 @@ QStringList Snapshot::dependsOn(const QString &fileName) const | ||||
|  | ||||
|     return deps; | ||||
| } | ||||
|  | ||||
| Document::Ptr Snapshot::value(const QString &fileName) const | ||||
| { | ||||
|     return QMap<QString, Document::Ptr>::value(QDir::cleanPath(fileName)); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user