Task: Update Task to use Utils::FileName and Core::Id

Use Utils::FileName and Core::Id in Task structure.

Change-Id: Ia0ed459f86df36ffe547abde7c240b0ac409bcf5
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Tobias Hunger
2012-01-26 13:38:25 +01:00
parent 2f021edfdd
commit 97496df1bf
44 changed files with 410 additions and 397 deletions

View File

@@ -86,7 +86,7 @@ bool AnalyzerPlugin::initialize(const QStringList &arguments, QString *errorStri
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
ProjectExplorer::TaskHub *hub = pm->getObject<ProjectExplorer::TaskHub>(); ProjectExplorer::TaskHub *hub = pm->getObject<ProjectExplorer::TaskHub>();
//: Category under which Analyzer tasks are listed in Issues view //: Category under which Analyzer tasks are listed in Issues view
hub->addCategory(QLatin1String(Constants::ANALYZERTASK_ID), tr("Analyzer")); hub->addCategory(Core::Id(Constants::ANALYZERTASK_ID), tr("Analyzer"));
return true; return true;
} }

View File

@@ -118,7 +118,7 @@ void AnalyzerRunControl::start()
// clear about-to-be-outdated tasks // clear about-to-be-outdated tasks
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
TaskHub *hub = pm->getObject<TaskHub>(); TaskHub *hub = pm->getObject<TaskHub>();
hub->clearTasks(QLatin1String(Constants::ANALYZERTASK_ID)); hub->clearTasks(Core::Id(Constants::ANALYZERTASK_ID));
if (d->m_engine->start()) { if (d->m_engine->start()) {
d->m_isRunning = true; d->m_isRunning = true;
@@ -179,7 +179,8 @@ void AnalyzerRunControl::addTask(Task::TaskType type, const QString &description
{ {
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
TaskHub *hub = pm->getObject<TaskHub>(); TaskHub *hub = pm->getObject<TaskHub>();
hub->addTask(Task(type, description, file, line, QLatin1String(Constants::ANALYZERTASK_ID))); hub->addTask(Task(type, description, Utils::FileName::fromUserInput(file), line,
Core::Id(Constants::ANALYZERTASK_ID)));
hub->popup(false); hub->popup(false);
} }

View File

@@ -55,7 +55,7 @@ static QHash<QByteArray, int> idFromString;
static int theId(const QByteArray &ba) static int theId(const QByteArray &ba)
{ {
QTC_ASSERT(!ba.isEmpty(), /**/); QTC_CHECK(!ba.isEmpty());
int res = idFromString.value(ba); int res = idFromString.value(ba);
if (res == 0) { if (res == 0) {
if (lastUid == 0) if (lastUid == 0)

View File

@@ -1787,10 +1787,10 @@ void DebuggerEnginePrivate::reportTestError(const QString &msg, int line)
if (!m_taskHub) { if (!m_taskHub) {
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
m_taskHub = pm->getObject<TaskHub>(); m_taskHub = pm->getObject<TaskHub>();
m_taskHub->addCategory(QLatin1String("DebuggerTest"), tr("Debugger Test")); m_taskHub->addCategory(Core::Id("DebuggerTest"), tr("Debugger Test"));
} }
Task task(Task::Error, msg, m_testFileName, line + 1, QLatin1String("DebuggerTest")); Task task(Task::Error, msg, Utils::FileName::fromUserInput(m_testFileName), line + 1, Core::Id("DebuggerTest"));
m_taskHub->addTask(task); m_taskHub->addTask(task);
} }

View File

@@ -367,7 +367,7 @@ void MaemoDebianPackageCreationStep::checkProjectName()
"Debian packages.\nThey must only use lower-case letters, " "Debian packages.\nThey must only use lower-case letters, "
"numbers, '-', '+' and '.'.\n""We will try to work around that, " "numbers, '-', '+' and '.'.\n""We will try to work around that, "
"but you may experience problems."), "but you may experience problems."),
QString(), -1, TASK_CATEGORY_BUILDSYSTEM)); Utils::FileName(), -1, Core::Id(TASK_CATEGORY_BUILDSYSTEM)));
} }
} }

View File

@@ -371,7 +371,7 @@ void AbstractProcessStep::taskAdded(const ProjectExplorer::Task &task)
return; return;
Task editable(task); Task editable(task);
QString filePath = QDir::cleanPath(task.file.trimmed()); QString filePath = task.file.toString();
if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) { if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) {
// We have no save way to decide which file in which subfolder // We have no save way to decide which file in which subfolder
// is meant. Therefore we apply following heuristics: // is meant. Therefore we apply following heuristics:
@@ -388,7 +388,7 @@ void AbstractProcessStep::taskAdded(const ProjectExplorer::Task &task)
} }
if (possibleFiles.count() == 1) { if (possibleFiles.count() == 1) {
editable.file = possibleFiles.first().filePath(); editable.file = Utils::FileName(possibleFiles.first());
} else { } else {
// More then one filename, so do a better compare // More then one filename, so do a better compare
// Chop of any "../" // Chop of any "../"
@@ -403,7 +403,7 @@ void AbstractProcessStep::taskAdded(const ProjectExplorer::Task &task)
} }
} }
if (count == 1) if (count == 1)
editable.file = possibleFilePath; editable.file = Utils::FileName::fromString(possibleFilePath);
else else
qWarning() << "Could not find absolute location of file " << filePath; qWarning() << "Could not find absolute location of file " << filePath;
} }

View File

@@ -159,9 +159,9 @@ BuildManager::BuildManager(ProjectExplorerPlugin *parent)
void BuildManager::extensionsInitialized() void BuildManager::extensionsInitialized()
{ {
d->m_taskHub->addCategory(QLatin1String(Constants::TASK_CATEGORY_COMPILE), d->m_taskHub->addCategory(Core::Id(Constants::TASK_CATEGORY_COMPILE),
tr("Compile", "Category for compiler issues listed under 'Issues'")); tr("Compile", "Category for compiler issues listed under 'Issues'"));
d->m_taskHub->addCategory(QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM), d->m_taskHub->addCategory(Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM),
tr("Build System", "Category for build system issues listed under 'Issues'")); tr("Build System", "Category for build system issues listed under 'Issues'"));
} }
@@ -200,8 +200,8 @@ bool BuildManager::isBuilding() const
int BuildManager::getErrorTaskCount() const int BuildManager::getErrorTaskCount() const
{ {
const int errors = const int errors =
d->m_taskWindow->errorTaskCount(QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM)) d->m_taskWindow->errorTaskCount(Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))
+ d->m_taskWindow->errorTaskCount(QLatin1String(Constants::TASK_CATEGORY_COMPILE)); + d->m_taskWindow->errorTaskCount(Core::Id(Constants::TASK_CATEGORY_COMPILE));
return errors; return errors;
} }
@@ -305,8 +305,8 @@ void BuildManager::toggleTaskWindow()
bool BuildManager::tasksAvailable() const bool BuildManager::tasksAvailable() const
{ {
const int count = const int count =
d->m_taskWindow->taskCount(QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM)) d->m_taskWindow->taskCount(Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))
+ d->m_taskWindow->taskCount(QLatin1String(Constants::TASK_CATEGORY_COMPILE)); + d->m_taskWindow->taskCount(Core::Id(Constants::TASK_CATEGORY_COMPILE));
return count > 0; return count > 0;
} }
@@ -322,8 +322,8 @@ void BuildManager::startBuildQueue()
d->m_progressFutureInterface = new QFutureInterface<void>; d->m_progressFutureInterface = new QFutureInterface<void>;
d->m_progressWatcher.setFuture(d->m_progressFutureInterface->future()); d->m_progressWatcher.setFuture(d->m_progressFutureInterface->future());
d->m_outputWindow->clearContents(); d->m_outputWindow->clearContents();
d->m_taskHub->clearTasks(QLatin1String(Constants::TASK_CATEGORY_COMPILE)); d->m_taskHub->clearTasks(Core::Id(Constants::TASK_CATEGORY_COMPILE));
d->m_taskHub->clearTasks(QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM)); d->m_taskHub->clearTasks(Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
progressManager->setApplicationLabel(QString()); progressManager->setApplicationLabel(QString());
d->m_futureProgress = QWeakPointer<Core::FutureProgress>(progressManager->addTask(d->m_progressFutureInterface->future(), d->m_futureProgress = QWeakPointer<Core::FutureProgress>(progressManager->addTask(d->m_progressFutureInterface->future(),
QString(), QString(),

View File

@@ -89,8 +89,8 @@ void BuildProgress::updateState()
{ {
if (!m_taskWindow) if (!m_taskWindow)
return; return;
int errors = m_taskWindow->errorTaskCount(QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM)) int errors = m_taskWindow->errorTaskCount(Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))
+ m_taskWindow->errorTaskCount(QLatin1String(Constants::TASK_CATEGORY_COMPILE)); + m_taskWindow->errorTaskCount(Core::Id(Constants::TASK_CATEGORY_COMPILE));
bool haveErrors = (errors > 0); bool haveErrors = (errors > 0);
m_errorIcon->setEnabled(haveErrors); m_errorIcon->setEnabled(haveErrors);
m_errorLabel->setEnabled(haveErrors); m_errorLabel->setEnabled(haveErrors);

View File

@@ -72,9 +72,9 @@ void ClangParser::stdError(const QString &line)
m_expectSnippet = true; m_expectSnippet = true;
newTask(Task::Error, newTask(Task::Error,
m_commandRegExp.cap(4), m_commandRegExp.cap(4),
QString(), /* filename */ Utils::FileName(), /* filename */
-1, /* line */ -1, /* line */
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
if (m_commandRegExp.cap(3) == QLatin1String("warning")) if (m_commandRegExp.cap(3) == QLatin1String("warning"))
m_currentTask.type = Task::Warning; m_currentTask.type = Task::Warning;
else if (m_commandRegExp.cap(3) == QLatin1String("note")) else if (m_commandRegExp.cap(3) == QLatin1String("note"))
@@ -86,9 +86,9 @@ void ClangParser::stdError(const QString &line)
m_expectSnippet = true; m_expectSnippet = true;
newTask(Task::Unknown, newTask(Task::Unknown,
lne.trimmed(), lne.trimmed(),
m_inLineRegExp.cap(2), /* filename */ Utils::FileName::fromUserInput(m_inLineRegExp.cap(2)), /* filename */
m_inLineRegExp.cap(3).toInt(), /* line */ m_inLineRegExp.cap(3).toInt(), /* line */
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
return; return;
} }
@@ -100,9 +100,9 @@ void ClangParser::stdError(const QString &line)
lineNo = m_messageRegExp.cap(5).toInt(&ok); lineNo = m_messageRegExp.cap(5).toInt(&ok);
newTask(Task::Error, newTask(Task::Error,
m_messageRegExp.cap(8), m_messageRegExp.cap(8),
m_messageRegExp.cap(1), /* filename */ Utils::FileName::fromUserInput(m_messageRegExp.cap(1)), /* filename */
lineNo, lineNo,
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
if (m_messageRegExp.cap(7) == QLatin1String("warning")) if (m_messageRegExp.cap(7) == QLatin1String("warning"))
m_currentTask.type = Task::Warning; m_currentTask.type = Task::Warning;
else if (m_messageRegExp.cap(7) == QLatin1String("note")) else if (m_messageRegExp.cap(7) == QLatin1String("note"))
@@ -126,7 +126,7 @@ void ClangParser::stdError(const QString &line)
} }
void ClangParser::newTask(Task::TaskType type_, const QString &description_, void ClangParser::newTask(Task::TaskType type_, const QString &description_,
const QString &file_, int line_, const QString &category_) const Utils::FileName &file_, int line_, const Core::Id &category_)
{ {
emitTask(); emitTask();
m_currentTask = Task(type_, description_, file_, line_, category_); m_currentTask = Task(type_, description_, file_, line_, category_);
@@ -157,7 +157,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data()
QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); QTest::addColumn<QList<ProjectExplorer::Task> >("tasks");
QTest::addColumn<QString>("outputLines"); QTest::addColumn<QString>("outputLines");
const QString categoryCompile = QLatin1String(Constants::TASK_CATEGORY_COMPILE); const Core::Id categoryCompile = Core::Id(Constants::TASK_CATEGORY_COMPILE);
QTest::newRow("pass-through stdout") QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
@@ -177,7 +177,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("argument unused during compilation: '-mthreads'"), QLatin1String("argument unused during compilation: '-mthreads'"),
QString(), -1, Utils::FileName(), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("clang++ error") QTest::newRow("clang++ error")
@@ -187,7 +187,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("no input files [err_drv_no_input_files]"), QLatin1String("no input files [err_drv_no_input_files]"),
QString(), -1, Utils::FileName(), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("complex warning") QTest::newRow("complex warning")
@@ -200,13 +200,13 @@ void ProjectExplorerPlugin::testClangOutputParser_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In file included from ..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h:45:"), QLatin1String("In file included from ..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h:45:"),
QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h"), 45, Utils::FileName::fromUserInput("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h"), 45,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("unknown attribute 'dllimport' ignored [-Wunknown-attributes]\n" QLatin1String("unknown attribute 'dllimport' ignored [-Wunknown-attributes]\n"
"class Q_CORE_EXPORT QSysInfo {\n" "class Q_CORE_EXPORT QSysInfo {\n"
" ^"), " ^"),
QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h"), 1425, Utils::FileName::fromUserInput("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h"), 1425,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("note") QTest::newRow("note")
@@ -220,7 +220,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data()
QLatin1String("instantiated from:\n" QLatin1String("instantiated from:\n"
"# define Q_CORE_EXPORT Q_DECL_IMPORT\n" "# define Q_CORE_EXPORT Q_DECL_IMPORT\n"
" ^"), " ^"),
QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h"), 1289, Utils::FileName::fromUserInput("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h"), 1289,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("fatal error") QTest::newRow("fatal error")
@@ -234,7 +234,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data()
QLatin1String("'bits/c++config.h' file not found\n" QLatin1String("'bits/c++config.h' file not found\n"
"#include <bits/c++config.h>\n" "#include <bits/c++config.h>\n"
" ^"), " ^"),
QLatin1String("/usr/include/c++/4.6/utility"), 68, Utils::FileName::fromUserInput("/usr/include/c++/4.6/utility"), 68,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -249,7 +249,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data()
QLatin1String("?: has lower precedence than +; + will be evaluated first [-Wparentheses]\n" QLatin1String("?: has lower precedence than +; + will be evaluated first [-Wparentheses]\n"
" int x = option->rect.x() + horizontal ? 2 : 6;\n" " int x = option->rect.x() + horizontal ? 2 : 6;\n"
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^"), " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^"),
QLatin1String("/home/code/src/creator/src/plugins/coreplugin/manhattanstyle.cpp"), 567, Utils::FileName::fromUserInput("/home/code/src/creator/src/plugins/coreplugin/manhattanstyle.cpp"), 567,
categoryCompile)) categoryCompile))
<< QString(); << QString();
} }

View File

@@ -51,7 +51,7 @@ public:
private: private:
void newTask(Task::TaskType type_, const QString &description_, void newTask(Task::TaskType type_, const QString &description_,
const QString &file_, int line_, const QString &category_); const Utils::FileName &file_, int line_, const Core::Id &category_);
void emitTask(); void emitTask();

View File

@@ -63,7 +63,7 @@ void CopyTaskHandler::handle(const ProjectExplorer::Task &task)
break; break;
} }
QApplication::clipboard()->setText(QDir::toNativeSeparators(task.file) + QLatin1Char(':') + QApplication::clipboard()->setText(task.file.toUserOutput() + QLatin1Char(':') +
QString::number(task.line) + QLatin1String(": ") QString::number(task.line) + QLatin1String(": ")
+ type + task.description); + type + task.description);
} }

View File

@@ -79,17 +79,17 @@ void GccParser::stdError(const QString &line)
lne == QLatin1String("* cpp failed")) { lne == QLatin1String("* cpp failed")) {
emit addTask(Task(Task::Error, emit addTask(Task(Task::Error,
lne /* description */, lne /* description */,
QString() /* filename */, Utils::FileName() /* filename */,
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(Constants::TASK_CATEGORY_COMPILE))); Core::Id(Constants::TASK_CATEGORY_COMPILE)));
return; return;
} else if (m_regExpGccNames.indexIn(lne) > -1) { } else if (m_regExpGccNames.indexIn(lne) > -1) {
QString description = lne.mid(m_regExpGccNames.matchedLength()); QString description = lne.mid(m_regExpGccNames.matchedLength());
Task task(Task::Error, Task task(Task::Error,
description, description,
QString(), /* filename */ Utils::FileName(), /* filename */
-1, /* line */ -1, /* line */
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
if (description.startsWith(QLatin1String("warning: "))) { if (description.startsWith(QLatin1String("warning: "))) {
task.type = Task::Warning; task.type = Task::Warning;
task.description = description.mid(9); task.description = description.mid(9);
@@ -99,12 +99,12 @@ void GccParser::stdError(const QString &line)
emit addTask(task); emit addTask(task);
return; return;
} else if (m_regExp.indexIn(lne) > -1) { } else if (m_regExp.indexIn(lne) > -1) {
QString filename = m_regExp.cap(1); Utils::FileName filename = Utils::FileName::fromUserInput(m_regExp.cap(1));
int lineno = m_regExp.cap(3).toInt(); int lineno = m_regExp.cap(3).toInt();
Task task(Task::Unknown, Task task(Task::Unknown,
m_regExp.cap(8) /* description */, m_regExp.cap(8) /* description */,
filename, lineno, filename, lineno,
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
if (m_regExp.cap(7) == QLatin1String("warning")) if (m_regExp.cap(7) == QLatin1String("warning"))
task.type = Task::Warning; task.type = Task::Warning;
else if (m_regExp.cap(7) == QLatin1String("error") || else if (m_regExp.cap(7) == QLatin1String("error") ||
@@ -121,9 +121,9 @@ void GccParser::stdError(const QString &line)
} else if (m_regExpIncluded.indexIn(lne) > -1) { } else if (m_regExpIncluded.indexIn(lne) > -1) {
emit addTask(Task(Task::Unknown, emit addTask(Task(Task::Unknown,
lne /* description */, lne /* description */,
m_regExpIncluded.cap(1) /* filename */, Utils::FileName::fromUserInput(m_regExpIncluded.cap(1)) /* filename */,
m_regExpIncluded.cap(3).toInt() /* linenumber */, m_regExpIncluded.cap(3).toInt() /* linenumber */,
QLatin1String(Constants::TASK_CATEGORY_COMPILE))); Core::Id(Constants::TASK_CATEGORY_COMPILE)));
return; return;
} }
IOutputParser::stdError(line); IOutputParser::stdError(line);
@@ -147,7 +147,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); QTest::addColumn<QList<ProjectExplorer::Task> >("tasks");
QTest::addColumn<QString>("outputLines"); QTest::addColumn<QString>("outputLines");
const QString categoryCompile = QLatin1String(Constants::TASK_CATEGORY_COMPILE); const Core::Id categoryCompile = Core::Id(Constants::TASK_CATEGORY_COMPILE);
QTest::newRow("pass-through stdout") QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
@@ -169,15 +169,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In function `int main(int, char**)':"), QLatin1String("In function `int main(int, char**)':"),
QLatin1String("/temp/test/untitled8/main.cpp"), -1, Utils::FileName::fromUserInput("/temp/test/untitled8/main.cpp"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("`sfasdf' undeclared (first use this function)"), QLatin1String("`sfasdf' undeclared (first use this function)"),
QLatin1String("/temp/test/untitled8/main.cpp"), 9, Utils::FileName::fromUserInput("/temp/test/untitled8/main.cpp"), 9,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("(Each undeclared identifier is reported only once for each function it appears in.)"), QLatin1String("(Each undeclared identifier is reported only once for each function it appears in.)"),
QLatin1String("/temp/test/untitled8/main.cpp"), 9, Utils::FileName::fromUserInput("/temp/test/untitled8/main.cpp"), 9,
categoryCompile) categoryCompile)
) )
<< QString(); << QString();
@@ -188,7 +188,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("inline function `QDebug qDebug()' used but never defined"), QLatin1String("inline function `QDebug qDebug()' used but never defined"),
QLatin1String("/src/corelib/global/qglobal.h"), 1635, Utils::FileName::fromUserInput("/src/corelib/global/qglobal.h"), 1635,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("warning") QTest::newRow("warning")
@@ -197,7 +197,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< QString() << QString() << QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning, << (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("Some warning"), QLatin1String("Some warning"),
QLatin1String("main.cpp"), 7, Utils::FileName::fromUserInput("main.cpp"), 7,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("GCCE #error") QTest::newRow("GCCE #error")
@@ -206,7 +206,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< QString() << QString() << QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Error, << (QList<ProjectExplorer::Task>() << Task(Task::Error,
QLatin1String("#error Symbian error"), QLatin1String("#error Symbian error"),
QLatin1String("C:\\temp\\test\\untitled8\\main.cpp"), 7, Utils::FileName::fromUserInput("C:\\temp\\test\\untitled8\\main.cpp"), 7,
categoryCompile)) categoryCompile))
<< QString(); << QString();
// Symbian reports #warning(s) twice (using different syntax). // Symbian reports #warning(s) twice (using different syntax).
@@ -216,7 +216,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< QString() << QString() << QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning, << (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("#warning Symbian warning"), QLatin1String("#warning Symbian warning"),
QLatin1String("C:\\temp\\test\\untitled8\\main.cpp"), 8, Utils::FileName::fromUserInput("C:\\temp\\test\\untitled8\\main.cpp"), 8,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("GCCE #warning2") QTest::newRow("GCCE #warning2")
@@ -225,7 +225,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< QString() << QString() << QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning, << (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("#warning Symbian warning"), QLatin1String("#warning Symbian warning"),
QLatin1String("/temp/test/untitled8/main.cpp"), 8, Utils::FileName::fromUserInput("/temp/test/untitled8/main.cpp"), 8,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("Undefined reference (debug)") QTest::newRow("Undefined reference (debug)")
@@ -237,15 +237,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In function `main':"), QLatin1String("In function `main':"),
QLatin1String("main.o"), -1, Utils::FileName::fromUserInput("main.o"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("undefined reference to `MainWindow::doSomething()'"), QLatin1String("undefined reference to `MainWindow::doSomething()'"),
QLatin1String("C:\\temp\\test\\untitled8/main.cpp"), 8, Utils::FileName::fromUserInput("C:\\temp\\test\\untitled8/main.cpp"), 8,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("collect2: ld returned 1 exit status"), QLatin1String("collect2: ld returned 1 exit status"),
QString(), -1, Utils::FileName(), -1,
categoryCompile) categoryCompile)
) )
<< QString(); << QString();
@@ -258,15 +258,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In function `main':"), QLatin1String("In function `main':"),
QLatin1String("main.o"), -1, Utils::FileName::fromUserInput("main.o"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("undefined reference to `MainWindow::doSomething()'"), QLatin1String("undefined reference to `MainWindow::doSomething()'"),
QLatin1String("C:\\temp\\test\\untitled8/main.cpp"), -1, Utils::FileName::fromUserInput("C:\\temp\\test\\untitled8/main.cpp"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("collect2: ld returned 1 exit status"), QLatin1String("collect2: ld returned 1 exit status"),
QString(), -1, Utils::FileName(), -1,
categoryCompile) categoryCompile)
) )
<< QString(); << QString();
@@ -277,7 +277,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("file not recognized: File format not recognized"), QLatin1String("file not recognized: File format not recognized"),
QLatin1String("c:\\Qt\\4.6\\lib/QtGuid4.dll"), -1, Utils::FileName::fromUserInput("c:\\Qt\\4.6\\lib/QtGuid4.dll"), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("Invalid rpath") QTest::newRow("Invalid rpath")
@@ -287,7 +287,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("/usr/local/lib: No such file or directory"), QLatin1String("/usr/local/lib: No such file or directory"),
QString(), -1, Utils::FileName(), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -300,15 +300,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In member function 'void Debugger::Internal::GdbEngine::handleBreakInsert2(const Debugger::Internal::GdbResponse&)':"), QLatin1String("In member function 'void Debugger::Internal::GdbEngine::handleBreakInsert2(const Debugger::Internal::GdbResponse&)':"),
QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), -1, Utils::FileName::fromUserInput("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("unused variable 'index'"), QLatin1String("unused variable 'index'"),
QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), 2114, Utils::FileName::fromUserInput("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), 2114,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("unused variable 'handler'"), QLatin1String("unused variable 'handler'"),
QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), 2115, Utils::FileName::fromUserInput("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), 2115,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("gnumakeparser.cpp errors") QTest::newRow("gnumakeparser.cpp errors")
@@ -320,15 +320,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In member function 'void ProjectExplorer::ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data()':"), QLatin1String("In member function 'void ProjectExplorer::ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data()':"),
QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), -1, Utils::FileName::fromUserInput("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("expected primary-expression before ':' token"), QLatin1String("expected primary-expression before ':' token"),
QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), 264, Utils::FileName::fromUserInput("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), 264,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("expected ';' before ':' token"), QLatin1String("expected ';' before ':' token"),
QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), 264, Utils::FileName::fromUserInput("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), 264,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("distcc error(QTCREATORBUG-904)") QTest::newRow("distcc error(QTCREATORBUG-904)")
@@ -346,7 +346,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("Core::IEditor* QVariant::value<Core::IEditor*>() const has different visibility (hidden) in .obj/debug-shared/openeditorsview.o and (default) in .obj/debug-shared/editormanager.o"), QLatin1String("Core::IEditor* QVariant::value<Core::IEditor*>() const has different visibility (hidden) in .obj/debug-shared/openeditorsview.o and (default) in .obj/debug-shared/editormanager.o"),
QString(), -1, Utils::FileName(), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("ld fatal") QTest::newRow("ld fatal")
@@ -356,7 +356,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("Symbol referencing errors. No output written to testproject"), QLatin1String("Symbol referencing errors. No output written to testproject"),
QString(), -1, Utils::FileName(), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("Teambuilder issues") QTest::newRow("Teambuilder issues")
@@ -372,7 +372,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("initialized from here"), QLatin1String("initialized from here"),
QString::fromLatin1("/home/dev/creator/share/qtcreator/dumper/dumper.cpp"), 1079, Utils::FileName::fromUserInput("/home/dev/creator/share/qtcreator/dumper/dumper.cpp"), 1079,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("static member function") QTest::newRow("static member function")
@@ -383,11 +383,11 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In static member function 'static std::_Rb_tree_node_base* std::_Rb_global<_Dummy>::_Rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&)':"), QLatin1String("In static member function 'static std::_Rb_tree_node_base* std::_Rb_global<_Dummy>::_Rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&)':"),
QString::fromLatin1("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c"), -1, Utils::FileName::fromUserInput("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("suggest explicit braces to avoid ambiguous 'else'"), QLatin1String("suggest explicit braces to avoid ambiguous 'else'"),
QString::fromLatin1("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c"), 194, Utils::FileName::fromUserInput("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c"), 194,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("rm false positive") QTest::newRow("rm false positive")
@@ -409,7 +409,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("cannot find -ldoesnotexist"), QLatin1String("cannot find -ldoesnotexist"),
QString(), -1, Utils::FileName(), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("In function") QTest::newRow("In function")
@@ -421,15 +421,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In function void foo(i) [with i = double]:"), QLatin1String("In function void foo(i) [with i = double]:"),
QLatin1String("../../scriptbug/main.cpp"), -1, Utils::FileName::fromUserInput("../../scriptbug/main.cpp"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("instantiated from here"), QLatin1String("instantiated from here"),
QLatin1String("../../scriptbug/main.cpp"), 22, Utils::FileName::fromUserInput("../../scriptbug/main.cpp"), 22,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("unused variable c"), QLatin1String("unused variable c"),
QLatin1String("../../scriptbug/main.cpp"), 8, Utils::FileName::fromUserInput("../../scriptbug/main.cpp"), 8,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("instanciated from here") QTest::newRow("instanciated from here")
@@ -439,7 +439,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("instantiated from here"), QLatin1String("instantiated from here"),
QLatin1String("main.cpp"), 10, Utils::FileName::fromUserInput("main.cpp"), 10,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("In constructor") QTest::newRow("In constructor")
@@ -449,7 +449,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In constructor 'Find::BaseTextFind::BaseTextFind(QTextEdit*)':"), QLatin1String("In constructor 'Find::BaseTextFind::BaseTextFind(QTextEdit*)':"),
QLatin1String("/dev/creator/src/plugins/find/basetextfind.h"), -1, Utils::FileName::fromUserInput("/dev/creator/src/plugins/find/basetextfind.h"), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -464,23 +464,23 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("At global scope:"), QLatin1String("At global scope:"),
QLatin1String("../../scriptbug/main.cpp"), -1, Utils::FileName::fromUserInput("../../scriptbug/main.cpp"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In instantiation of void bar(i) [with i = double]:"), QLatin1String("In instantiation of void bar(i) [with i = double]:"),
QLatin1String("../../scriptbug/main.cpp"), -1, Utils::FileName::fromUserInput("../../scriptbug/main.cpp"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("instantiated from void foo(i) [with i = double]"), QLatin1String("instantiated from void foo(i) [with i = double]"),
QLatin1String("../../scriptbug/main.cpp"), 8, Utils::FileName::fromUserInput("../../scriptbug/main.cpp"), 8,
categoryCompile) categoryCompile)
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("instantiated from here"), QLatin1String("instantiated from here"),
QLatin1String("../../scriptbug/main.cpp"), 22, Utils::FileName::fromUserInput("../../scriptbug/main.cpp"), 22,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("unused parameter v"), QLatin1String("unused parameter v"),
QLatin1String("../../scriptbug/main.cpp"), 5, Utils::FileName::fromUserInput("../../scriptbug/main.cpp"), 5,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -491,7 +491,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("test.moc: No such file or directory"), QLatin1String("test.moc: No such file or directory"),
QLatin1String("/home/code/test.cpp"), 54, Utils::FileName::fromUserInput("/home/code/test.cpp"), 54,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -505,19 +505,19 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In function `QPlotAxis':"), QLatin1String("In function `QPlotAxis':"),
QLatin1String("debug/qplotaxis.o"), -1, Utils::FileName::fromUserInput("debug/qplotaxis.o"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("undefined reference to `vtable for QPlotAxis'"), QLatin1String("undefined reference to `vtable for QPlotAxis'"),
QLatin1String("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), 26, Utils::FileName::fromUserInput("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), 26,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("undefined reference to `vtable for QPlotAxis'"), QLatin1String("undefined reference to `vtable for QPlotAxis'"),
QLatin1String("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), 26, Utils::FileName::fromUserInput("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), 26,
categoryCompile) categoryCompile)
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("collect2: ld returned 1 exit status"), QLatin1String("collect2: ld returned 1 exit status"),
QString(), -1, Utils::FileName(), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -532,23 +532,23 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In member function typename _Vector_base<_Tp, _Alloc>::_Tp_alloc_type::const_reference Vector<_Tp, _Alloc>::at(int) [with _Tp = Point, _Alloc = Allocator<Point>]:"), QLatin1String("In member function typename _Vector_base<_Tp, _Alloc>::_Tp_alloc_type::const_reference Vector<_Tp, _Alloc>::at(int) [with _Tp = Point, _Alloc = Allocator<Point>]:"),
QLatin1String("../stl/main.cpp"), -1, Utils::FileName::fromUserInput("../stl/main.cpp"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("instantiated from here"), QLatin1String("instantiated from here"),
QLatin1String("../stl/main.cpp"), 38, Utils::FileName::fromUserInput("../stl/main.cpp"), 38,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("returning reference to temporary"), QLatin1String("returning reference to temporary"),
QLatin1String("../stl/main.cpp"), 31, Utils::FileName::fromUserInput("../stl/main.cpp"), 31,
categoryCompile) categoryCompile)
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("At global scope:"), QLatin1String("At global scope:"),
QLatin1String("../stl/main.cpp"), -1, Utils::FileName::fromUserInput("../stl/main.cpp"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("unused parameter index"), QLatin1String("unused parameter index"),
QLatin1String("../stl/main.cpp"), 31, Utils::FileName::fromUserInput("../stl/main.cpp"), 31,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -562,19 +562,19 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In file included from C:/Symbian_SDK/epoc32/include/e32cmn.h:6792,"), QLatin1String("In file included from C:/Symbian_SDK/epoc32/include/e32cmn.h:6792,"),
QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.h"), 6792, Utils::FileName::fromUserInput("C:/Symbian_SDK/epoc32/include/e32cmn.h"), 6792,
categoryCompile) categoryCompile)
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("from C:/Symbian_SDK/epoc32/include/e32std.h:25,"), QLatin1String("from C:/Symbian_SDK/epoc32/include/e32std.h:25,"),
QLatin1String("C:/Symbian_SDK/epoc32/include/e32std.h"), 25, Utils::FileName::fromUserInput("C:/Symbian_SDK/epoc32/include/e32std.h"), 25,
categoryCompile) categoryCompile)
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In member function 'SSecureId::operator const TSecureId&() const':"), QLatin1String("In member function 'SSecureId::operator const TSecureId&() const':"),
QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.inl"), -1, Utils::FileName::fromUserInput("C:/Symbian_SDK/epoc32/include/e32cmn.inl"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("returning reference to temporary"), QLatin1String("returning reference to temporary"),
QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.inl"), 7094, Utils::FileName::fromUserInput("C:/Symbian_SDK/epoc32/include/e32cmn.inl"), 7094,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -585,7 +585,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("At top level:"), QLatin1String("At top level:"),
QLatin1String("../../../src/XmlUg/targetdelete.c"), -1, Utils::FileName::fromUserInput("../../../src/XmlUg/targetdelete.c"), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -598,15 +598,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In file included from /Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h:15,"), QLatin1String("In file included from /Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h:15,"),
QLatin1String("/Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h"), 15, Utils::FileName::fromUserInput("/Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h"), 15,
categoryCompile) categoryCompile)
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("from <command line>:26:"), QLatin1String("from <command line>:26:"),
QLatin1String("<command line>"), 26, Utils::FileName::fromUserInput("<command line>"), 26,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("no newline at end of file"), QLatin1String("no newline at end of file"),
QLatin1String("/Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh"), 1134, Utils::FileName::fromUserInput("/Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh"), 1134,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -617,7 +617,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("undefined reference to `MainWindow::doSomething()'"), QLatin1String("undefined reference to `MainWindow::doSomething()'"),
QLatin1String("main.cpp"), -1, Utils::FileName::fromUserInput("main.cpp"), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -629,11 +629,11 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In member function 'ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateConditionalFunction(const ProString&, const ProStringList&)':"), QLatin1String("In member function 'ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateConditionalFunction(const ProString&, const ProStringList&)':"),
QLatin1String("../../../src/shared/proparser/profileevaluator.cpp"), -1, Utils::FileName::fromUserInput("../../../src/shared/proparser/profileevaluator.cpp"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("case value '0' not in enumerated type 'ProFileEvaluator::Private::TestFunc'"), QLatin1String("case value '0' not in enumerated type 'ProFileEvaluator::Private::TestFunc'"),
QLatin1String("../../../src/shared/proparser/profileevaluator.cpp"), 2817, Utils::FileName::fromUserInput("../../../src/shared/proparser/profileevaluator.cpp"), 2817,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -645,11 +645,11 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In file included from <command-line>:0:0:"), QLatin1String("In file included from <command-line>:0:0:"),
QLatin1String("<command-line>"), 0, Utils::FileName::fromUserInput("<command-line>"), 0,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("\"STUPID_DEFINE\" redefined"), QLatin1String("\"STUPID_DEFINE\" redefined"),
QLatin1String("./mw.h"), 4, Utils::FileName::fromUserInput("./mw.h"), 4,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("instanciation with line:column info") QTest::newRow("instanciation with line:column info")
@@ -661,15 +661,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("In function 'void UnitTest::CheckEqual(UnitTest::TestResults&, const Expected&, const Actual&, const UnitTest::TestDetails&) [with Expected = unsigned int, Actual = int]':"), QLatin1String("In function 'void UnitTest::CheckEqual(UnitTest::TestResults&, const Expected&, const Actual&, const UnitTest::TestDetails&) [with Expected = unsigned int, Actual = int]':"),
QLatin1String("file.h"), -1, Utils::FileName::fromUserInput("file.h"), -1,
categoryCompile) categoryCompile)
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("instantiated from here"), QLatin1String("instantiated from here"),
QLatin1String("file.cpp"), 87, Utils::FileName::fromUserInput("file.cpp"), 87,
categoryCompile) categoryCompile)
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("comparison between signed and unsigned integer expressions [-Wsign-compare]"), QLatin1String("comparison between signed and unsigned integer expressions [-Wsign-compare]"),
QLatin1String("file.h"), 21, Utils::FileName::fromUserInput("file.h"), 21,
categoryCompile)) categoryCompile))
<< QString(); << QString();
QTest::newRow("linker error") // QTCREATORBUG-3107 QTest::newRow("linker error") // QTCREATORBUG-3107
@@ -679,7 +679,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("undefined reference to `CNS5kINSPacket::SOH_BYTE'"), QLatin1String("undefined reference to `CNS5kINSPacket::SOH_BYTE'"),
QLatin1String("cns5k_ins_parser_tests.cpp"), -1, Utils::FileName::fromUserInput("cns5k_ins_parser_tests.cpp"), -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -690,7 +690,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("The name 'pushButton' (QPushButton) is already in use, defaulting to 'pushButton1'."), QLatin1String("The name 'pushButton' (QPushButton) is already in use, defaulting to 'pushButton1'."),
QLatin1String("mainwindow.ui"), -1, Utils::FileName::fromUserInput("mainwindow.ui"), -1,
Constants::TASK_CATEGORY_COMPILE)) Constants::TASK_CATEGORY_COMPILE))
<< QString(); << QString();
@@ -701,7 +701,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< ( QList<ProjectExplorer::Task>() << ( QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("warning: feupdateenv is not implemented and will always fail"), QLatin1String("warning: feupdateenv is not implemented and will always fail"),
QLatin1String("libimf.so"), -1, Utils::FileName::fromUserInput("libimf.so"), -1,
Constants::TASK_CATEGORY_COMPILE)) Constants::TASK_CATEGORY_COMPILE))
<< QString(); << QString();
} }

View File

@@ -95,9 +95,9 @@ void GnuMakeParser::stdError(const QString &line)
m_suppressIssues = true; m_suppressIssues = true;
addTask(Task(Task::Error, addTask(Task(Task::Error,
m_makefileError.cap(3), m_makefileError.cap(3),
m_makefileError.cap(1), Utils::FileName::fromUserInput(m_makefileError.cap(1)),
m_makefileError.cap(2).toInt(), m_makefileError.cap(2).toInt(),
QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
return; return;
} }
@@ -108,9 +108,9 @@ void GnuMakeParser::stdError(const QString &line)
m_suppressIssues = true; m_suppressIssues = true;
addTask(Task(Task::Error, addTask(Task(Task::Error,
m_makeLine.cap(8), m_makeLine.cap(8),
QString() /* filename */, Utils::FileName() /* filename */,
-1, /* line */ -1, /* line */
QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
return; return;
} }
@@ -139,7 +139,7 @@ void GnuMakeParser::taskAdded(const Task &task)
m_suppressIssues = true; m_suppressIssues = true;
} }
QString filePath(QDir::cleanPath(task.file.trimmed())); QString filePath(task.file.toString());
if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) { if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) {
QList<QFileInfo> possibleFiles; QList<QFileInfo> possibleFiles;
@@ -151,7 +151,7 @@ void GnuMakeParser::taskAdded(const Task &task)
} }
} }
if (possibleFiles.size() == 1) if (possibleFiles.size() == 1)
editable.file = possibleFiles.first().filePath(); editable.file = Utils::FileName(possibleFiles.first());
// Let the Makestep apply additional heuristics (based on // Let the Makestep apply additional heuristics (based on
// files in ther project) if we can not uniquely // files in ther project) if we can not uniquely
// identify the file! // identify the file!
@@ -261,8 +261,8 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data()
<< (QList<Task>() << (QList<Task>()
<< Task(Task::Error, << Task(Task::Error,
QString::fromLatin1("No rule to make target `hello.c', needed by `hello.o'. Stop."), QString::fromLatin1("No rule to make target `hello.c', needed by `hello.o'. Stop."),
QString(), -1, Utils::FileName(), -1,
QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)))
<< QString() << QString()
<< QStringList(); << QStringList();
QTest::newRow("multiple fatals") QTest::newRow("multiple fatals")
@@ -275,8 +275,8 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data()
<< (QList<Task>() << (QList<Task>()
<< Task(Task::Error, << Task(Task::Error,
QString::fromLatin1("[.obj/debug-shared/gnumakeparser.o] Error 1"), QString::fromLatin1("[.obj/debug-shared/gnumakeparser.o] Error 1"),
QString(), -1, Utils::FileName(), -1,
QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)))
<< QString() << QString()
<< QStringList(); << QStringList();
QTest::newRow("Makefile error") QTest::newRow("Makefile error")
@@ -287,8 +287,8 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data()
<< (QList<Task>() << (QList<Task>()
<< Task(Task::Error, << Task(Task::Error,
QString::fromLatin1("missing separator (did you mean TAB instead of 8 spaces?). Stop."), QString::fromLatin1("missing separator (did you mean TAB instead of 8 spaces?). Stop."),
QString::fromLatin1("Makefile"), 360, Utils::FileName::fromUserInput("Makefile"), 360,
QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)))
<< QString() << QString()
<< QStringList(); << QStringList();
QTest::newRow("mingw32-make error") QTest::newRow("mingw32-make error")
@@ -300,8 +300,8 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data()
<< (QList<Task>() << (QList<Task>()
<< Task(Task::Error, << Task(Task::Error,
QString::fromLatin1("[debug/qplotaxis.o] Error 1"), QString::fromLatin1("[debug/qplotaxis.o] Error 1"),
QString(), -1, Utils::FileName(), -1,
QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)))
<< QString() << QString()
<< QStringList(); << QStringList();
QTest::newRow("mingw64-make error") QTest::newRow("mingw64-make error")
@@ -312,8 +312,8 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data()
<< (QList<Task>() << (QList<Task>()
<< Task(Task::Error, << Task(Task::Error,
QString::fromLatin1("[dynlib.inst] Error -1073741819"), QString::fromLatin1("[dynlib.inst] Error -1073741819"),
QString(), -1, Utils::FileName(), -1,
QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)))
<< QString() << QString()
<< QStringList(); << QStringList();
QTest::newRow("pass-trough note") QTest::newRow("pass-trough note")
@@ -332,8 +332,8 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data()
<< (QList<Task>() << (QList<Task>()
<< Task(Task::Error, << Task(Task::Error,
QString::fromLatin1("[sis] Error 2"), QString::fromLatin1("[sis] Error 2"),
QString(), -1, Utils::FileName(), -1,
QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)))
<< QString() << QString()
<< QStringList(); << QStringList();
QTest::newRow("missing g++") QTest::newRow("missing g++")
@@ -344,8 +344,8 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data()
<< (QList<Task>() << (QList<Task>()
<< Task(Task::Error, << Task(Task::Error,
QString::fromLatin1("g++: Command not found"), QString::fromLatin1("g++: Command not found"),
QString(), -1, Utils::FileName(), -1,
QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)))
<< QString() << QString()
<< QStringList(); << QStringList();
} }
@@ -407,40 +407,40 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data()
<< QStringList() << QStringList()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("no filename, no mangling"), QLatin1String("no filename, no mangling"),
QString(), Utils::FileName(),
-1, -1,
QLatin1String(Constants::TASK_CATEGORY_COMPILE)) Core::Id(Constants::TASK_CATEGORY_COMPILE))
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("no filename, no mangling"), QLatin1String("no filename, no mangling"),
QString(), Utils::FileName(),
-1, -1,
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
QTest::newRow("no mangling") QTest::newRow("no mangling")
<< QStringList() << QStringList()
<< QStringList() << QStringList()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("unknown filename, no mangling"), QLatin1String("unknown filename, no mangling"),
QString::fromLatin1("some/path/unknown.cpp"), Utils::FileName::fromUserInput("some/path/unknown.cpp"),
-1, -1,
QLatin1String(Constants::TASK_CATEGORY_COMPILE)) Core::Id(Constants::TASK_CATEGORY_COMPILE))
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("unknown filename, no mangling"), QLatin1String("unknown filename, no mangling"),
QString::fromLatin1("some/path/unknown.cpp"), Utils::FileName::fromUserInput("some/path/unknown.cpp"),
-1, -1,
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
QTest::newRow("find file") QTest::newRow("find file")
<< (QStringList(QLatin1String("test/file.cpp"))) << (QStringList(QLatin1String("test/file.cpp")))
<< (QStringList(QLatin1String("test"))) << (QStringList(QLatin1String("test")))
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("mangling"), QLatin1String("mangling"),
QString::fromLatin1("file.cpp"), Utils::FileName::fromUserInput("file.cpp"),
10, 10,
QLatin1String(Constants::TASK_CATEGORY_COMPILE)) Core::Id(Constants::TASK_CATEGORY_COMPILE))
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("mangling"), QLatin1String("mangling"),
QString::fromLatin1("$TMPDIR/test/file.cpp"), Utils::FileName::fromUserInput("$TMPDIR/test/file.cpp"),
10, 10,
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
} }
void ProjectExplorerPlugin::testGnuMakeParserTaskMangling() void ProjectExplorerPlugin::testGnuMakeParserTaskMangling()
@@ -483,8 +483,9 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling()
} }
// fix up output task file: // fix up output task file:
if (outputTask.file.startsWith(QLatin1String("$TMPDIR/"))) QString filePath = outputTask.file.toString();
outputTask.file = outputTask.file.replace(QLatin1String("$TMPDIR/"), tempdir); if (filePath.startsWith(QLatin1String("$TMPDIR/")))
outputTask.file = Utils::FileName::fromString(filePath.replace(QLatin1String("$TMPDIR/"), tempdir));
// test mangling: // test mangling:
testbench.testTaskMangling(inputTask, outputTask); testbench.testTaskMangling(inputTask, outputTask);

View File

@@ -70,17 +70,17 @@ void LdParser::stdError(const QString &line)
if (lne.startsWith(QLatin1String("collect2:"))) { if (lne.startsWith(QLatin1String("collect2:"))) {
emit addTask(Task(Task::Error, emit addTask(Task(Task::Error,
lne /* description */, lne /* description */,
QString() /* filename */, Utils::FileName() /* filename */,
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(Constants::TASK_CATEGORY_COMPILE))); Core::Id(Constants::TASK_CATEGORY_COMPILE)));
return; return;
} else if (m_regExpGccNames.indexIn(lne) > -1) { } else if (m_regExpGccNames.indexIn(lne) > -1) {
QString description = lne.mid(m_regExpGccNames.matchedLength()); QString description = lne.mid(m_regExpGccNames.matchedLength());
Task task(Task::Error, Task task(Task::Error,
description, description,
QString(), /* filename */ Utils::FileName(), /* filename */
-1, /* line */ -1, /* line */
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
if (description.startsWith(QLatin1String("warning: "))) { if (description.startsWith(QLatin1String("warning: "))) {
task.type = Task::Warning; task.type = Task::Warning;
task.description = description.mid(9); task.description = description.mid(9);
@@ -94,13 +94,13 @@ void LdParser::stdError(const QString &line)
int lineno = m_regExpLinker.cap(7).toInt(&ok); int lineno = m_regExpLinker.cap(7).toInt(&ok);
if (!ok) if (!ok)
lineno = -1; lineno = -1;
QString filename = m_regExpLinker.cap(1); Utils::FileName filename = Utils::FileName::fromUserInput(m_regExpLinker.cap(1));
if (!m_regExpLinker.cap(4).isEmpty() if (!m_regExpLinker.cap(4).isEmpty()
&& !m_regExpLinker.cap(4).startsWith(QLatin1String("(.text"))) && !m_regExpLinker.cap(4).startsWith(QLatin1String("(.text")))
filename = m_regExpLinker.cap(4); filename = Utils::FileName::fromUserInput(m_regExpLinker.cap(4));
QString description = m_regExpLinker.cap(8).trimmed(); QString description = m_regExpLinker.cap(8).trimmed();
Task task(Task::Error, description, filename, lineno, Task task(Task::Error, description, filename, lineno,
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
if (description.startsWith(QLatin1String("At global scope")) || if (description.startsWith(QLatin1String("At global scope")) ||
description.startsWith(QLatin1String("At top level")) || description.startsWith(QLatin1String("At top level")) ||
description.startsWith(QLatin1String("instantiated from ")) || description.startsWith(QLatin1String("instantiated from ")) ||

View File

@@ -73,9 +73,9 @@ void LinuxIccParser::stdError(const QString &line)
if (m_expectFirstLine && m_firstLine.indexIn(line) != -1) { if (m_expectFirstLine && m_firstLine.indexIn(line) != -1) {
// Clear out old task // Clear out old task
m_temporary = ProjectExplorer::Task(Task::Unknown, m_firstLine.cap(6).trimmed(), m_temporary = ProjectExplorer::Task(Task::Unknown, m_firstLine.cap(6).trimmed(),
m_firstLine.cap(1), Utils::FileName::fromUserInput(m_firstLine.cap(1)),
m_firstLine.cap(2).toInt(), m_firstLine.cap(2).toInt(),
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
QString category = m_firstLine.cap(4); QString category = m_firstLine.cap(4);
if (category == QLatin1String("error")) if (category == QLatin1String("error"))
m_temporary.type = Task::Error; m_temporary.type = Task::Error;
@@ -126,8 +126,6 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data()
QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); QTest::addColumn<QList<ProjectExplorer::Task> >("tasks");
QTest::addColumn<QString>("outputLines"); QTest::addColumn<QString>("outputLines");
const QString categoryCompile = QLatin1String(Constants::TASK_CATEGORY_COMPILE);
QTest::newRow("pass-through stdout") QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString() << QString::fromLatin1("Sometext\n") << QString()
@@ -149,8 +147,8 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("identifier \"f\" is undefined\nf(0);"), QLatin1String("identifier \"f\" is undefined\nf(0);"),
QLatin1String("main.cpp"), 13, Utils::FileName::fromUserInput("main.cpp"), 13,
categoryCompile)) Core::Id(Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
QTest::newRow("private function") QTest::newRow("private function")
@@ -163,8 +161,8 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\nb.privatefunc();"), QLatin1String("function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\nb.privatefunc();"),
QLatin1String("main.cpp"), 53, Utils::FileName::fromUserInput("main.cpp"), 53,
categoryCompile)) Core::Id(Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
QTest::newRow("simple warning") QTest::newRow("simple warning")
@@ -177,8 +175,8 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("use of \"=\" where \"==\" may have been intended\nwhile (a = true)"), QLatin1String("use of \"=\" where \"==\" may have been intended\nwhile (a = true)"),
QLatin1String("main.cpp"), 41, Utils::FileName::fromUserInput("main.cpp"), 41,
categoryCompile)) Core::Id(Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
} }

View File

@@ -36,12 +36,12 @@
static const char FILE_POS_PATTERN[] = "(cl|LINK|.+) : "; static const char FILE_POS_PATTERN[] = "(cl|LINK|.+) : ";
static const char ERROR_PATTERN[] = "[A-Z]+\\d\\d\\d\\d ?:"; static const char ERROR_PATTERN[] = "[A-Z]+\\d\\d\\d\\d ?:";
static QPair<QString, int> parseFileName(const QString &input) static QPair<Utils::FileName, int> parseFileName(const QString &input)
{ {
QString fileName = input; QString fileName = input;
if (fileName.startsWith(QLatin1String("LINK")) if (fileName.startsWith(QLatin1String("LINK"))
|| fileName.startsWith(QLatin1String("cl"))) || fileName.startsWith(QLatin1String("cl")))
return qMakePair(QString(), -1); return qMakePair(Utils::FileName(), -1);
// Extract linenumber (if it is there): // Extract linenumber (if it is there):
int linenumber = -1; int linenumber = -1;
@@ -56,7 +56,7 @@ static QPair<QString, int> parseFileName(const QString &input)
} }
} }
} }
return qMakePair(fileName, linenumber); return qMakePair(Utils::FileName::fromUserInput(fileName), linenumber);
} }
using namespace ProjectExplorer; using namespace ProjectExplorer;
@@ -111,9 +111,9 @@ void MsvcParser::stdOutput(const QString &line)
if (infoPos > -1) { if (infoPos > -1) {
m_lastTask = Task(Task::Unknown, m_lastTask = Task(Task::Unknown,
m_additionalInfoRegExp.cap(3).trimmed(), /* description */ m_additionalInfoRegExp.cap(3).trimmed(), /* description */
m_additionalInfoRegExp.cap(1), /* fileName */ Utils::FileName::fromUserInput(m_additionalInfoRegExp.cap(1)), /* fileName */
m_additionalInfoRegExp.cap(2).toInt(), /* linenumber */ m_additionalInfoRegExp.cap(2).toInt(), /* linenumber */
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
return; return;
} }
IOutputParser::stdOutput(line); IOutputParser::stdOutput(line);
@@ -131,11 +131,11 @@ bool MsvcParser::processCompileLine(const QString &line)
sendQueuedTask(); sendQueuedTask();
if (m_compileRegExp.indexIn(line) > -1) { if (m_compileRegExp.indexIn(line) > -1) {
QPair<QString, int> position = parseFileName( m_compileRegExp.cap(1)); QPair<Utils::FileName, int> position = parseFileName( m_compileRegExp.cap(1));
m_lastTask = Task(Task::Unknown, m_lastTask = Task(Task::Unknown,
m_compileRegExp.cap(4).trimmed() /* description */, m_compileRegExp.cap(4).trimmed() /* description */,
position.first, position.second, position.first, position.second,
QLatin1String(Constants::TASK_CATEGORY_COMPILE)); Core::Id(Constants::TASK_CATEGORY_COMPILE));
if (m_compileRegExp.cap(3) == QLatin1String("warning")) if (m_compileRegExp.cap(3) == QLatin1String("warning"))
m_lastTask.type = Task::Warning; m_lastTask.type = Task::Warning;
else if (m_compileRegExp.cap(3) == QLatin1String("error")) else if (m_compileRegExp.cap(3) == QLatin1String("error"))
@@ -192,8 +192,8 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
<< QString() << QString() << QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Error, << (QList<ProjectExplorer::Task>() << Task(Task::Error,
QLatin1String("C4716: 'findUnresolvedModule' : must return a value"), QLatin1String("C4716: 'findUnresolvedModule' : must return a value"),
QLatin1String("qmlstandalone\\main.cpp"), 54, Utils::FileName::fromUserInput("qmlstandalone\\main.cpp"), 54,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
QTest::newRow("labeled warning") QTest::newRow("labeled warning")
@@ -201,8 +201,8 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
<< QString() << QString() << QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning, << (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("C4100: 'something' : unreferenced formal parameter"), QLatin1String("C4100: 'something' : unreferenced formal parameter"),
QLatin1String("x:\\src\\plugins\\projectexplorer\\msvcparser.cpp"), 69, Utils::FileName::fromUserInput("x:\\src\\plugins\\projectexplorer\\msvcparser.cpp"), 69,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
QTest::newRow("additional information") QTest::newRow("additional information")
@@ -213,12 +213,12 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("C4099: 'TextEditor::CompletionItem' : type name first seen using 'struct' now seen using 'class'"), QLatin1String("C4099: 'TextEditor::CompletionItem' : type name first seen using 'struct' now seen using 'class'"),
QLatin1String("x:\\src\\plugins\\texteditor\\icompletioncollector.h"), 50, Utils::FileName::fromUserInput("x:\\src\\plugins\\texteditor\\icompletioncollector.h"), 50,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("see declaration of 'TextEditor::CompletionItem'"), QLatin1String("see declaration of 'TextEditor::CompletionItem'"),
QLatin1String("x:\\src\\plugins\\texteditor\\completionsupport.h"), 39, Utils::FileName::fromUserInput("x:\\src\\plugins\\texteditor\\completionsupport.h"), 39,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
QTest::newRow("fatal linker error") QTest::newRow("fatal linker error")
@@ -228,8 +228,8 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("LNK1146: no argument specified with option '/LIBPATH:'"), QLatin1String("LNK1146: no argument specified with option '/LIBPATH:'"),
QString(), -1, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
// This actually comes through stderr! // This actually comes through stderr!
@@ -240,8 +240,8 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("D9002 : ignoring unknown option '-fopenmp'"), QLatin1String("D9002 : ignoring unknown option '-fopenmp'"),
QString(), -1, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
QTest::newRow("complex error") QTest::newRow("complex error")
<< QString::fromLatin1("..\\untitled\\main.cpp(19) : error C2440: 'initializing' : cannot convert from 'int' to 'std::_Tree<_Traits>::iterator'\n" << QString::fromLatin1("..\\untitled\\main.cpp(19) : error C2440: 'initializing' : cannot convert from 'int' to 'std::_Tree<_Traits>::iterator'\n"
@@ -260,8 +260,8 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
" _Traits=std::_Tmap_traits<int,double,std::less<int>,std::allocator<std::pair<const int,double>>,false>\n" " _Traits=std::_Tmap_traits<int,double,std::less<int>,std::allocator<std::pair<const int,double>>,false>\n"
"]\n" "]\n"
"No constructor could take the source type, or constructor overload resolution was ambiguous"), "No constructor could take the source type, or constructor overload resolution was ambiguous"),
QLatin1String("..\\untitled\\main.cpp"), 19, Utils::FileName::fromUserInput("..\\untitled\\main.cpp"), 19,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
QTest::newRow("Linker error 1") QTest::newRow("Linker error 1")
<< QString::fromLatin1("main.obj : error LNK2019: unresolved external symbol \"public: void __thiscall Data::doit(void)\" (?doit@Data@@QAEXXZ) referenced in function _main") << QString::fromLatin1("main.obj : error LNK2019: unresolved external symbol \"public: void __thiscall Data::doit(void)\" (?doit@Data@@QAEXXZ) referenced in function _main")
@@ -270,8 +270,8 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("LNK2019: unresolved external symbol \"public: void __thiscall Data::doit(void)\" (?doit@Data@@QAEXXZ) referenced in function _main"), QLatin1String("LNK2019: unresolved external symbol \"public: void __thiscall Data::doit(void)\" (?doit@Data@@QAEXXZ) referenced in function _main"),
QLatin1String("main.obj"), -1, Utils::FileName::fromUserInput("main.obj"), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
QTest::newRow("Linker error 2") QTest::newRow("Linker error 2")
<< QString::fromLatin1("debug\\Experimentation.exe : fatal error LNK1120: 1 unresolved externals") << QString::fromLatin1("debug\\Experimentation.exe : fatal error LNK1120: 1 unresolved externals")
@@ -280,8 +280,8 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("LNK1120: 1 unresolved externals"), QLatin1String("LNK1120: 1 unresolved externals"),
QLatin1String("debug\\Experimentation.exe"), -1, Utils::FileName::fromUserInput("debug\\Experimentation.exe"), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
QTest::newRow("Multiline error") QTest::newRow("Multiline error")
<< QString::fromLatin1("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility(2227) : warning C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'\n" << QString::fromLatin1("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility(2227) : warning C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'\n"
@@ -297,12 +297,12 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'"), QLatin1String("C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'"),
QLatin1String("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility"), 2227, Utils::FileName::fromUserInput("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility"), 2227,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("see declaration of 'std::_Copy_impl'"), QLatin1String("see declaration of 'std::_Copy_impl'"),
QLatin1String("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility"), 2212, Utils::FileName::fromUserInput("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility"), 2212,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< Task(Task::Unknown, << Task(Task::Unknown,
QLatin1String("see reference to function template instantiation '_OutIt std::copy<const unsigned char*,unsigned short*>(_InIt,_InIt,_OutIt)' being compiled\n" QLatin1String("see reference to function template instantiation '_OutIt std::copy<const unsigned char*,unsigned short*>(_InIt,_InIt,_OutIt)' being compiled\n"
"with\n" "with\n"
@@ -310,8 +310,8 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
" _OutIt=unsigned short *,\n" " _OutIt=unsigned short *,\n"
" _InIt=const unsigned char *\n" " _InIt=const unsigned char *\n"
"]"), "]"),
QLatin1String("symbolgroupvalue.cpp"), 2314, Utils::FileName::fromUserInput("symbolgroupvalue.cpp"), 2314,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
} }

View File

@@ -50,13 +50,13 @@ bool ShowInEditorTaskHandler::canHandle(const ProjectExplorer::Task &task)
{ {
if (task.file.isEmpty()) if (task.file.isEmpty())
return false; return false;
QFileInfo fi(task.file); QFileInfo fi(task.file.toFileInfo());
return fi.exists() && fi.isFile() && fi.isReadable(); return fi.exists() && fi.isFile() && fi.isReadable();
} }
void ShowInEditorTaskHandler::handle(const ProjectExplorer::Task &task) void ShowInEditorTaskHandler::handle(const ProjectExplorer::Task &task)
{ {
QFileInfo fi(task.file); QFileInfo fi(task.file.toFileInfo());
TextEditor::BaseTextEditorWidget::openEditorAt(fi.canonicalFilePath(), task.line); TextEditor::BaseTextEditorWidget::openEditorAt(fi.canonicalFilePath(), task.line);
} }

View File

@@ -49,8 +49,9 @@ Task::Task() : taskId(0), type(Unknown), line(-1)
{ } { }
Task::Task(TaskType type_, const QString &description_, Task::Task(TaskType type_, const QString &description_,
const QString &file_, int line_, const QString &category_) : const Utils::FileName &file_, int line_, const Core::Id &category_) :
taskId(s_nextId), type(type_), description(description_), file(QDir::fromNativeSeparators(file_)), line(line_), category(category_) taskId(s_nextId), type(type_), description(description_),
file(file_), line(line_), category(category_)
{ {
++s_nextId; ++s_nextId;
} }
@@ -80,9 +81,9 @@ bool operator<(const Task &a, const Task &b)
// Can't happen // Can't happen
return true; return true;
} else { } else {
if (a.category < b.category) if (a.category.uniqueIdentifier() < b.category.uniqueIdentifier())
return true; return true;
if (b.category < a.category) if (b.category.uniqueIdentifier() < a.category.uniqueIdentifier())
return false; return false;
return a.taskId < b.taskId; return a.taskId < b.taskId;
} }

View File

@@ -35,6 +35,9 @@
#include "projectexplorer_export.h" #include "projectexplorer_export.h"
#include <coreplugin/id.h>
#include <utils/fileutils.h>
#include <QtCore/QMetaType> #include <QtCore/QMetaType>
#include <QtGui/QTextLayout> #include <QtGui/QTextLayout>
@@ -53,16 +56,17 @@ public:
Task(); Task();
Task(TaskType type_, const QString &description_, Task(TaskType type_, const QString &description_,
const QString &file_, int line_, const QString &category_); const Utils::FileName &file_, int line_, const Core::Id &category_);
bool isNull() const; bool isNull() const;
unsigned int taskId; unsigned int taskId;
TaskType type; TaskType type;
QString description; QString description;
QString file; Utils::FileName file;
int line; int line;
QString category; Core::Id category;
// Having a QList<QTextLayout::FormatRange> in Task isn't that great // Having a QList<QTextLayout::FormatRange> in Task isn't that great
// It would be cleaner to split up the text into // It would be cleaner to split up the text into
// the logical hunks and then assemble them again // the logical hunks and then assemble them again

View File

@@ -48,7 +48,7 @@ TaskHub::~TaskHub()
} }
void TaskHub::addCategory(const QString &categoryId, const QString &displayName, bool visible) void TaskHub::addCategory(const Core::Id &categoryId, const QString &displayName, bool visible)
{ {
emit categoryAdded(categoryId, displayName, visible); emit categoryAdded(categoryId, displayName, visible);
} }
@@ -58,7 +58,7 @@ void TaskHub::addTask(const Task &task)
emit taskAdded(task); emit taskAdded(task);
} }
void TaskHub::clearTasks(const QString &categoryId) void TaskHub::clearTasks(const Core::Id &categoryId)
{ {
emit tasksCleared(categoryId); emit tasksCleared(categoryId);
} }
@@ -68,7 +68,7 @@ void TaskHub::removeTask(const Task &task)
emit taskRemoved(task); emit taskRemoved(task);
} }
void TaskHub::setCategoryVisibility(const QString &categoryId, bool visible) void TaskHub::setCategoryVisibility(const Core::Id &categoryId, bool visible)
{ {
emit categoryVisibilityChanged(categoryId, visible); emit categoryVisibilityChanged(categoryId, visible);
} }

View File

@@ -48,22 +48,22 @@ public:
TaskHub(); TaskHub();
virtual ~TaskHub(); virtual ~TaskHub();
void addCategory(const QString &categoryId, const QString &displayName, bool visible = true); void addCategory(const Core::Id &categoryId, const QString &displayName, bool visible = true);
void addTask(const Task &task); void addTask(const Task &task);
void clearTasks(const QString &categoryId = QString()); void clearTasks(const Core::Id &categoryId = Core::Id());
void removeTask(const Task &task); void removeTask(const Task &task);
void setCategoryVisibility(const QString &categoryId, bool visible); void setCategoryVisibility(const Core::Id &categoryId, bool visible);
void popup(bool withFocus); void popup(bool withFocus);
// TODO now there are two places for icons // TODO now there are two places for icons
QIcon taskTypeIcon(ProjectExplorer::Task::TaskType t) const; QIcon taskTypeIcon(ProjectExplorer::Task::TaskType t) const;
signals: signals:
void categoryAdded(const QString &categoryId, const QString &displayName, bool visible); void categoryAdded(const Core::Id &categoryId, const QString &displayName, bool visible);
void taskAdded(const ProjectExplorer::Task &task); void taskAdded(const ProjectExplorer::Task &task);
void taskRemoved(const ProjectExplorer::Task &task); void taskRemoved(const ProjectExplorer::Task &task);
void tasksCleared(const QString &categoryId); void tasksCleared(const Core::Id &categoryId);
void categoryVisibilityChanged(const QString &categoryId, bool visible); void categoryVisibilityChanged(const Core::Id &categoryId, bool visible);
void popupRequested(bool withFocus); void popupRequested(bool withFocus);
private: private:
const QIcon m_errorIcon; const QIcon m_errorIcon;

View File

@@ -35,7 +35,7 @@
#include "task.h" #include "task.h"
#include "taskhub.h" #include "taskhub.h"
#include <QtCore/QDebug> #include <utils/qtcassert.h>
#include <QtGui/QFontMetrics> #include <QtGui/QFontMetrics>
@@ -54,22 +54,22 @@ TaskModel::TaskModel(QObject *parent) :
m_warningIcon(QLatin1String(":/projectexplorer/images/compile_warning.png")), m_warningIcon(QLatin1String(":/projectexplorer/images/compile_warning.png")),
m_sizeOfLineNumber(0) m_sizeOfLineNumber(0)
{ {
m_categories.insert(QString(), CategoryData()); m_categories.insert(Core::Id(), CategoryData());
} }
int TaskModel::taskCount(const QString &category) int TaskModel::taskCount(const Core::Id &categoryId)
{ {
return m_categories.value(category).count; return m_categories.value(categoryId).count;
} }
int TaskModel::errorTaskCount(const QString &category) int TaskModel::errorTaskCount(const Core::Id &categoryId)
{ {
return m_categories.value(category).errors; return m_categories.value(categoryId).errors;
} }
int TaskModel::warningTaskCount(const QString &category) int TaskModel::warningTaskCount(const Core::Id &categoryId)
{ {
return m_categories.value(category).warnings; return m_categories.value(categoryId).warnings;
} }
bool TaskModel::hasFile(const QModelIndex &index) const bool TaskModel::hasFile(const QModelIndex &index) const
@@ -93,22 +93,22 @@ QIcon TaskModel::taskTypeIcon(Task::TaskType t) const
return QIcon(); return QIcon();
} }
void TaskModel::addCategory(const QString &categoryId, const QString &categoryName) void TaskModel::addCategory(const Core::Id &categoryId, const QString &categoryName)
{ {
Q_ASSERT(!categoryId.isEmpty()); QTC_ASSERT(categoryId.uniqueIdentifier(), return);
CategoryData data; CategoryData data;
data.displayName = categoryName; data.displayName = categoryName;
m_categories.insert(categoryId, data); m_categories.insert(categoryId, data);
} }
QList<Task> TaskModel::tasks(const QString &categoryId) const QList<Task> TaskModel::tasks(const Core::Id &categoryId) const
{ {
if (categoryId.isEmpty()) if (categoryId.uniqueIdentifier() == 0)
return m_tasks; return m_tasks;
QList<Task> taskList; QList<Task> taskList;
foreach (const Task &t, m_tasks) { foreach (const Task &t, m_tasks) {
if (t.category == categoryId) if (t.category.uniqueIdentifier() == categoryId.uniqueIdentifier())
taskList.append(t); taskList.append(t);
} }
return taskList; return taskList;
@@ -118,7 +118,7 @@ void TaskModel::addTask(const Task &task)
{ {
Q_ASSERT(m_categories.keys().contains(task.category)); Q_ASSERT(m_categories.keys().contains(task.category));
CategoryData &data = m_categories[task.category]; CategoryData &data = m_categories[task.category];
CategoryData &global = m_categories[QString()]; CategoryData &global = m_categories[Core::Id()];
beginInsertRows(QModelIndex(), m_tasks.count(), m_tasks.count()); beginInsertRows(QModelIndex(), m_tasks.count(), m_tasks.count());
m_tasks.append(task); m_tasks.append(task);
@@ -135,26 +135,26 @@ void TaskModel::removeTask(const Task &task)
beginRemoveRows(QModelIndex(), index, index); beginRemoveRows(QModelIndex(), index, index);
m_categories[task.category].removeTask(t); m_categories[task.category].removeTask(t);
m_categories[QString()].removeTask(t); m_categories[Core::Id()].removeTask(t);
m_tasks.removeAt(index); m_tasks.removeAt(index);
endRemoveRows(); endRemoveRows();
} }
} }
void TaskModel::clearTasks(const QString &categoryId) void TaskModel::clearTasks(const Core::Id &categoryId)
{ {
if (categoryId.isEmpty()) { if (categoryId.uniqueIdentifier() != 0) {
if (m_tasks.count() == 0) if (m_tasks.count() == 0)
return; return;
beginRemoveRows(QModelIndex(), 0, m_tasks.count() -1); beginRemoveRows(QModelIndex(), 0, m_tasks.count() -1);
m_tasks.clear(); m_tasks.clear();
foreach (const QString &key, m_categories.keys()) foreach (const Core::Id &key, m_categories.keys())
m_categories[key].clear(); m_categories[key].clear();
endRemoveRows(); endRemoveRows();
} else { } else {
int index = 0; int index = 0;
int start = 0; int start = 0;
CategoryData &global = m_categories[QString()]; CategoryData &global = m_categories[Core::Id()];
CategoryData &cat = m_categories[categoryId]; CategoryData &cat = m_categories[categoryId];
while (index < m_tasks.count()) { while (index < m_tasks.count()) {
@@ -214,7 +214,7 @@ QVariant TaskModel::data(const QModelIndex &index, int role) const
return QVariant(); return QVariant();
if (role == TaskModel::File) { if (role == TaskModel::File) {
return m_tasks.at(index.row()).file; return m_tasks.at(index.row()).file.toString();
} else if (role == TaskModel::Line) { } else if (role == TaskModel::Line) {
if (m_tasks.at(index.row()).line <= 0) if (m_tasks.at(index.row()).line <= 0)
return QVariant(); return QVariant();
@@ -223,11 +223,11 @@ QVariant TaskModel::data(const QModelIndex &index, int role) const
} else if (role == TaskModel::Description) { } else if (role == TaskModel::Description) {
return m_tasks.at(index.row()).description; return m_tasks.at(index.row()).description;
} else if (role == TaskModel::FileNotFound) { } else if (role == TaskModel::FileNotFound) {
return m_fileNotFound.value(m_tasks.at(index.row()).file); return m_fileNotFound.value(m_tasks.at(index.row()).file.toString());
} else if (role == TaskModel::Type) { } else if (role == TaskModel::Type) {
return (int)m_tasks.at(index.row()).type; return (int)m_tasks.at(index.row()).type;
} else if (role == TaskModel::Category) { } else if (role == TaskModel::Category) {
return m_tasks.at(index.row()).category; return m_tasks.at(index.row()).category.uniqueIdentifier();
} else if (role == TaskModel::Icon) { } else if (role == TaskModel::Icon) {
return taskTypeIcon(m_tasks.at(index.row()).type); return taskTypeIcon(m_tasks.at(index.row()).type);
} else if (role == TaskModel::Task_t) { } else if (role == TaskModel::Task_t) {
@@ -243,14 +243,14 @@ Task TaskModel::task(const QModelIndex &index) const
return m_tasks.at(index.row()); return m_tasks.at(index.row());
} }
QStringList TaskModel::categoryIds() const QList<Core::Id> TaskModel::categoryIds() const
{ {
QStringList ids = m_categories.keys(); QList<Core::Id> categories = m_categories.keys();
ids.removeAll(QString()); categories.removeAll(Core::Id()); // remove global category we added for bookkeeping
return ids; return categories;
} }
QString TaskModel::categoryDisplayName(const QString &categoryId) const QString TaskModel::categoryDisplayName(const Core::Id &categoryId) const
{ {
return m_categories.value(categoryId).displayName; return m_categories.value(categoryId).displayName;
} }
@@ -268,7 +268,7 @@ int TaskModel::sizeOfFile(const QFont &font)
m_fileMeasurementFont = font; m_fileMeasurementFont = font;
for (int i = m_lastMaxSizeIndex; i < count; ++i) { for (int i = m_lastMaxSizeIndex; i < count; ++i) {
QString filename = m_tasks.at(i).file; QString filename = m_tasks.at(i).file.toString();
const int pos = filename.lastIndexOf(QLatin1Char('/')); const int pos = filename.lastIndexOf(QLatin1Char('/'));
if (pos != -1) if (pos != -1)
filename = filename.mid(pos +1); filename = filename.mid(pos +1);
@@ -292,7 +292,7 @@ int TaskModel::sizeOfLineNumber(const QFont &font)
void TaskModel::setFileNotFound(const QModelIndex &idx, bool b) void TaskModel::setFileNotFound(const QModelIndex &idx, bool b)
{ {
if (idx.isValid() && idx.row() < m_tasks.count()) { if (idx.isValid() && idx.row() < m_tasks.count()) {
m_fileNotFound.insert(m_tasks[idx.row()].file, b); m_fileNotFound.insert(m_tasks[idx.row()].file.toUserOutput(), b);
emit dataChanged(idx, idx); emit dataChanged(idx, idx);
} }
} }

View File

@@ -54,14 +54,14 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
Task task(const QModelIndex &index) const; Task task(const QModelIndex &index) const;
QStringList categoryIds() const; QList<Core::Id> categoryIds() const;
QString categoryDisplayName(const QString &categoryId) const; QString categoryDisplayName(const Core::Id &categoryId) const;
void addCategory(const QString &categoryId, const QString &categoryName); void addCategory(const Core::Id &categoryId, const QString &categoryName);
QList<Task> tasks(const QString &categoryId = QString()) const; QList<Task> tasks(const Core::Id &categoryId = Core::Id()) const;
void addTask(const Task &task); void addTask(const Task &task);
void removeTask(const Task &task); void removeTask(const Task &task);
void clearTasks(const QString &categoryId = QString()); void clearTasks(const Core::Id &categoryId = Core::Id());
int sizeOfFile(const QFont &font); int sizeOfFile(const QFont &font);
int sizeOfLineNumber(const QFont &font); int sizeOfLineNumber(const QFont &font);
@@ -71,9 +71,9 @@ public:
QIcon taskTypeIcon(Task::TaskType t) const; QIcon taskTypeIcon(Task::TaskType t) const;
int taskCount(const QString &category); int taskCount(const Core::Id &categoryId);
int errorTaskCount(const QString &category); int errorTaskCount(const Core::Id &categoryId);
int warningTaskCount(const QString &category); int warningTaskCount(const Core::Id &categoryId);
bool hasFile(const QModelIndex &index) const; bool hasFile(const QModelIndex &index) const;
@@ -114,7 +114,7 @@ private:
int errors; int errors;
}; };
QHash<QString,CategoryData> m_categories; // category id to data QHash<Core::Id,CategoryData> m_categories; // category id to data
QList<Task> m_tasks; // all tasks (in order of insertion) QList<Task> m_tasks; // all tasks (in order of insertion)
QHash<QString,bool> m_fileNotFound; QHash<QString,bool> m_fileNotFound;
@@ -151,8 +151,8 @@ public:
bool filterIncludesErrors() const { return m_includeErrors; } bool filterIncludesErrors() const { return m_includeErrors; }
void setFilterIncludesErrors(bool b) { m_includeErrors = b; invalidateFilter(); } void setFilterIncludesErrors(bool b) { m_includeErrors = b; invalidateFilter(); }
QStringList filteredCategories() const { return m_categoryIds; } QList<Core::Id> filteredCategories() const { return m_categoryIds; }
void setFilteredCategories(const QStringList &categoryIds) { m_categoryIds = categoryIds; invalidateFilter(); } void setFilteredCategories(const QList<Core::Id> &categoryIds) { m_categoryIds = categoryIds; invalidateFilter(); }
Task task(const QModelIndex &index) const Task task(const QModelIndex &index) const
{ return m_sourceModel->task(mapToSource(index)); } { return m_sourceModel->task(mapToSource(index)); }
@@ -175,7 +175,7 @@ private:
bool m_includeUnknowns; bool m_includeUnknowns;
bool m_includeWarnings; bool m_includeWarnings;
bool m_includeErrors; bool m_includeErrors;
QStringList m_categoryIds; QList<Core::Id> m_categoryIds;
mutable QList<int> m_mapping; mutable QList<int> m_mapping;
mutable bool m_mappingUpToDate; mutable bool m_mappingUpToDate;

View File

@@ -44,6 +44,7 @@
#include <coreplugin/icontext.h> #include <coreplugin/icontext.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
@@ -289,16 +290,16 @@ TaskWindow::TaskWindow(TaskHub *taskhub) : d(new TaskWindowPrivate)
d->m_categoriesButton->setMenu(d->m_categoriesMenu); d->m_categoriesButton->setMenu(d->m_categoriesMenu);
connect(d->m_taskHub, SIGNAL(categoryAdded(QString, QString, bool)), connect(d->m_taskHub, SIGNAL(categoryAdded(Core::Id,QString,bool)),
this, SLOT(addCategory(QString, QString, bool))); this, SLOT(addCategory(Core::Id,QString,bool)));
connect(d->m_taskHub, SIGNAL(taskAdded(ProjectExplorer::Task)), connect(d->m_taskHub, SIGNAL(taskAdded(ProjectExplorer::Task)),
this, SLOT(addTask(ProjectExplorer::Task))); this, SLOT(addTask(ProjectExplorer::Task)));
connect(d->m_taskHub, SIGNAL(taskRemoved(ProjectExplorer::Task)), connect(d->m_taskHub, SIGNAL(taskRemoved(ProjectExplorer::Task)),
this, SLOT(removeTask(ProjectExplorer::Task))); this, SLOT(removeTask(ProjectExplorer::Task)));
connect(d->m_taskHub, SIGNAL(tasksCleared(QString)), connect(d->m_taskHub, SIGNAL(tasksCleared(Core::Id)),
this, SLOT(clearTasks(QString))); this, SLOT(clearTasks(Core::Id)));
connect(d->m_taskHub, SIGNAL(categoryVisibilityChanged(QString,bool)), connect(d->m_taskHub, SIGNAL(categoryVisibilityChanged(Core::Id,bool)),
this, SLOT(setCategoryVisibility(QString,bool))); this, SLOT(setCategoryVisibility(Core::Id,bool)));
connect(d->m_taskHub, SIGNAL(popupRequested(bool)), connect(d->m_taskHub, SIGNAL(popupRequested(bool)),
this, SLOT(popup(bool))); this, SLOT(popup(bool)));
} }
@@ -324,7 +325,7 @@ QWidget *TaskWindow::outputWidget(QWidget *)
return d->m_listview; return d->m_listview;
} }
void TaskWindow::clearTasks(const QString &categoryId) void TaskWindow::clearTasks(const Core::Id &categoryId)
{ {
d->m_model->clearTasks(categoryId); d->m_model->clearTasks(categoryId);
@@ -333,12 +334,12 @@ void TaskWindow::clearTasks(const QString &categoryId)
navigateStateChanged(); navigateStateChanged();
} }
void TaskWindow::setCategoryVisibility(const QString &categoryId, bool visible) void TaskWindow::setCategoryVisibility(const Core::Id &categoryId, bool visible)
{ {
if (categoryId.isEmpty()) if (categoryId.uniqueIdentifier() == 0)
return; return;
QStringList categories = d->m_filter->filteredCategories(); QList<Core::Id> categories = d->m_filter->filteredCategories();
if (visible) { if (visible) {
categories.removeOne(categoryId); categories.removeOne(categoryId);
@@ -353,11 +354,11 @@ void TaskWindow::visibilityChanged(bool /* b */)
{ {
} }
void TaskWindow::addCategory(const QString &categoryId, const QString &displayName, bool visible) void TaskWindow::addCategory(const Core::Id &categoryId, const QString &displayName, bool visible)
{ {
d->m_model->addCategory(categoryId, displayName); d->m_model->addCategory(categoryId, displayName);
if (!visible) { if (!visible) {
QStringList filters = d->m_filter->filteredCategories(); QList<Core::Id> filters = d->m_filter->filteredCategories();
filters += categoryId; filters += categoryId;
d->m_filter->setFilteredCategories(filters); d->m_filter->setFilteredCategories(filters);
} }
@@ -402,7 +403,7 @@ void TaskWindow::triggerDefaultHandler(const QModelIndex &index)
if (d->m_defaultHandler->canHandle(task)) { if (d->m_defaultHandler->canHandle(task)) {
d->m_defaultHandler->handle(task); d->m_defaultHandler->handle(task);
} else { } else {
if (!QFileInfo(task.file).exists()) if (!task.file.toFileInfo().exists())
d->m_model->setFileNotFound(index, true); d->m_model->setFileNotFound(index, true);
} }
} }
@@ -462,42 +463,42 @@ void TaskWindow::updateCategoriesMenu()
{ {
d->m_categoriesMenu->clear(); d->m_categoriesMenu->clear();
const QStringList filteredCategories = d->m_filter->filteredCategories(); const QList<Core::Id> filteredCategories = d->m_filter->filteredCategories();
QMap<QString, QString> nameToIds; QMap<QString, QByteArray> nameToIds;
foreach (const QString &categoryId, d->m_model->categoryIds()) foreach (const Core::Id &categoryId, d->m_model->categoryIds())
nameToIds.insert(d->m_model->categoryDisplayName(categoryId), categoryId); nameToIds.insert(d->m_model->categoryDisplayName(categoryId), categoryId.name());
foreach (const QString &displayName, nameToIds.keys()) { foreach (const QString &displayName, nameToIds.keys()) {
const QString categoryId = nameToIds.value(displayName); const QByteArray categoryId = nameToIds.value(displayName);
QAction *action = new QAction(d->m_categoriesMenu); QAction *action = new QAction(d->m_categoriesMenu);
action->setCheckable(true); action->setCheckable(true);
action->setText(displayName); action->setText(displayName);
action->setData(categoryId); action->setData(categoryId);
action->setChecked(!filteredCategories.contains(categoryId)); action->setChecked(!filteredCategories.contains(Core::Id(categoryId.constData())));
d->m_categoriesMenu->addAction(action); d->m_categoriesMenu->addAction(action);
} }
} }
void TaskWindow::filterCategoryTriggered(QAction *action) void TaskWindow::filterCategoryTriggered(QAction *action)
{ {
QString categoryId = action->data().toString(); Core::Id categoryId(action->data().toByteArray().constData());
Q_ASSERT(!categoryId.isEmpty()); QTC_CHECK(categoryId.uniqueIdentifier() != 0);
setCategoryVisibility(categoryId, action->isChecked()); setCategoryVisibility(categoryId, action->isChecked());
} }
int TaskWindow::taskCount(const QString &category) const int TaskWindow::taskCount(const Core::Id &category) const
{ {
return d->m_model->taskCount(category); return d->m_model->taskCount(category);
} }
int TaskWindow::errorTaskCount(const QString &category) const int TaskWindow::errorTaskCount(const Core::Id &category) const
{ {
return d->m_model->errorTaskCount(category); return d->m_model->errorTaskCount(category);
} }
int TaskWindow::warningTaskCount(const QString &category) const int TaskWindow::warningTaskCount(const Core::Id &category) const
{ {
return d->m_model->warningTaskCount(category); return d->m_model->warningTaskCount(category);
} }
@@ -511,7 +512,7 @@ void TaskWindow::clearContents()
{ {
// clear all tasks in all displays // clear all tasks in all displays
// Yeah we are that special // Yeah we are that special
d->m_taskHub->clearTasks(QString()); d->m_taskHub->clearTasks();
} }
bool TaskWindow::hasFocus() const bool TaskWindow::hasFocus() const

View File

@@ -33,6 +33,7 @@
#ifndef TASKWINDOW_H #ifndef TASKWINDOW_H
#define TASKWINDOW_H #define TASKWINDOW_H
#include <coreplugin/id.h>
#include <coreplugin/ioutputpane.h> #include <coreplugin/ioutputpane.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@@ -57,9 +58,9 @@ public:
TaskWindow(ProjectExplorer::TaskHub *taskHub); TaskWindow(ProjectExplorer::TaskHub *taskHub);
virtual ~TaskWindow(); virtual ~TaskWindow();
int taskCount(const QString &category = QString()) const; int taskCount(const Core::Id &category = Core::Id()) const;
int warningTaskCount(const QString &category = QString()) const; int warningTaskCount(const Core::Id &category = Core::Id()) const;
int errorTaskCount(const QString &category = QString()) const; int errorTaskCount(const Core::Id &category = Core::Id()) const;
// IOutputPane // IOutputPane
QWidget *outputWidget(QWidget *); QWidget *outputWidget(QWidget *);
@@ -85,11 +86,11 @@ signals:
void tasksCleared(); void tasksCleared();
private slots: private slots:
void addCategory(const QString &categoryId, const QString &displayName, bool visible); void addCategory(const Core::Id &categoryId, const QString &displayName, bool visible);
void addTask(const ProjectExplorer::Task &task); void addTask(const ProjectExplorer::Task &task);
void removeTask(const ProjectExplorer::Task &task); void removeTask(const ProjectExplorer::Task &task);
void clearTasks(const QString &categoryId); void clearTasks(const Core::Id &categoryId);
void setCategoryVisibility(const QString &categoryId, bool visible); void setCategoryVisibility(const Core::Id &categoryId, bool visible);
void triggerDefaultHandler(const QModelIndex &index); void triggerDefaultHandler(const QModelIndex &index);
void showContextMenu(const QPoint &position); void showContextMenu(const QPoint &position);

View File

@@ -51,7 +51,7 @@ VcsAnnotateTaskHandler::VcsAnnotateTaskHandler() :
bool VcsAnnotateTaskHandler::canHandle(const ProjectExplorer::Task &task) bool VcsAnnotateTaskHandler::canHandle(const ProjectExplorer::Task &task)
{ {
QFileInfo fi(task.file); QFileInfo fi(task.file.toFileInfo());
if (!fi.exists() || !fi.isFile() || !fi.isReadable()) if (!fi.exists() || !fi.isFile() || !fi.isReadable())
return false; return false;
Core::IVersionControl *vc = Core::ICore::vcsManager()->findVersionControlForDirectory(fi.absolutePath()); Core::IVersionControl *vc = Core::ICore::vcsManager()->findVersionControlForDirectory(fi.absolutePath());
@@ -62,7 +62,7 @@ bool VcsAnnotateTaskHandler::canHandle(const ProjectExplorer::Task &task)
void VcsAnnotateTaskHandler::handle(const ProjectExplorer::Task &task) void VcsAnnotateTaskHandler::handle(const ProjectExplorer::Task &task)
{ {
QFileInfo fi(task.file); QFileInfo fi(task.file.toFileInfo());
Core::IVersionControl *vc = Core::ICore::vcsManager()->findVersionControlForDirectory(fi.absolutePath()); Core::IVersionControl *vc = Core::ICore::vcsManager()->findVersionControlForDirectory(fi.absolutePath());
Q_ASSERT(vc); Q_ASSERT(vc);
Q_ASSERT(vc->supportsOperation(Core::IVersionControl::AnnotateOperation)); Q_ASSERT(vc->supportsOperation(Core::IVersionControl::AnnotateOperation));

View File

@@ -71,7 +71,7 @@ QmlTaskManager::QmlTaskManager(QObject *parent) :
SLOT(updateMessagesNow())); SLOT(updateMessagesNow()));
} }
static QList<ProjectExplorer::Task> convertToTasks(const QList<DiagnosticMessage> &messages, const QString &fileName, const QString &category) static QList<ProjectExplorer::Task> convertToTasks(const QList<DiagnosticMessage> &messages, const Utils::FileName &fileName, const Core::Id &category)
{ {
QList<ProjectExplorer::Task> result; QList<ProjectExplorer::Task> result;
foreach (const DiagnosticMessage &msg, messages) { foreach (const DiagnosticMessage &msg, messages) {
@@ -87,7 +87,7 @@ static QList<ProjectExplorer::Task> convertToTasks(const QList<DiagnosticMessage
return result; return result;
} }
static QList<ProjectExplorer::Task> convertToTasks(const QList<StaticAnalysis::Message> &messages, const QString &fileName, const QString &category) static QList<ProjectExplorer::Task> convertToTasks(const QList<StaticAnalysis::Message> &messages, const Utils::FileName &fileName, const Core::Id &category)
{ {
QList<DiagnosticMessage> diagnostics; QList<DiagnosticMessage> diagnostics;
foreach (const StaticAnalysis::Message &msg, messages) foreach (const StaticAnalysis::Message &msg, messages)
@@ -116,15 +116,18 @@ void QmlTaskManager::collectMessages(
FileErrorMessages result; FileErrorMessages result;
result.fileName = fileName; result.fileName = fileName;
result.tasks = convertToTasks(document->diagnosticMessages(), result.tasks = convertToTasks(document->diagnosticMessages(),
fileName, Constants::TASK_CATEGORY_QML); Utils::FileName::fromString(fileName),
Core::Id(Constants::TASK_CATEGORY_QML));
if (updateSemantic) { if (updateSemantic) {
result.tasks += convertToTasks(linkMessages.value(fileName), result.tasks += convertToTasks(linkMessages.value(fileName),
fileName, Constants::TASK_CATEGORY_QML_ANALYSIS); Utils::FileName::fromString(fileName),
Core::Id(Constants::TASK_CATEGORY_QML_ANALYSIS));
Check checker(document, context); Check checker(document, context);
result.tasks += convertToTasks(checker(), result.tasks += convertToTasks(checker(),
fileName, Constants::TASK_CATEGORY_QML_ANALYSIS); Utils::FileName::fromString(fileName),
Core::Id(Constants::TASK_CATEGORY_QML_ANALYSIS));
} }
if (!result.tasks.isEmpty()) if (!result.tasks.isEmpty())
@@ -190,9 +193,9 @@ void QmlTaskManager::displayAllResults()
void QmlTaskManager::insertTask(const ProjectExplorer::Task &task) void QmlTaskManager::insertTask(const ProjectExplorer::Task &task)
{ {
QList<ProjectExplorer::Task> tasks = m_docsWithTasks.value(task.file); QList<ProjectExplorer::Task> tasks = m_docsWithTasks.value(task.file.toString());
tasks.append(task); tasks.append(task);
m_docsWithTasks.insert(task.file, tasks); m_docsWithTasks.insert(task.file.toString(), tasks);
m_taskHub->addTask(task); m_taskHub->addTask(task);
} }

View File

@@ -137,16 +137,16 @@ bool MakeStep::init()
if (!bc) { if (!bc) {
m_tasks.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, m_tasks.append(ProjectExplorer::Task(ProjectExplorer::Task::Error,
tr("Qt Creator needs a buildconfiguration set up to build. Configure a tool chain in Project mode."), tr("Qt Creator needs a buildconfiguration set up to build. Configure a tool chain in Project mode."),
QString(), -1, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return false; return false;
} }
if (!bc->toolChain()) { if (!bc->toolChain()) {
m_tasks.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, m_tasks.append(ProjectExplorer::Task(ProjectExplorer::Task::Error,
tr("Qt Creator needs a tool chain set up to build. Configure a tool chain in Project mode."), tr("Qt Creator needs a tool chain set up to build. Configure a tool chain in Project mode."),
QString(), -1, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
ProjectExplorer::ProcessParameters *pp = processParameters(); ProjectExplorer::ProcessParameters *pp = processParameters();

View File

@@ -54,18 +54,18 @@ void QMakeParser::stdError(const QString &line)
const QString description = lne.mid(15); const QString description = lne.mid(15);
emit addTask(Task(Task::Error, emit addTask(Task(Task::Error,
description, description,
QString() /* filename */, Utils::FileName() /* filename */,
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return; return;
} }
if (lne.startsWith(QLatin1String("Project WARNING:"))) { if (lne.startsWith(QLatin1String("Project WARNING:"))) {
const QString description = lne.mid(17); const QString description = lne.mid(17);
emit addTask(Task(Task::Warning, emit addTask(Task(Task::Warning,
description, description,
QString() /* filename */, Utils::FileName() /* filename */,
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return; return;
} }
if (m_error.indexIn(lne) > -1) { if (m_error.indexIn(lne) > -1) {
@@ -79,9 +79,9 @@ void QMakeParser::stdError(const QString &line)
} }
emit addTask(Task(type, emit addTask(Task(type,
m_error.cap(3) /* description */, m_error.cap(3) /* description */,
fileName, Utils::FileName::fromUserInput(fileName),
m_error.cap(2).toInt() /* line */, m_error.cap(2).toInt() /* line */,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return; return;
} }
IOutputParser::stdError(line); IOutputParser::stdError(line);
@@ -102,7 +102,7 @@ using namespace ProjectExplorer;
void Qt4ProjectManagerPlugin::testQmakeOutputParsers_data() void Qt4ProjectManagerPlugin::testQmakeOutputParsers_data()
{ {
const QString categoryBuildSystem = QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); const Core::Id categoryBuildSystem = Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
QTest::addColumn<QString>("input"); QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel"); QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines"); QTest::addColumn<QString>("childStdOutLines");
@@ -129,7 +129,7 @@ void Qt4ProjectManagerPlugin::testQmakeOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("undefined file"), QLatin1String("undefined file"),
QString(), -1, Utils::FileName(), -1,
categoryBuildSystem)) categoryBuildSystem))
<< QString(); << QString();
@@ -140,7 +140,7 @@ void Qt4ProjectManagerPlugin::testQmakeOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("Parse Error ('sth odd')"), QLatin1String("Parse Error ('sth odd')"),
QLatin1String("e:\\project.pro"), Utils::FileName::fromUserInput("e:\\project.pro"),
14, 14,
categoryBuildSystem)) categoryBuildSystem))
<< QString(); << QString();
@@ -152,7 +152,7 @@ void Qt4ProjectManagerPlugin::testQmakeOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("bearer module might require ReadUserData capability"), QLatin1String("bearer module might require ReadUserData capability"),
QString(), -1, Utils::FileName(), -1,
categoryBuildSystem)) categoryBuildSystem))
<< QString(); << QString();
@@ -163,7 +163,7 @@ void Qt4ProjectManagerPlugin::testQmakeOutputParsers_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Warning, << Task(Task::Warning,
QLatin1String("Unescaped backslashes are deprecated."), QLatin1String("Unescaped backslashes are deprecated."),
QLatin1String("e:\\NokiaQtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl"), 1, Utils::FileName::fromUserInput("e:\\NokiaQtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl"), 1,
categoryBuildSystem)) categoryBuildSystem))
<< QString(); << QString();
} }

View File

@@ -58,18 +58,18 @@ void AbldParser::stdOutput(const QString &line)
if (lne.startsWith(QLatin1String("Is Perl, version "))) { if (lne.startsWith(QLatin1String("Is Perl, version "))) {
emit addTask(Task(Task::Error, emit addTask(Task(Task::Error,
lne /* description */, lne /* description */,
QString() /* filename */, Utils::FileName() /* filename */,
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(TASK_CATEGORY_BUILDSYSTEM))); Core::Id(TASK_CATEGORY_BUILDSYSTEM)));
return; return;
} }
if (lne.startsWith(QLatin1String("FATAL ERROR:")) || if (lne.startsWith(QLatin1String("FATAL ERROR:")) ||
lne.startsWith(QLatin1String("Error :"))) { lne.startsWith(QLatin1String("Error :"))) {
emit addTask(Task(Task::Error, emit addTask(Task(Task::Error,
lne /* description */, lne /* description */,
QString() /* filename */, Utils::FileName() /* filename */,
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(TASK_CATEGORY_BUILDSYSTEM))); Core::Id(TASK_CATEGORY_BUILDSYSTEM)));
m_waitingForStdOutContinuation = false; m_waitingForStdOutContinuation = false;
return; return;
} }
@@ -81,8 +81,8 @@ void AbldParser::stdOutput(const QString &line)
Task task(Task::Unknown, Task task(Task::Unknown,
m_perlIssue.cap(4) /* description */, m_perlIssue.cap(4) /* description */,
m_currentFile, m_currentLine, Utils::FileName::fromUserInput(m_currentFile), m_currentLine,
QLatin1String(TASK_CATEGORY_BUILDSYSTEM)); Core::Id(TASK_CATEGORY_BUILDSYSTEM));
if (m_perlIssue.cap(1) == QLatin1String("WARNING")) if (m_perlIssue.cap(1) == QLatin1String("WARNING"))
task.type = Task::Warning; task.type = Task::Warning;
@@ -96,8 +96,8 @@ void AbldParser::stdOutput(const QString &line)
if (lne.startsWith(QLatin1String("SIS creation failed!"))) { if (lne.startsWith(QLatin1String("SIS creation failed!"))) {
m_waitingForStdOutContinuation = false; m_waitingForStdOutContinuation = false;
emit addTask(Task(Task::Error, emit addTask(Task(Task::Error,
line, QString(), -1, line, Utils::FileName(), -1,
QLatin1String(TASK_CATEGORY_BUILDSYSTEM))); Core::Id(TASK_CATEGORY_BUILDSYSTEM)));
return; return;
} }
@@ -109,8 +109,8 @@ void AbldParser::stdOutput(const QString &line)
if (m_waitingForStdOutContinuation) { if (m_waitingForStdOutContinuation) {
emit addTask(Task(Task::Unknown, emit addTask(Task(Task::Unknown,
lne /* description */, lne /* description */,
m_currentFile, m_currentLine, Utils::FileName::fromUserInput(m_currentFile), m_currentLine,
QLatin1String(TASK_CATEGORY_BUILDSYSTEM))); Core::Id(TASK_CATEGORY_BUILDSYSTEM)));
m_waitingForStdOutContinuation = true; m_waitingForStdOutContinuation = true;
return; return;
} }
@@ -129,18 +129,18 @@ void AbldParser::stdError(const QString &line)
lne.startsWith(QLatin1String("Platform "))) { lne.startsWith(QLatin1String("Platform "))) {
emit addTask(Task(Task::Error, emit addTask(Task(Task::Error,
lne /* description */, lne /* description */,
QString() /* filename */, Utils::FileName() /* filename */,
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(TASK_CATEGORY_BUILDSYSTEM))); Core::Id(TASK_CATEGORY_BUILDSYSTEM)));
return; return;
} }
if (lne.startsWith(QLatin1String("Died at "))) { if (lne.startsWith(QLatin1String("Died at "))) {
emit addTask(Task(Task::Error, emit addTask(Task(Task::Error,
lne /* description */, lne /* description */,
QString() /* filename */, Utils::FileName() /* filename */,
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(TASK_CATEGORY_BUILDSYSTEM))); Core::Id(TASK_CATEGORY_BUILDSYSTEM)));
m_waitingForStdErrContinuation = false; m_waitingForStdErrContinuation = false;
return; return;
} }
@@ -157,18 +157,18 @@ void AbldParser::stdError(const QString &line)
if (lne.startsWith(QLatin1String("WARNING: "))) { if (lne.startsWith(QLatin1String("WARNING: "))) {
QString description = lne.mid(9); QString description = lne.mid(9);
emit addTask(Task(Task::Warning, description, emit addTask(Task(Task::Warning, description,
m_currentFile, Utils::FileName::fromUserInput(m_currentFile),
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(TASK_CATEGORY_BUILDSYSTEM))); Core::Id(TASK_CATEGORY_BUILDSYSTEM)));
m_waitingForStdErrContinuation = true; m_waitingForStdErrContinuation = true;
return; return;
} }
if (lne.startsWith(QLatin1String("ERROR: "))) { if (lne.startsWith(QLatin1String("ERROR: "))) {
QString description = lne.mid(7); QString description = lne.mid(7);
emit addTask(Task(Task::Error, description, emit addTask(Task(Task::Error, description,
m_currentFile, Utils::FileName::fromUserInput(m_currentFile),
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(TASK_CATEGORY_BUILDSYSTEM))); Core::Id(TASK_CATEGORY_BUILDSYSTEM)));
m_waitingForStdErrContinuation = true; m_waitingForStdErrContinuation = true;
return; return;
} }
@@ -176,9 +176,9 @@ void AbldParser::stdError(const QString &line)
{ {
emit addTask(Task(Task::Unknown, emit addTask(Task(Task::Unknown,
lne /* description */, lne /* description */,
m_currentFile, Utils::FileName::fromUserInput(m_currentFile),
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(TASK_CATEGORY_BUILDSYSTEM))); Core::Id(TASK_CATEGORY_BUILDSYSTEM)));
m_waitingForStdErrContinuation = true; m_waitingForStdErrContinuation = true;
return; return;
} }

View File

@@ -153,7 +153,7 @@ QList<ProjectExplorer::Task> Qt4SymbianTargetFactory::reportIssues(const QString
QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker", QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker",
"The Symbian tool chain does not handle spaces " "The Symbian tool chain does not handle spaces "
"in the project path '%1'.").arg(projectPath), "in the project path '%1'.").arg(projectPath),
QString(), -1, QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
if (projectName.contains(QRegExp(QLatin1String("[^a-zA-Z0-9.-]")))) { if (projectName.contains(QRegExp(QLatin1String("[^a-zA-Z0-9.-]")))) {
results.append(Task(Task::Warning, results.append(Task(Task::Warning,
@@ -161,7 +161,7 @@ QList<ProjectExplorer::Task> Qt4SymbianTargetFactory::reportIssues(const QString
"The Symbian tool chain does not handle special " "The Symbian tool chain does not handle special "
"characters in the project name '%1' well.") "characters in the project name '%1' well.")
.arg(projectName), .arg(projectName),
QString(), -1, QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
return results; return results;
} }

View File

@@ -68,9 +68,9 @@ void RvctParser::stdError(const QString &line)
m_task = new Task(Task::Error, m_task = new Task(Task::Error,
m_genericProblem.cap(2) /* description */, m_genericProblem.cap(2) /* description */,
QString(), Utils::FileName(),
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(TASK_CATEGORY_COMPILE)); Core::Id(TASK_CATEGORY_COMPILE));
if (m_warningOrError.cap(4) == QLatin1String("Warning")) if (m_warningOrError.cap(4) == QLatin1String("Warning"))
m_task->type = Task::Warning; m_task->type = Task::Warning;
else if (m_warningOrError.cap(4) == QLatin1String("Error")) else if (m_warningOrError.cap(4) == QLatin1String("Error"))
@@ -83,9 +83,9 @@ void RvctParser::stdError(const QString &line)
m_task = new Task(Task::Unknown, m_task = new Task(Task::Unknown,
m_warningOrError.cap(5) /* description */, m_warningOrError.cap(5) /* description */,
m_warningOrError.cap(1) /* file */, Utils::FileName::fromUserInput(m_warningOrError.cap(1)) /* file */,
m_warningOrError.cap(2).toInt() /* line */, m_warningOrError.cap(2).toInt() /* line */,
QLatin1String(TASK_CATEGORY_COMPILE)); Core::Id(TASK_CATEGORY_COMPILE));
if (m_warningOrError.cap(4) == QLatin1String("Warning")) if (m_warningOrError.cap(4) == QLatin1String("Warning"))
m_task->type = Task::Warning; m_task->type = Task::Warning;
else if (m_warningOrError.cap(4) == QLatin1String("Error")) else if (m_warningOrError.cap(4) == QLatin1String("Error"))
@@ -152,7 +152,7 @@ void Qt4ProjectManagerPlugin::testRvctOutputParser_data()
QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); QTest::addColumn<QList<ProjectExplorer::Task> >("tasks");
QTest::addColumn<QString>("outputLines"); QTest::addColumn<QString>("outputLines");
const QString categoryCompile = QLatin1String(Constants::TASK_CATEGORY_COMPILE); const Core::Id categoryCompile = Core::Id(Constants::TASK_CATEGORY_COMPILE);
QTest::newRow("pass-through stdout") QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString() << QString::fromLatin1("Sometext\n") << QString()
@@ -175,7 +175,7 @@ void Qt4ProjectManagerPlugin::testRvctOutputParser_data()
QLatin1String("#68-D: integer conversion resulted in a change of sign\n" QLatin1String("#68-D: integer conversion resulted in a change of sign\n"
" : public _Integer_limits<char, CHAR_MIN, CHAR_MAX, -1, true>\n" " : public _Integer_limits<char, CHAR_MIN, CHAR_MAX, -1, true>\n"
" ^"), " ^"),
QLatin1String("../../../../s60-sdk/epoc32/include/stdapis/stlport/stl/_limits.h"), 256, Utils::FileName::fromUserInput("../../../../s60-sdk/epoc32/include/stdapis/stlport/stl/_limits.h"), 256,
categoryCompile) categoryCompile)
) )
<< QString(); << QString();
@@ -190,7 +190,7 @@ void Qt4ProjectManagerPlugin::testRvctOutputParser_data()
QLatin1String("#20: identifier \"e\" is undefined\n" QLatin1String("#20: identifier \"e\" is undefined\n"
" delete ui;e\n" " delete ui;e\n"
" ^"), " ^"),
QLatin1String("mainwindow.cpp"), 22, Utils::FileName::fromUserInput("mainwindow.cpp"), 22,
categoryCompile) categoryCompile)
) )
<< QString(); << QString();
@@ -201,7 +201,7 @@ void Qt4ProjectManagerPlugin::testRvctOutputParser_data()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< Task(Task::Error, << Task(Task::Error,
QLatin1String("L6218E: Undefined symbol MainWindow::sth() (referred from mainwindow.o)"), QLatin1String("L6218E: Undefined symbol MainWindow::sth() (referred from mainwindow.o)"),
QString(), -1, Utils::FileName(), -1,
categoryCompile) categoryCompile)
) )
<< QString(); << QString();
@@ -232,7 +232,7 @@ void Qt4ProjectManagerPlugin::testRvctOutputParser_data()
"FLEXnet Licensing error:-1,359. System Error: 2 \"No such file or directory\"\n" "FLEXnet Licensing error:-1,359. System Error: 2 \"No such file or directory\"\n"
"For further information, refer to the FLEXnet Licensing End User Guide,\n" "For further information, refer to the FLEXnet Licensing End User Guide,\n"
"available at \"www.macrovision.com\"."), "available at \"www.macrovision.com\"."),
QString(), -1, Utils::FileName(), -1,
categoryCompile) categoryCompile)
) )
<< QString(); << QString();

View File

@@ -63,8 +63,8 @@ bool S60CreatePackageParser::parseLine(const QString &line)
"Use a developer certificate or any other signing option to prevent " "Use a developer certificate or any other signing option to prevent "
"this patching from happening."). "this patching from happening.").
arg(m_packageName, lines); arg(m_packageName, lines);
ProjectExplorer::Task task(ProjectExplorer::Task::Warning, message, QString(), -1, ProjectExplorer::Task task(ProjectExplorer::Task::Warning, message, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
QTextLayout::FormatRange fr; QTextLayout::FormatRange fr;
fr.start = message.indexOf(lines); fr.start = message.indexOf(lines);
@@ -86,11 +86,11 @@ bool S60CreatePackageParser::parseLine(const QString &line)
tr("Cannot create Smart Installer package " tr("Cannot create Smart Installer package "
"as the Smart Installer's base file is missing. " "as the Smart Installer's base file is missing. "
"Please ensure that it is located in the SDK."), "Please ensure that it is located in the SDK."),
QString(), -1, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
else else
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, QString(), -1, emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return true; return true;
} }
return false; return false;

View File

@@ -510,8 +510,8 @@ void S60CreatePackageStep::reportPackageStepIssue(const QString &message, bool i
ProjectExplorer::Task::Error: ProjectExplorer::Task::Error:
ProjectExplorer::Task::Warning, ProjectExplorer::Task::Warning,
message, message,
QString(), -1, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
void S60CreatePackageStep::packageWarningDialogDone() void S60CreatePackageStep::packageWarningDialogDone()

View File

@@ -195,8 +195,8 @@ void S60DeployStep::reportError(const QString &error)
emit addOutput(error, ProjectExplorer::BuildStep::ErrorMessageOutput); emit addOutput(error, ProjectExplorer::BuildStep::ErrorMessageOutput);
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error,
error, error,
QString(), -1, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
emit finished(false); emit finished(false);
} }
@@ -604,8 +604,8 @@ void S60DeployStep::checkForCancel()
appendMessage(canceledText, true); appendMessage(canceledText, true);
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error,
canceledText, canceledText,
QString(), -1, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
emit finishNow(false); emit finishNow(false);
} }
} }

View File

@@ -66,8 +66,8 @@ void SbsV2Parser::stdOutput(const QString &line)
QString logfile = QDir::fromNativeSeparators(line.mid(18).trimmed()); QString logfile = QDir::fromNativeSeparators(line.mid(18).trimmed());
parseLogFile(logfile); parseLogFile(logfile);
addTask(ProjectExplorer::Task(Task::Unknown, tr("SBSv2 build log"), addTask(ProjectExplorer::Task(Task::Unknown, tr("SBSv2 build log"),
logfile, -1, Utils::FileName::fromUserInput(logfile), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
} }
@@ -81,14 +81,15 @@ void SbsV2Parser::taskAdded(const ProjectExplorer::Task &task)
{ {
// Fix pathes: // Fix pathes:
ProjectExplorer::Task tmp(task); ProjectExplorer::Task tmp(task);
const QString filename = tmp.file.toString();
if (!tmp.file.isEmpty()) { if (!tmp.file.isEmpty()) {
QFileInfo fi(tmp.file); QFileInfo fi(tmp.file.toFileInfo());
if (!fi.isAbsolute()) { if (!fi.isAbsolute()) {
if (m_currentSource.exists(tmp.file)) if (m_currentSource.exists(filename))
tmp.file = m_currentSource.absoluteFilePath(tmp.file); tmp.file = Utils::FileName::fromString(m_currentSource.absoluteFilePath(filename));
else if (m_currentTarget.exists(tmp.file)) else if (m_currentTarget.exists(filename))
tmp.file = m_currentTarget.absoluteFilePath(tmp.file); tmp.file = Utils::FileName::fromString(m_currentTarget.absoluteFilePath(filename));
} }
} }
@@ -132,7 +133,7 @@ void SbsV2Parser::readError()
Q_ASSERT(m_log.isStartElement() && m_log.name() == QLatin1String("error")); Q_ASSERT(m_log.isStartElement() && m_log.name() == QLatin1String("error"));
QString error = m_log.readElementText(); QString error = m_log.readElementText();
addTask(Task(Task::Error, error, QString(), -1, QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))); addTask(Task(Task::Error, error, Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
void SbsV2Parser::readWarning() void SbsV2Parser::readWarning()
@@ -140,7 +141,7 @@ void SbsV2Parser::readWarning()
Q_ASSERT(m_log.isStartElement() && m_log.name() == QLatin1String("warning")); Q_ASSERT(m_log.isStartElement() && m_log.name() == QLatin1String("warning"));
QString warning = m_log.readElementText(); QString warning = m_log.readElementText();
addTask(Task(Task::Warning, warning, QString(), -1, QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))); addTask(Task(Task::Warning, warning, Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
void SbsV2Parser::readRecipe() void SbsV2Parser::readRecipe()
@@ -186,10 +187,10 @@ void SbsV2Parser::readRecipe()
if (returnCode != 0) { if (returnCode != 0) {
//: %1 is the SBSv2 build recipe name, %2 the return code of the failed command //: %1 is the SBSv2 build recipe name, %2 the return code of the failed command
QString description = tr("Recipe %1 failed with exit code %2.").arg(name).arg(returnCode); QString description = tr("Recipe %1 failed with exit code %2.").arg(name).arg(returnCode);
m_hub->addTask(Task(Task::Error, description, QString(), -1, m_hub->addTask(Task(Task::Error, description, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
m_hub->addTask(Task(Task::Unknown, outputText, QString(), -1, m_hub->addTask(Task(Task::Unknown, outputText, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
} }
@@ -230,8 +231,8 @@ void Qt4ProjectManagerPlugin::testSbsV2OutputParsers_data()
<< QString() << QString() << QString() << QString()
<< (QList<ProjectExplorer::Task>() << (QList<ProjectExplorer::Task>()
<< ProjectExplorer::Task(Task::Unknown, QLatin1String("SBSv2 build log"), << ProjectExplorer::Task(Task::Unknown, QLatin1String("SBSv2 build log"),
QLatin1String("X:/epoc32/build/Makefile.2010-08-10-15-25-52.log"), -1, Utils::FileName::fromUserInput("X:/epoc32/build/Makefile.2010-08-10-15-25-52.log"), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)))
<< QString(); << QString();
} }

View File

@@ -344,7 +344,7 @@ QList<ProjectExplorer::Task> SymbianQtVersion::reportIssuesImpl(const QString &p
results.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, results.append(ProjectExplorer::Task(ProjectExplorer::Task::Error,
QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker", QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker",
"The Symbian SDK and the project sources must reside on the same drive."), "The Symbian SDK and the project sources must reside on the same drive."),
QString(), -1, QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
return results; return results;
} }

View File

@@ -58,9 +58,9 @@ void WinscwParser::stdOutput(const QString &line)
if (m_compilerProblem.indexIn(lne) > -1) { if (m_compilerProblem.indexIn(lne) > -1) {
Task task(Task::Error, Task task(Task::Error,
m_compilerProblem.cap(3) /* description */, m_compilerProblem.cap(3) /* description */,
m_compilerProblem.cap(1) /* filename */, Utils::FileName::fromUserInput(m_compilerProblem.cap(1)) /* filename */,
m_compilerProblem.cap(2).toInt() /* linenumber */, m_compilerProblem.cap(2).toInt() /* linenumber */,
QLatin1String(TASK_CATEGORY_COMPILE)); Core::Id(TASK_CATEGORY_COMPILE));
if (task.description.startsWith(QLatin1String("warning: "))) { if (task.description.startsWith(QLatin1String("warning: "))) {
task.type = Task::Warning; task.type = Task::Warning;
task.description = task.description.mid(9); task.description = task.description.mid(9);
@@ -78,9 +78,9 @@ void WinscwParser::stdError(const QString &line)
if (m_linkerProblem.indexIn(lne) > -1) { if (m_linkerProblem.indexIn(lne) > -1) {
emit addTask(Task(Task::Error, emit addTask(Task(Task::Error,
m_linkerProblem.cap(2) /* description */, m_linkerProblem.cap(2) /* description */,
m_linkerProblem.cap(1) /* filename */, Utils::FileName::fromUserInput(m_linkerProblem.cap(1)) /* filename */,
-1 /* linenumber */, -1 /* linenumber */,
QLatin1String(TASK_CATEGORY_COMPILE))); Core::Id(TASK_CATEGORY_COMPILE)));
return; return;
} }
IOutputParser::stdError(line); IOutputParser::stdError(line);

View File

@@ -1017,8 +1017,8 @@ QList<ProjectExplorer::Task> BaseQtVersion::reportIssuesImpl(const QString &proF
if (!isValid()) { if (!isValid()) {
//: %1: Reason for being invalid //: %1: Reason for being invalid
const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", "The Qt version is invalid: %1").arg(invalidReason()); const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", "The Qt version is invalid: %1").arg(invalidReason());
results.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, msg, QString(), -1, results.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, msg, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
QFileInfo qmakeInfo = qmakeCommand().toFileInfo(); QFileInfo qmakeInfo = qmakeCommand().toFileInfo();
@@ -1027,8 +1027,8 @@ QList<ProjectExplorer::Task> BaseQtVersion::reportIssuesImpl(const QString &proF
//: %1: Path to qmake executable //: %1: Path to qmake executable
const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion",
"The qmake command \"%1\" was not found or is not executable.").arg(qmakeCommand().toUserOutput()); "The qmake command \"%1\" was not found or is not executable.").arg(qmakeCommand().toUserOutput());
results.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, msg, QString(), -1, results.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, msg, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
QString sourcePath = QFileInfo(proFile).absolutePath(); QString sourcePath = QFileInfo(proFile).absolutePath();
@@ -1038,14 +1038,14 @@ QList<ProjectExplorer::Task> BaseQtVersion::reportIssuesImpl(const QString &proF
if ((tmpBuildDir.startsWith(sourcePath)) && (tmpBuildDir != sourcePath)) { if ((tmpBuildDir.startsWith(sourcePath)) && (tmpBuildDir != sourcePath)) {
const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion",
"Qmake does not support build directories below the source directory."); "Qmake does not support build directories below the source directory.");
results.append(ProjectExplorer::Task(ProjectExplorer::Task::Warning, msg, QString(), -1, results.append(ProjectExplorer::Task(ProjectExplorer::Task::Warning, msg, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} else if (tmpBuildDir.count(slash) != sourcePath.count(slash) && qtVersion() < QtVersionNumber(4,8, 0)) { } else if (tmpBuildDir.count(slash) != sourcePath.count(slash) && qtVersion() < QtVersionNumber(4,8, 0)) {
const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion",
"The build directory needs to be at the same level as the source directory."); "The build directory needs to be at the same level as the source directory.");
results.append(ProjectExplorer::Task(ProjectExplorer::Task::Warning, msg, QString(), -1, results.append(ProjectExplorer::Task(ProjectExplorer::Task::Warning, msg, Utils::FileName(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
return results; return results;

View File

@@ -60,9 +60,9 @@ void QtParser::stdError(const QString &line)
lineno = -1; lineno = -1;
Task task(Task::Error, Task task(Task::Error,
m_mocRegExp.cap(5).trimmed(), m_mocRegExp.cap(5).trimmed(),
m_mocRegExp.cap(1) /* filename */, Utils::FileName::fromUserInput(m_mocRegExp.cap(1)) /* filename */,
lineno, lineno,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE));
if (m_mocRegExp.cap(4) == QLatin1String("Warning")) if (m_mocRegExp.cap(4) == QLatin1String("Warning"))
task.type = Task::Warning; task.type = Task::Warning;
emit addTask(task); emit addTask(task);
@@ -125,8 +125,8 @@ void QtSupportPlugin::testQtOutputParser_data()
<< QString() << QString() << QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning, << (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("No relevant classes found. No output generated."), QLatin1String("No relevant classes found. No output generated."),
QLatin1String("..\\untitled\\errorfile.h"), 0, Utils::FileName::fromUserInput("..\\untitled\\errorfile.h"), 0,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
QTest::newRow("moc warning 2") QTest::newRow("moc warning 2")
<< QString::fromLatin1("c:\\code\\test.h(96): Warning: Property declaration ) has no READ accessor function. The property will be invalid.") << QString::fromLatin1("c:\\code\\test.h(96): Warning: Property declaration ) has no READ accessor function. The property will be invalid.")
@@ -134,8 +134,8 @@ void QtSupportPlugin::testQtOutputParser_data()
<< QString() << QString() << QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning, << (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("Property declaration ) has no READ accessor function. The property will be invalid."), QLatin1String("Property declaration ) has no READ accessor function. The property will be invalid."),
QLatin1String("c:\\code\\test.h"), 96, Utils::FileName::fromUserInput("c:\\code\\test.h"), 96,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))) Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)))
<< QString(); << QString();
} }

View File

@@ -172,8 +172,8 @@ void AbstractPackagingStep::setDeploymentInfoUnmodified()
void AbstractPackagingStep::raiseError(const QString &errorMessage) void AbstractPackagingStep::raiseError(const QString &errorMessage)
{ {
emit addOutput(errorMessage, BuildStep::ErrorOutput); emit addOutput(errorMessage, BuildStep::ErrorOutput);
emit addTask(Task(Task::Error, errorMessage, QString(), -1, emit addTask(Task(Task::Error, errorMessage, Utils::FileName(), -1,
Constants::TASK_CATEGORY_BUILDSYSTEM)); Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -130,16 +130,16 @@ void AbstractRemoteLinuxDeployStep::handleProgressMessage(const QString &message
void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message) void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message)
{ {
emit addOutput(message, ErrorMessageOutput); emit addOutput(message, ErrorMessageOutput);
emit addTask(Task(Task::Error, message, QString(), -1, emit addTask(Task(Task::Error, message, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
d->hasError = true; d->hasError = true;
} }
void AbstractRemoteLinuxDeployStep::handleWarningMessage(const QString &message) void AbstractRemoteLinuxDeployStep::handleWarningMessage(const QString &message)
{ {
emit addOutput(message, ErrorMessageOutput); emit addOutput(message, ErrorMessageOutput);
emit addTask(Task(Task::Warning, message, QString(), -1, emit addTask(Task(Task::Warning, message, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
void AbstractRemoteLinuxDeployStep::handleFinished() void AbstractRemoteLinuxDeployStep::handleFinished()

View File

@@ -57,7 +57,7 @@ StopMonitoringHandler::~StopMonitoringHandler()
bool StopMonitoringHandler::canHandle(const ProjectExplorer::Task &task) bool StopMonitoringHandler::canHandle(const ProjectExplorer::Task &task)
{ {
return task.category == QLatin1String(Constants::TASKLISTTASK_ID); return task.category == Core::Id(Constants::TASKLISTTASK_ID);
} }
void StopMonitoringHandler::handle(const ProjectExplorer::Task &task) void StopMonitoringHandler::handle(const ProjectExplorer::Task &task)

View File

@@ -122,7 +122,9 @@ public:
} }
description = unescape(description); description = unescape(description);
hub->addTask(ProjectExplorer::Task(type, description, file, line, QLatin1String(Constants::TASKLISTTASK_ID))); hub->addTask(ProjectExplorer::Task(type, description,
Utils::FileName::fromUserInput(file), line,
Core::Id(Constants::TASKLISTTASK_ID)));
} }
return true; return true;
} }
@@ -196,7 +198,7 @@ bool TaskListPlugin::initialize(const QStringList &arguments, QString *errorMess
d->hub = pm->getObject<ProjectExplorer::TaskHub>(); d->hub = pm->getObject<ProjectExplorer::TaskHub>();
//: Category under which tasklist tasks are listed in Issues view //: Category under which tasklist tasks are listed in Issues view
d->hub->addCategory(QLatin1String(Constants::TASKLISTTASK_ID), tr("My Tasks")); d->hub->addCategory(Core::Id(Constants::TASKLISTTASK_ID), tr("My Tasks"));
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(":tasklist/TaskList.mimetypes.xml"), errorMessage)) if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(":tasklist/TaskList.mimetypes.xml"), errorMessage))
return false; return false;
@@ -228,7 +230,7 @@ void TaskListPlugin::stopMonitoring()
void TaskListPlugin::clearTasks() void TaskListPlugin::clearTasks()
{ {
d->hub->clearTasks(QLatin1String(Constants::TASKLISTTASK_ID)); d->hub->clearTasks(Core::Id(Constants::TASKLISTTASK_ID));
} }
Q_EXPORT_PLUGIN(TaskListPlugin) Q_EXPORT_PLUGIN(TaskListPlugin)