diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index 8053d23f362..61a4a814487 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -26,7 +26,6 @@ ** contact the sales department at http://qt.nokia.com/contact. ** **************************************************************************/ - #include "makestep.h" #include "cmakeprojectconstants.h" #include "cmakeproject.h" diff --git a/src/plugins/projectexplorer/abstractmakestep.cpp b/src/plugins/projectexplorer/abstractmakestep.cpp index e19715b9b8e..18a3abecd59 100644 --- a/src/plugins/projectexplorer/abstractmakestep.cpp +++ b/src/plugins/projectexplorer/abstractmakestep.cpp @@ -149,10 +149,26 @@ void AbstractMakeStep::slotAddToTaskWindow(const QString & fn, int type, int lin } } } - if (possibleFiles.count() == 1) + if (possibleFiles.count() == 1) { filePath = possibleFiles.first().filePath(); - else - qWarning() << "Could not find absolute location of file " << filePath; + } else { + // More then one filename, so do a better compare + // Chop of any "../" + while (filePath.startsWith("../")) + filePath = filePath.mid(3); + int count = 0; + QString possibleFilePath; + foreach(const QFileInfo & fi, possibleFiles) { + if (fi.filePath().endsWith(filePath)) { + possibleFilePath = fi.filePath(); + ++count; + } + } + if (count == 1) + filePath = possibleFilePath; + else + qWarning() << "Could not find absolute location of file " << filePath; + } } emit addToTaskWindow(filePath, type, linenumber, description); } diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index b245db783db..f4e7c715503 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -31,6 +31,7 @@ #include "projectexplorerconstants.h" #include +#include using namespace ProjectExplorer; @@ -58,7 +59,7 @@ void MsvcParser::stdOutput(const QString & line) QString lne = line.trimmed(); if (m_compileRegExp.indexIn(lne) > -1 && m_compileRegExp.numCaptures() == 4) { emit addToTaskWindow( - m_compileRegExp.cap(1), //filename + QDir::cleanPath(m_compileRegExp.cap(1)), //filename toType(m_compileRegExp.cap(3).toInt()), // PatternType m_compileRegExp.cap(2).toInt(), //linenumber m_compileRegExp.cap(4) //description @@ -70,7 +71,7 @@ void MsvcParser::stdOutput(const QString & line) fileName.clear(); emit addToTaskWindow( - fileName, //filename + QDir::cleanPath(fileName), //filename toType(m_linkRegExp.cap(2).toInt()), // pattern type -1, // line number m_linkRegExp.cap(3) // description