┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/private/kdirectorycontentscounter.cpp19
-rw-r--r--src/kitemviews/private/kdirectorycontentscounter.h5
2 files changed, 14 insertions, 10 deletions
diff --git a/src/kitemviews/private/kdirectorycontentscounter.cpp b/src/kitemviews/private/kdirectorycontentscounter.cpp
index 4d6a4861c..608f9f582 100644
--- a/src/kitemviews/private/kdirectorycontentscounter.cpp
+++ b/src/kitemviews/private/kdirectorycontentscounter.cpp
@@ -103,10 +103,14 @@ void KDirectoryContentsCounter::slotResult(const QString& path, int count, long
m_watchedDirs.insert(resolvedPath);
}
- if (!m_priorityQueue.isEmpty()) {
- startWorker(m_priorityQueue.takeFirst());
- } else if (!m_queue.isEmpty()) {
- startWorker(m_queue.takeFirst());
+ if (!m_priorityQueue.empty()) {
+ const QString firstPath = m_priorityQueue.front();
+ m_priorityQueue.pop_front();
+ startWorker(firstPath);
+ } else if (!m_queue.empty()) {
+ const QString firstPath = m_queue.front();
+ m_queue.pop_front();
+ startWorker(firstPath);
}
if (s_cache->contains(resolvedPath)) {
@@ -178,12 +182,13 @@ void KDirectoryContentsCounter::startWorker(const QString& path)
}
if (m_workerIsBusy) {
- if (!m_queue.contains(path) && !m_priorityQueue.contains(path)) {
+ if (std::find(m_queue.begin(), m_queue.end(), path) == m_queue.end() &&
+ std::find(m_priorityQueue.begin(), m_priorityQueue.end(), path) == m_priorityQueue.end()) {
if (alreadyInCache) {
- m_queue.append(path);
+ m_queue.push_back(path);
} else {
// append to priority queue
- m_priorityQueue.append(path);
+ m_priorityQueue.push_back(path);
}
}
} else {
diff --git a/src/kitemviews/private/kdirectorycontentscounter.h b/src/kitemviews/private/kdirectorycontentscounter.h
index 65c4bcb1b..d5baf3462 100644
--- a/src/kitemviews/private/kdirectorycontentscounter.h
+++ b/src/kitemviews/private/kdirectorycontentscounter.h
@@ -23,7 +23,6 @@
#include "kdirectorycontentscounterworker.h"
-#include <QLinkedList>
#include <QSet>
#include <QHash>
@@ -73,8 +72,8 @@ private:
KFileItemModel* m_model;
// Used as FIFO queues.
- QLinkedList<QString> m_priorityQueue;
- QLinkedList<QString> m_queue;
+ std::list<QString> m_priorityQueue;
+ std::list<QString> m_queue;
static QThread* m_workerThread;