Commit 40080618 authored by Tobias Hunger's avatar Tobias Hunger

Qbs: Update to new way of Qbs announcing warnings

Change-Id: Ie707a24d5a081c058f838410c1223201ca4021b3
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent 0f51591c
......@@ -45,10 +45,13 @@ public:
TaskHub();
virtual ~TaskHub();
public slots:
void addCategory(const Core::Id &categoryId, const QString &displayName, bool visible = true);
void addTask(Task task);
void addTask(ProjectExplorer::Task task);
void clearTasks(const Core::Id &categoryId = Core::Id());
void removeTask(const Task &task);
void removeTask(const ProjectExplorer::Task &task);
public:
void updateTaskFileName(unsigned int id, const QString &fileName);
void updateTaskLineNumber(unsigned int id, int line);
void taskMarkClicked(unsigned int id);
......@@ -58,6 +61,7 @@ public:
void requestPopup();
QIcon taskTypeIcon(ProjectExplorer::Task::TaskType t) const;
signals:
void categoryAdded(const Core::Id &categoryId, const QString &displayName, bool visible);
void taskAdded(const ProjectExplorer::Task &task);
......
......@@ -135,8 +135,6 @@ void QbsBuildStep::run(QFutureInterface<bool> &fi)
this, SLOT(handleProgress(int)));
connect(m_job, SIGNAL(reportCommandDescription(QString,QString)),
this, SLOT(handleCommandDescriptionReport(QString,QString)));
connect(m_job, SIGNAL(reportWarning(qbs::Error)),
this, SLOT(handleWarningReport(qbs::Error)));
connect(m_job, SIGNAL(reportProcessResult(qbs::ProcessResult)),
this, SLOT(handleProcessResultReport(qbs::ProcessResult)));
}
......@@ -246,14 +244,6 @@ void QbsBuildStep::handleProgress(int value)
m_fi->setProgressValue(m_progressBase + value);
}
void QbsBuildStep::handleWarningReport(const qbs::Error &error)
{
foreach (const qbs::ErrorData &data, error.entries()) {
createTaskAndOutput(ProjectExplorer::Task::Warning, data.description(),
data.codeLocation().fileName(), data.codeLocation().line());
}
}
void QbsBuildStep::handleCommandDescriptionReport(const QString &highlight, const QString &message)
{
Q_UNUSED(highlight);
......
......@@ -78,7 +78,6 @@ private slots:
void buildingDone(bool success);
void handleTaskStarted(const QString &desciption, int max);
void handleProgress(int value);
void handleWarningReport(const qbs::Error &error);
void handleCommandDescriptionReport(const QString &highlight, const QString &message);
void handleProcessResultReport(const qbs::ProcessResult &result);
......
......@@ -32,6 +32,9 @@
#include <qbs.h>
#include <coreplugin/messagemanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/taskhub.h>
#include <utils/fileutils.h>
#include <QCoreApplication>
#include <QMutexLocker>
......@@ -46,6 +49,9 @@ namespace Internal {
QbsLogSink::QbsLogSink(QObject *parent) : QObject(parent)
{
ProjectExplorer::TaskHub *hub = ProjectExplorer::ProjectExplorerPlugin::instance()->taskHub();
connect(this, SIGNAL(newTask(ProjectExplorer::Task)),
hub, SLOT(addTask(ProjectExplorer::Task)), Qt::QueuedConnection);
}
void QbsLogSink::sendMessages()
......@@ -62,6 +68,16 @@ void QbsLogSink::sendMessages()
mm->printToOutputPane(msg);
}
void QbsLogSink::doPrintWarning(const qbs::Error &warning)
{
foreach (const qbs::ErrorData &data, warning.entries())
emit newTask(ProjectExplorer::Task(ProjectExplorer::Task::Warning,
data.description(),
Utils::FileName::fromString(data.codeLocation().fileName()),
data.codeLocation().line(),
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag)
{
Q_UNUSED(tag);
......
......@@ -30,6 +30,8 @@
#ifndef QBSLOGSINK_H
#define QBSLOGSINK_H
#include <projectexplorer/task.h>
#include <qbs.h>
#include <QMutex>
......@@ -45,10 +47,14 @@ class QbsLogSink : public QObject, public qbs::ILogSink
public:
QbsLogSink(QObject *parent = 0);
signals:
void newTask(const ProjectExplorer::Task &task);
private slots:
void sendMessages();
private:
void doPrintWarning(const qbs::Error &warning);
void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag);
QStringList m_messages;
......
Subproject commit 32ae53690c01e5269ac2a9ad0dadf549ce04ee3f
Subproject commit 5df624fa5884ba7ca9d1d0666484ad24c1c0b70b
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment