Skip to content
Snippets Groups Projects
Commit 156db185 authored by dt's avatar dt
Browse files

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
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
** contact the sales department at http://qt.nokia.com/contact. ** contact the sales department at http://qt.nokia.com/contact.
** **
**************************************************************************/ **************************************************************************/
#include "makestep.h" #include "makestep.h"
#include "cmakeprojectconstants.h" #include "cmakeprojectconstants.h"
#include "cmakeproject.h" #include "cmakeproject.h"
......
...@@ -149,10 +149,26 @@ void AbstractMakeStep::slotAddToTaskWindow(const QString & fn, int type, int lin ...@@ -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(); filePath = possibleFiles.first().filePath();
else } else {
qWarning() << "Could not find absolute location of file " << filePath; // 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); emit addToTaskWindow(filePath, type, linenumber, description);
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "projectexplorerconstants.h" #include "projectexplorerconstants.h"
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QDir>
using namespace ProjectExplorer; using namespace ProjectExplorer;
...@@ -58,7 +59,7 @@ void MsvcParser::stdOutput(const QString & line) ...@@ -58,7 +59,7 @@ void MsvcParser::stdOutput(const QString & line)
QString lne = line.trimmed(); QString lne = line.trimmed();
if (m_compileRegExp.indexIn(lne) > -1 && m_compileRegExp.numCaptures() == 4) { if (m_compileRegExp.indexIn(lne) > -1 && m_compileRegExp.numCaptures() == 4) {
emit addToTaskWindow( emit addToTaskWindow(
m_compileRegExp.cap(1), //filename QDir::cleanPath(m_compileRegExp.cap(1)), //filename
toType(m_compileRegExp.cap(3).toInt()), // PatternType toType(m_compileRegExp.cap(3).toInt()), // PatternType
m_compileRegExp.cap(2).toInt(), //linenumber m_compileRegExp.cap(2).toInt(), //linenumber
m_compileRegExp.cap(4) //description m_compileRegExp.cap(4) //description
...@@ -70,7 +71,7 @@ void MsvcParser::stdOutput(const QString & line) ...@@ -70,7 +71,7 @@ void MsvcParser::stdOutput(const QString & line)
fileName.clear(); fileName.clear();
emit addToTaskWindow( emit addToTaskWindow(
fileName, //filename QDir::cleanPath(fileName), //filename
toType(m_linkRegExp.cap(2).toInt()), // pattern type toType(m_linkRegExp.cap(2).toInt()), // pattern type
-1, // line number -1, // line number
m_linkRegExp.cap(3) // description m_linkRegExp.cap(3) // description
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment