[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Patch for kdeaddons/konq-plugins/dirfilter (and for
From:       Shahar Weiss <sweiss4 () gmx ! net>
Date:       2005-09-30 6:01:41
Message-ID: 200509300901.41688.sweiss4 () gmx ! net
[Download RAW message or body]

Hello.
Here are several patches created to affect the dirfilter plugin for konqueror. 
These patches were created to fix a problem when the directory in konqueror 
changes while filtering is taking place. The KIconViewSearchLine widget hides 
the icons that do not match the pattern in a list. When the patern changes, 
the widget checks in that least for icons that do match the current pattern 
and shows them if they do. However when konqueror's path changes 
(double-clicking a directory icon) the list of hidden items becomes outdated, 
and so when the pattern is changed icons which are non-existent are shown.

There are 4 patches in this mail, 2 for kdeaddons and 2 for kdelibs.
The ones for kdelibs add a new method to the KIconViewSearchLine widget called 
clearHiddenList() which simply clears all items in this list.
The patches for kdeaddons add the use of this new method whenever the 
directory presented by konqueror changes.

I'd like to note that this is my first contribution, in code at least, to the 
KDE project and so I'd like to hear your take on this.

Thank you,
Shahar.

["dirfilterplugin-cpp.diff" (text/x-diff)]

--- konq-plugins/dirfilter/dirfilterplugin.cpp-orig	2005-09-27 08:37:42.000000000 +0300
+++ konq-plugins/dirfilter/dirfilterplugin.cpp	2005-09-28 19:20:33.000000000 +0300
@@ -168,7 +168,7 @@
 
   clear->setWhatsThis(i18n("Clear filter field<p>Clears the content of the filter field."));
 
-  QWidget *search = 0;
+  search = 0;
   if ( m_part->scrollWidget()->inherits("QIconView") )
   {
     search = new KIconViewSearchLine(hbox);
@@ -205,6 +205,10 @@
 
   if (m_pURL != url)
   {
+    //Clears the hidden list which is by now outdated, in case we are using the IconView mode
+    if ( m_part->scrollWidget()->inherits("QIconView") )
+      static_cast<KIconViewSearchLine*>(search)->clearHiddenList();
+      
     m_pURL = url;
     m_pMimeInfo.clear();
     m_part->setMimeFilter (SessionManager::self()->restore(url));

["dirfilterplugin-h.diff" (text/x-diff)]

--- konq-plugins/dirfilter/dirfilterplugin.h-orig	2005-09-27 08:37:50.000000000 +0300
+++ konq-plugins/dirfilter/dirfilterplugin.h	2005-09-27 11:23:13.000000000 +0300
@@ -21,6 +21,7 @@
 
 #include <qmap.h>
 #include <qstringlist.h>
+#include <qwidget.h>
 
 #include <kurl.h>
 #include <kfileitem.h>
@@ -119,6 +120,8 @@
   KonqDirPart* m_part;
   KActionMenu* m_pFilterMenu;
 
+  QWidget *search;
+
   QMap<QString,MimeInfo> m_pMimeInfo;
   typedef QMap<QString,MimeInfo>::Iterator MimeInfoIterator;
 };

["kiconviewsearchline-cpp.diff" (text/x-diff)]

--- kdeui/kiconviewsearchline.cpp-orig	2005-09-27 08:36:27.000000000 +0300
+++ kdeui/kiconviewsearchline.cpp	2005-09-28 21:12:19.000000000 +0300
@@ -49,6 +49,7 @@
   QString search;
   int queuedSearches;
   QIconViewItemList hiddenItems;
+
 };
 
 /******************************************************************************
@@ -271,4 +272,11 @@
   setEnabled( false );
 }
 
+void KIconViewSearchLine::clearHiddenList()
+{
+  // Clear hidden list
+  d->queuedSearches = 0;
+  d->hiddenItems.clear();
+}
+
 #include "kiconviewsearchline.moc"

["kiconviewsearchline-h.diff" (text/x-diff)]

--- kdeui/kiconviewsearchline.h-orig	2005-09-27 08:36:36.000000000 +0300
+++ kdeui/kiconviewsearchline.h	2005-09-27 09:40:57.000000000 +0300
@@ -76,6 +76,8 @@
    * @see setIconView()
    */
   QIconView *iconView() const;
+  
+  void clearHiddenList(); //This method simply dumps the items in the hidden list. \
It is used in kdeaddons/konq-plugins/dirfilter  
 
 public slots:



 =

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscrib=
e <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic