aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/linuxiccparser.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2013-05-03 16:08:00 +0200
committerTobias Hunger <tobias.hunger@digia.com>2013-05-06 10:04:38 +0200
commit8bbad43019af98e342d6a5b311016fa20198e4cf (patch)
tree0727f9ffd34dd0d6dfd221558e2aa69b295f4742 /src/plugins/projectexplorer/linuxiccparser.cpp
parent14763118a58bf526f873b6750c3785f8752e4d7e (diff)
OutputParser: Allow to flush pending tasks.
Add a way to flush out tasks from the outputparsers. This is necessary to make parsers that keep state more robust. Flush parsers (once) before adding any new task. This keeps the sequence intact. Flush all parsers once the parsing is done to make sure there is no task queued somewhere. Task-number: QTCREATORBUG-9195 Change-Id: Icd37df1f470cb73123ad286d6900ad1047a1d512 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/projectexplorer/linuxiccparser.cpp')
-rw-r--r--src/plugins/projectexplorer/linuxiccparser.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp
index bdbe37835c..bdd6f3ac1f 100644
--- a/src/plugins/projectexplorer/linuxiccparser.cpp
+++ b/src/plugins/projectexplorer/linuxiccparser.cpp
@@ -58,12 +58,6 @@ LinuxIccParser::LinuxIccParser()
appendOutputParser(new LdParser);
}
-LinuxIccParser::~LinuxIccParser()
-{
- if (!m_temporary.isNull())
- addTask(m_temporary);
-}
-
void LinuxIccParser::stdError(const QString &line)
{
if (m_expectFirstLine && m_firstLine.indexIn(line) != -1) {
@@ -107,6 +101,15 @@ void LinuxIccParser::stdError(const QString &line)
}
}
+void LinuxIccParser::doFlush()
+{
+ if (m_temporary.isNull())
+ return;
+ Task t = m_temporary;
+ m_temporary.clear();
+ emit addTask(t);
+}
+
#ifdef WITH_TESTS
# include <QTest>
# include "projectexplorer.h"