diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp | 11 | ||||
-rw-r--r-- | src/plugins/qmakeprojectmanager/qmakeproject.cpp | 7 | ||||
-rw-r--r-- | src/plugins/qmakeprojectmanager/qmakeproject.h | 2 | ||||
-rw-r--r-- | src/plugins/qtsupport/profilereader.cpp | 18 |
4 files changed, 26 insertions, 12 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp index 0babec02e8..ca5f43bfc6 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp @@ -39,6 +39,7 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> +#include <projectexplorer/taskhub.h> #include <qtsupport/profilereader.h> #include <texteditor/icodestylepreferences.h> #include <texteditor/tabsettings.h> @@ -774,7 +775,7 @@ QPair<ProFile *, QStringList> QmakePriFile::readProFile() &contents, &m_textFormat, &errorMsg) != TextFileFormat::ReadSuccess) { - QmakeBuildSystem::proFileParseError(errorMsg); + QmakeBuildSystem::proFileParseError(errorMsg, filePath()); return qMakePair(includeFile, lines); } lines = contents.split('\n'); @@ -1655,7 +1656,7 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult) } foreach (const QString &error, evalResult->errors) - QmakeBuildSystem::proFileParseError(error); + QmakeBuildSystem::proFileParseError(error, filePath()); // we are changing what is executed in that case if (result->state == QmakeEvalResult::EvalFail || m_buildSystem->wasEvaluateCanceled()) { @@ -1666,8 +1667,10 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult) if (result->state == QmakeEvalResult::EvalFail) { QmakeBuildSystem::proFileParseError( - QCoreApplication::translate("QmakeProFile", "Error while parsing file %1. Giving up.") - .arg(filePath().toUserOutput())); + QCoreApplication::translate("QmakeProFile", + "Error while parsing file %1. Giving up.") + .arg(filePath().toUserOutput()), + filePath()); if (m_projectType == ProjectType::Invalid) return; diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 6d0cb2e6da..b0ac2097d3 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -646,6 +646,7 @@ bool QmakeBuildSystem::wasEvaluateCanceled() void QmakeBuildSystem::asyncUpdate() { + TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); setParseDelay(UPDATE_INTERVAL); TRACE(""); @@ -671,7 +672,7 @@ void QmakeBuildSystem::asyncUpdate() "have a valid Qt.") .arg(project()->displayName(), k->displayName()) : tr("Cannot parse project \"%1\": No kit selected.").arg(project()->displayName()); - proFileParseError(errorMessage); + proFileParseError(errorMessage, project()->projectFilePath()); m_asyncUpdateFutureInterface.reportCanceled(); m_asyncUpdateFutureInterface.reportFinished(); return; @@ -761,9 +762,9 @@ FilePath QmakeBuildSystem::buildDir(const FilePath &proFilePath) const return FilePath::fromString(QDir::cleanPath(QDir(buildDir).absoluteFilePath(relativeDir))); } -void QmakeBuildSystem::proFileParseError(const QString &errorMessage) +void QmakeBuildSystem::proFileParseError(const QString &errorMessage, const FilePath &filePath) { - Core::MessageManager::write(errorMessage); + TaskHub::addTask(BuildSystemTask(Task::Error, errorMessage, filePath)); } QtSupport::ProFileReader *QmakeBuildSystem::createProFileReader(const QmakeProFile *qmakeProFile) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h index af10652c35..fba8c8db7a 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.h +++ b/src/plugins/qmakeprojectmanager/qmakeproject.h @@ -158,7 +158,7 @@ public: void watchFolders(const QStringList &l, QmakePriFile *file); void unwatchFolders(const QStringList &l, QmakePriFile *file); - static void proFileParseError(const QString &errorMessage); + static void proFileParseError(const QString &errorMessage, const Utils::FilePath &filePath); enum AsyncUpdateState { Base, AsyncFullUpdatePending, AsyncPartialUpdatePending, AsyncUpdateInProgress, ShuttingDown }; AsyncUpdateState asyncUpdateState() const; diff --git a/src/plugins/qtsupport/profilereader.cpp b/src/plugins/qtsupport/profilereader.cpp index d7a3854450..0e6e8179c5 100644 --- a/src/plugins/qtsupport/profilereader.cpp +++ b/src/plugins/qtsupport/profilereader.cpp @@ -26,10 +26,12 @@ #include "profilereader.h" #include <coreplugin/icore.h> +#include <projectexplorer/taskhub.h> #include <QCoreApplication> #include <QDebug> +using namespace ProjectExplorer; using namespace QtSupport; static QString format(const QString &fileName, int lineNo, const QString &msg) @@ -53,7 +55,7 @@ ProMessageHandler::ProMessageHandler(bool verbose, bool exact) ProMessageHandler::~ProMessageHandler() { if (!m_messages.isEmpty()) - Core::MessageManager::writeMessages(m_messages); + Core::MessageManager::writeMessages(m_messages, Core::MessageManager::Flash); } @@ -61,14 +63,22 @@ ProMessageHandler::~ProMessageHandler() void ProMessageHandler::message(int type, const QString &msg, const QString &fileName, int lineNo) { if ((type & CategoryMask) == ErrorMessage && ((type & SourceMask) == SourceParser || m_verbose)) { - appendMessage(format(fileName, lineNo, msg)); + // parse error in qmake files + TaskHub::addTask( + BuildSystemTask(Task::Error, msg, Utils::FilePath::fromString(fileName), lineNo)); } } void ProMessageHandler::fileMessage(int type, const QString &msg) { - Q_UNUSED(type) - if (m_verbose) + // message(), warning() or error() calls in qmake files + if (!m_verbose) + return; + if (type == QMakeHandler::ErrorMessage) + TaskHub::addTask(BuildSystemTask(Task::Error, msg)); + else if (type == QMakeHandler::WarningMessage) + TaskHub::addTask(BuildSystemTask(Task::Warning, msg)); + else appendMessage(msg); } |