mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
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.
This commit is contained in:
parent
664f97ff0d
commit
c16f777b28
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ private:
|
|||
private:
|
||||
KFileItemModel* m_model;
|
||||
|
||||
// Used as FIFO queues.
|
||||
QLinkedList<QString> m_priorityQueue;
|
||||
QLinkedList<QString> m_queue;
|
||||
|
||||
|
|
Loading…
Reference in a new issue