Commit 156db185 authored by dt's avatar dt

Fix not trying hard enough to find the correct file on build errors.

If there are multiple files with the same name, then we try harder to
find the correct one. That is for jom and nmake we have a relative path
so we try to find a file which matches the relative path completly.
Instead of just comparing the last part.
parent e1f9a003
......@@ -26,7 +26,6 @@
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "makestep.h"
#include "cmakeprojectconstants.h"
#include "cmakeproject.h"
......
......@@ -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);
}
......
......@@ -31,6 +31,7 @@
#include "projectexplorerconstants.h"
#include <QtCore/QStringList>
#include <QtCore/QDir>
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment