From c16f777b289fb617217c8c19aa320fbe90f38209 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 31 May 2020 23:43:46 +0200 Subject: 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. --- src/kitemviews/private/kdirectorycontentscounter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/kitemviews/private/kdirectorycontentscounter.cpp') 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()); } -- cgit v1.3.1