diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-05-09 16:02:02 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-05-14 09:32:28 +0000 |
commit | 20d2d76824e7d86ec03d9d135e1f5300a38eda30 (patch) | |
tree | d2350c8b77a944ddad3870c1f401704f25a108c1 /src | |
parent | 6afd9ecaf3c852a5d7c3f42095233e60fcee5fdc (diff) |
Clang: Do not flash issues pane when switching editor
Previously, when swichting to a file with errors, the Issues pane button
would flash.
Stop this for the clang code model issues as it is rather annoying since
the issues pane is updated for the current document.
Change-Id: I403a8b8cd0deef586c53769d0b646855a7fc9278
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/clangcodemodel/clangdiagnosticmanager.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/task.cpp | 4 | ||||
-rw-r--r-- | src/plugins/projectexplorer/task.h | 11 | ||||
-rw-r--r-- | src/plugins/projectexplorer/taskhub.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/taskwindow.cpp | 7 |
5 files changed, 18 insertions, 8 deletions
diff --git a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp index 78db10c80d..8f35bee0a4 100644 --- a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp +++ b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp @@ -353,7 +353,7 @@ static void addTask(const ClangBackEnd::DiagnosticContainer &diagnostic, bool is diagnostic.location.line, Constants::TASK_CATEGORY_DIAGNOSTICS, icon, - /*addTextMark =*/ false)); + Task::NoOptions)); } void ClangDiagnosticManager::clearTaskHubIssues() diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp index d076b3e349..83409fadd5 100644 --- a/src/plugins/projectexplorer/task.cpp +++ b/src/plugins/projectexplorer/task.cpp @@ -61,8 +61,8 @@ unsigned int Task::s_nextId = 1; Task::Task(TaskType type_, const QString &description_, const Utils::FileName &file_, int line_, Core::Id category_, - const QIcon &icon, bool addTextMark) : - taskId(s_nextId), type(type_), addTextMark(addTextMark), description(description_), + const QIcon &icon, Options options) : + taskId(s_nextId), type(type_), options(options), description(description_), file(file_), line(line_), movedLine(line_), category(category_), icon(icon.isNull() ? taskTypeIcon(type_) : icon) { diff --git a/src/plugins/projectexplorer/task.h b/src/plugins/projectexplorer/task.h index a0f9c168e7..f3e1b76c88 100644 --- a/src/plugins/projectexplorer/task.h +++ b/src/plugins/projectexplorer/task.h @@ -52,11 +52,18 @@ public: Warning }; + enum Option : char { + NoOptions = 0, + AddTextMark = 1 << 0, + FlashWorthy = 1 << 1, + }; + using Options = char; + Task() = default; Task(TaskType type, const QString &description, const Utils::FileName &file, int line, Core::Id category, const QIcon &icon = QIcon(), - bool addTextMark = true); + Options options = AddTextMark | FlashWorthy); static Task compilerMissingTask(); static Task buildConfigurationMissingTask(); @@ -66,7 +73,7 @@ public: unsigned int taskId = 0; TaskType type = Unknown; - bool addTextMark = true; + Options options = AddTextMark | FlashWorthy; QString description; Utils::FileName file; int line = -1; diff --git a/src/plugins/projectexplorer/taskhub.cpp b/src/plugins/projectexplorer/taskhub.cpp index 0f00e79e9a..726034f066 100644 --- a/src/plugins/projectexplorer/taskhub.cpp +++ b/src/plugins/projectexplorer/taskhub.cpp @@ -154,7 +154,7 @@ void TaskHub::addTask(Task task) task.line = -1; task.movedLine = task.line; - if (task.addTextMark && task.line != -1) + if ((task.options & Task::AddTextMark) && task.line != -1) task.setMark(new TaskMark(task)); emit m_instance->taskAdded(task); } diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 215ec1eaee..79255cd367 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -446,9 +446,12 @@ void TaskWindow::addTask(const Task &task) emit tasksChanged(); navigateStateChanged(); - if (task.type == Task::Error && d->m_filter->filterIncludesErrors() - && !d->m_filter->filteredCategories().contains(task.category)) + if ((task.options & Task::FlashWorthy) + && task.type == Task::Error + && d->m_filter->filterIncludesErrors() + && !d->m_filter->filteredCategories().contains(task.category)) { flash(); + } } void TaskWindow::removeTask(const Task &task) |