mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
KDirectoryContentsCounter: don't schedule scanning a folder already in the Queue
Use a QLinkedList to check for presence in the queue. merge request !2
This commit is contained in:
parent
3c9972179b
commit
eda05b12fb
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue