diff options
| author | Elvis Angelaccio <[email protected]> | 2020-05-31 23:43:46 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2020-05-31 23:45:07 +0200 |
| commit | c16f777b289fb617217c8c19aa320fbe90f38209 (patch) | |
| tree | 9dd3b55688093cc3e56a638b298f92b67b6a1cbc /src/kitemviews/private | |
| parent | 664f97ff0d1c70f7df4f4fa32303949ee7a6e8fb (diff) | |
Fix FIFO usage
`m_propriorityQueue` and `m_queue` are used as FIFO queues, so we need
to use `takeFirst()` instead of `takeLast()` when removing elements
from the queue.
While at it, add a comment so that we will remember these are FIFO
queues.
Diffstat (limited to 'src/kitemviews/private')
| -rw-r--r-- | src/kitemviews/private/kdirectorycontentscounter.cpp | 2 | ||||
| -rw-r--r-- | src/kitemviews/private/kdirectorycontentscounter.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/kitemviews/private/kdirectorycontentscounter.cpp b/src/kitemviews/private/kdirectorycontentscounter.cpp index 05a6ff447..4d6a4861c 100644 --- a/src/kitemviews/private/kdirectorycontentscounter.cpp +++ b/src/kitemviews/private/kdirectorycontentscounter.cpp @@ -104,7 +104,7 @@ void KDirectoryContentsCounter::slotResult(const QString& path, int count, long } if (!m_priorityQueue.isEmpty()) { - startWorker(m_priorityQueue.takeLast()); + startWorker(m_priorityQueue.takeFirst()); } else if (!m_queue.isEmpty()) { startWorker(m_queue.takeFirst()); } diff --git a/src/kitemviews/private/kdirectorycontentscounter.h b/src/kitemviews/private/kdirectorycontentscounter.h index 01bf30779..65c4bcb1b 100644 --- a/src/kitemviews/private/kdirectorycontentscounter.h +++ b/src/kitemviews/private/kdirectorycontentscounter.h @@ -72,6 +72,7 @@ private: private: KFileItemModel* m_model; + // Used as FIFO queues. QLinkedList<QString> m_priorityQueue; QLinkedList<QString> m_queue; |
