Changeset View
Changeset View
Standalone View
Standalone View
outputview/outputmodel.cpp
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 64 | ParseWorker() | |||
---|---|---|---|---|---|
66 | , m_filter(new NoFilterStrategy) | 66 | , m_filter(new NoFilterStrategy) | ||
67 | , m_timer(new QTimer(this)) | 67 | , m_timer(new QTimer(this)) | ||
68 | { | 68 | { | ||
69 | m_timer->setInterval(BATCH_AGGREGATE_TIME_DELAY); | 69 | m_timer->setInterval(BATCH_AGGREGATE_TIME_DELAY); | ||
70 | m_timer->setSingleShot(true); | 70 | m_timer->setSingleShot(true); | ||
71 | connect(m_timer, &QTimer::timeout, this, &ParseWorker::process); | 71 | connect(m_timer, &QTimer::timeout, this, &ParseWorker::process); | ||
72 | } | 72 | } | ||
73 | 73 | | |||
74 | public slots: | 74 | public Q_SLOTS: | ||
75 | void changeFilterStrategy( KDevelop::IFilterStrategy* newFilterStrategy ) | 75 | void changeFilterStrategy( KDevelop::IFilterStrategy* newFilterStrategy ) | ||
76 | { | 76 | { | ||
77 | m_filter = QSharedPointer<IFilterStrategy>( newFilterStrategy ); | 77 | m_filter = QSharedPointer<IFilterStrategy>( newFilterStrategy ); | ||
78 | } | 78 | } | ||
79 | 79 | | |||
80 | void addLines( const QStringList& lines ) | 80 | void addLines( const QStringList& lines ) | ||
81 | { | 81 | { | ||
82 | m_cachedLines << lines; | 82 | m_cachedLines << lines; | ||
Show All 9 Lines | |||||
92 | 92 | | |||
93 | void flushBuffers() | 93 | void flushBuffers() | ||
94 | { | 94 | { | ||
95 | m_timer->stop(); | 95 | m_timer->stop(); | ||
96 | process(); | 96 | process(); | ||
97 | emit allDone(); | 97 | emit allDone(); | ||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | signals: | 100 | Q_SIGNALS: | ||
101 | void parsedBatch(const QVector<KDevelop::FilteredItem>& filteredItems); | 101 | void parsedBatch(const QVector<KDevelop::FilteredItem>& filteredItems); | ||
102 | void progress(const KDevelop::IFilterStrategy::Progress& progress); | 102 | void progress(const KDevelop::IFilterStrategy::Progress& progress); | ||
103 | void allDone(); | 103 | void allDone(); | ||
104 | 104 | | |||
105 | private slots: | 105 | private Q_SLOTS: | ||
106 | /** | 106 | /** | ||
107 | * Process *all* cached lines, emit parsedBatch for each batch | 107 | * Process *all* cached lines, emit parsedBatch for each batch | ||
108 | */ | 108 | */ | ||
109 | void process() | 109 | void process() | ||
110 | { | 110 | { | ||
111 | QVector<KDevelop::FilteredItem> filteredItems; | 111 | QVector<KDevelop::FilteredItem> filteredItems; | ||
112 | filteredItems.reserve(qMin(BATCH_SIZE, m_cachedLines.size())); | 112 | filteredItems.reserve(qMin(BATCH_SIZE, m_cachedLines.size())); | ||
113 | 113 | | |||
▲ Show 20 Lines • Show All 362 Lines • Show Last 20 Lines |