Commit 13c8f9ea authored by Christian Kamm's avatar Christian Kamm

BuildManager: Only pop up build issues if there are relevant issues.

Previously it also poped up and showed a build failure if there were
any error-type tasks in 'My Tasks', 'Analyser' or 'QML'.

Change-Id: Ie86be0afe1f0b7571b2cb764b7c53f282183b513
Reviewed-on: http://codereview.qt.nokia.com/2807Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent bf8cb5d4
...@@ -228,7 +228,9 @@ void BuildManager::cancel() ...@@ -228,7 +228,9 @@ void BuildManager::cancel()
void BuildManager::updateTaskCount() void BuildManager::updateTaskCount()
{ {
Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager(); Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager();
const int errors = d->m_taskWindow->errorTaskCount(); const int errors =
d->m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_BUILDSYSTEM)
+ d->m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_COMPILE);
if (errors > 0) { if (errors > 0) {
progressManager->setApplicationLabel(QString::number(errors)); progressManager->setApplicationLabel(QString::number(errors));
} else { } else {
...@@ -287,7 +289,10 @@ void BuildManager::toggleTaskWindow() ...@@ -287,7 +289,10 @@ void BuildManager::toggleTaskWindow()
bool BuildManager::tasksAvailable() const bool BuildManager::tasksAvailable() const
{ {
return d->m_taskWindow->taskCount() > 0; const int count =
d->m_taskWindow->taskCount(Constants::TASK_CATEGORY_BUILDSYSTEM)
+ d->m_taskWindow->taskCount(Constants::TASK_CATEGORY_COMPILE);
return count > 0;
} }
void BuildManager::startBuildQueue() void BuildManager::startBuildQueue()
...@@ -327,7 +332,7 @@ void BuildManager::startBuildQueue() ...@@ -327,7 +332,7 @@ void BuildManager::startBuildQueue()
void BuildManager::showBuildResults() void BuildManager::showBuildResults()
{ {
if (d->m_taskWindow->taskCount() != 0) if (tasksAvailable())
toggleTaskWindow(); toggleTaskWindow();
else else
toggleOutputWindow(); toggleOutputWindow();
......
...@@ -876,19 +876,38 @@ void TaskWindow::filterCategoryTriggered(QAction *action) ...@@ -876,19 +876,38 @@ void TaskWindow::filterCategoryTriggered(QAction *action)
setCategoryVisibility(categoryId, action->isChecked()); setCategoryVisibility(categoryId, action->isChecked());
} }
int TaskWindow::taskCount() const int TaskWindow::taskCount(const QString &category) const
{ {
return d->m_model->taskCount(); if (category.isEmpty())
return d->m_model->taskCount();
return d->m_model->tasks(category).size();
} }
int TaskWindow::errorTaskCount() const int TaskWindow::errorTaskCount(const QString &category) const
{ {
return d->m_model->errorTaskCount(); if (category.isEmpty())
return d->m_model->errorTaskCount();
int count = 0;
foreach (const Task &task, d->m_model->tasks(category)) {
if (task.type == Task::Error)
++count;
}
return count;
} }
int TaskWindow::warningTaskCount() const int TaskWindow::warningTaskCount(const QString &category) const
{ {
return d->m_model->warningTaskCount(); if (category.isEmpty())
return d->m_model->warningTaskCount();
int count = 0;
foreach (const Task &task, d->m_model->tasks(category)) {
if (task.type == Task::Warning)
++count;
}
return count;
} }
int TaskWindow::priorityInStatusBar() const int TaskWindow::priorityInStatusBar() const
......
...@@ -57,9 +57,9 @@ public: ...@@ -57,9 +57,9 @@ public:
TaskWindow(ProjectExplorer::TaskHub *taskHub); TaskWindow(ProjectExplorer::TaskHub *taskHub);
virtual ~TaskWindow(); virtual ~TaskWindow();
int taskCount() const; int taskCount(const QString &category = QString()) const;
int warningTaskCount() const; int warningTaskCount(const QString &category = QString()) const;
int errorTaskCount() const; int errorTaskCount(const QString &category = QString()) const;
// IOutputPane // IOutputPane
QWidget *outputWidget(QWidget *); QWidget *outputWidget(QWidget *);
......
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