From 410f48e0cb1829668ce77ae0049d8254b47b85a9 Mon Sep 17 00:00:00 2001
From: Alexander Golubev <fatzer2@gmail.com>
Date: Fri, 27 Mar 2026 20:27:03 +0300
Subject: kdesktop: stop pending KDirListner jobs on view clear

If the KDirListner, keeps working in can result in items being added to
the list after the list gets cleared.

In practise this can result in items being listed several times after
rapid successful updates.

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
---
 kdesktop/kdiconview.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kdesktop/kdiconview.cpp b/kdesktop/kdiconview.cpp
index 26821f89f..aba33c1fe 100644
--- a/kdesktop/kdiconview.cpp
+++ b/kdesktop/kdiconview.cpp
@@ -1467,6 +1467,10 @@ void KDIconView::takeItem( TQIconViewItem *item ) {
 }
 
 void KDIconView::clear() {
+    // stop any running jobs in case there are (they may cause problems in case
+    // of several rapid successive updates)
+    m_dirLister->stop();
+
     m_paOutstandingFreeSpaceOverlays.clear();
 
     KonqIconViewWidget::clear();
-- 
cgit v1.2.3

