Commit eda05b12 authored by Méven Car's avatar Méven Car
Browse files

KDirectoryContentsCounter: don't schedule scanning a folder already in the Queue

Use a QLinkedList to check for presence in the queue.

merge request !2
parent 3c997217
......@@ -104,7 +104,7 @@ void KDirectoryContentsCounter::slotResult(const QString& path, int count, long
}
if (!m_queue.isEmpty()) {
startWorker(m_queue.dequeue());
startWorker(m_queue.takeFirst());
}
if (s_cache->contains(resolvedPath)) {
......@@ -175,7 +175,9 @@ void KDirectoryContentsCounter::startWorker(const QString& path)
}
if (m_workerIsBusy) {
m_queue.enqueue(path);
if (!m_queue.contains(path)) {
m_queue.append(path);
}
} else {
KDirectoryContentsCounterWorker::Options options;
......
......@@ -23,7 +23,7 @@
#include "kdirectorycontentscounterworker.h"
#include <QQueue>
#include <QLinkedList>
#include <QSet>
#include <QHash>
......@@ -72,7 +72,7 @@ private:
private:
KFileItemModel* m_model;
QQueue<QString> m_queue;
QLinkedList<QString> m_queue;
static QThread* m_workerThread;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment