mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +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
2 changed files with 6 additions and 4 deletions
|
@ -104,7 +104,7 @@ void KDirectoryContentsCounter::slotResult(const QString& path, int count, long
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_queue.isEmpty()) {
|
if (!m_queue.isEmpty()) {
|
||||||
startWorker(m_queue.dequeue());
|
startWorker(m_queue.takeFirst());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_cache->contains(resolvedPath)) {
|
if (s_cache->contains(resolvedPath)) {
|
||||||
|
@ -175,7 +175,9 @@ void KDirectoryContentsCounter::startWorker(const QString& path)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_workerIsBusy) {
|
if (m_workerIsBusy) {
|
||||||
m_queue.enqueue(path);
|
if (!m_queue.contains(path)) {
|
||||||
|
m_queue.append(path);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
KDirectoryContentsCounterWorker::Options options;
|
KDirectoryContentsCounterWorker::Options options;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include "kdirectorycontentscounterworker.h"
|
#include "kdirectorycontentscounterworker.h"
|
||||||
|
|
||||||
#include <QQueue>
|
#include <QLinkedList>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ private:
|
||||||
private:
|
private:
|
||||||
KFileItemModel* m_model;
|
KFileItemModel* m_model;
|
||||||
|
|
||||||
QQueue<QString> m_queue;
|
QLinkedList<QString> m_queue;
|
||||||
|
|
||||||
static QThread* m_workerThread;
|
static QThread* m_workerThread;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue