From 8a34a88474735ca9b090a8e17b674f856a59be70 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 4 Jun 2010 05:43:41 +0000 Subject: [PATCH] Fixed bug causing continuous refresh of filterbar, thereby preventing scrolling in Konqueror iconview mode git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1134358 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- konq-plugins/dirfilter/dirfilterplugin.cpp | 11 ++++++++++- konq-plugins/dirfilter/dirfilterplugin.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/konq-plugins/dirfilter/dirfilterplugin.cpp b/konq-plugins/dirfilter/dirfilterplugin.cpp index 3e16bf4..dbf034f 100644 --- a/konq-plugins/dirfilter/dirfilterplugin.cpp +++ b/konq-plugins/dirfilter/dirfilterplugin.cpp @@ -145,7 +145,8 @@ DirFilterPlugin::DirFilterPlugin (QObject* parent, const char* name, const QStringList&) :KParts::Plugin (parent, name), m_pFilterMenu(0), - m_searchWidget(0) + m_searchWidget(0), + m_oldFilterString("") { m_part = ::qt_cast(parent); @@ -473,6 +474,14 @@ void DirFilterPlugin::slotItemRemoved (const KFileItem* item) void DirFilterPlugin::activateSearch() { + if (!m_searchWidget) + return; + + if (m_oldFilterString == m_searchWidget->text()) + return; + + m_oldFilterString = m_searchWidget->text(); + if ( ::qt_cast(m_part->scrollWidget()) ) { static_cast(m_searchWidget)->updateSearch(); } diff --git a/konq-plugins/dirfilter/dirfilterplugin.h b/konq-plugins/dirfilter/dirfilterplugin.h index 74ad8e2..963d731 100644 --- a/konq-plugins/dirfilter/dirfilterplugin.h +++ b/konq-plugins/dirfilter/dirfilterplugin.h @@ -127,6 +127,7 @@ private: KonqDirPart* m_part; QTimer *m_refreshTimer; KActionMenu* m_pFilterMenu; + QString m_oldFilterString; KLineEdit *m_searchWidget; QMap m_pMimeInfo;