summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/taskhub.cpp
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@nokia.com>2012-02-08 17:21:12 +0100
committerDaniel Teske <daniel.teske@nokia.com>2012-02-14 14:27:30 +0100
commitb267027c9e99185bf9d92ee7952b1a4b98f82d65 (patch)
treed41540227eb59511462638788016ee764a724473 /src/plugins/projectexplorer/taskhub.cpp
parentcf4c131541f5b73caccc8280db963a95de1a0acb (diff)
downloadqt-creator-b267027c9e99185bf9d92ee7952b1a4b98f82d65.tar.gz
Optimize BaseTextMark
Instead of each BaseTextMark being a QObject and being connected to editorOpened, centralize that and distribute the signal to only the BaseTextMarks that need it. Change-Id: I3f2783c34a25d78aa335418236850436028bfdf3 Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Diffstat (limited to 'src/plugins/projectexplorer/taskhub.cpp')
-rw-r--r--src/plugins/projectexplorer/taskhub.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/projectexplorer/taskhub.cpp b/src/plugins/projectexplorer/taskhub.cpp
index 365775bf9c..bfc2d07061 100644
--- a/src/plugins/projectexplorer/taskhub.cpp
+++ b/src/plugins/projectexplorer/taskhub.cpp
@@ -41,8 +41,8 @@ using namespace ProjectExplorer;
class TaskMark : public TextEditor::BaseTextMark
{
public:
- TaskMark(unsigned int id)
- : m_id(id)
+ TaskMark(unsigned int id, const QString &fileName, int lineNumber)
+ : BaseTextMark(fileName, lineNumber), m_id(id)
{}
void updateLineNumber(int lineNumber);
@@ -82,13 +82,11 @@ void TaskHub::addCategory(const Core::Id &categoryId, const QString &displayName
void TaskHub::addTask(Task task)
{
if (task.line != -1 && !task.file.isEmpty()) {
- TaskMark *mark = new TaskMark(task.taskId);
+ TaskMark *mark = new TaskMark(task.taskId, task.file.toString(), task.line);
mark->setIcon(taskTypeIcon(task.type));
- mark->setLocation(task.file.toString(), task.line);
mark->setPriority(TextEditor::ITextMark::HighPriority);
task.addMark(mark);
}
-
emit taskAdded(task);
}