From kde-devel Fri Sep 30 06:01:41 2005 From: Shahar Weiss Date: Fri, 30 Sep 2005 06:01:41 +0000 To: kde-devel Subject: Patch for kdeaddons/konq-plugins/dirfilter (and for Message-Id: <200509300901.41688.sweiss4 () gmx ! net> X-MARC-Message: https://marc.info/?l=kde-devel&m=112806004109077 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_FTNPDZ2QGzzScRg" --Boundary-00=_FTNPDZ2QGzzScRg Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. --Boundary-00=_FTNPDZ2QGzzScRg Content-Type: text/x-diff; charset="us-ascii"; name="dirfilterplugin-cpp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dirfilterplugin-cpp.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

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(search)->clearHiddenList(); + m_pURL = url; m_pMimeInfo.clear(); m_part->setMimeFilter (SessionManager::self()->restore(url)); --Boundary-00=_FTNPDZ2QGzzScRg Content-Type: text/x-diff; charset="us-ascii"; name="dirfilterplugin-h.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dirfilterplugin-h.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 #include +#include #include #include @@ -119,6 +120,8 @@ KonqDirPart* m_part; KActionMenu* m_pFilterMenu; + QWidget *search; + QMap m_pMimeInfo; typedef QMap::Iterator MimeInfoIterator; }; --Boundary-00=_FTNPDZ2QGzzScRg Content-Type: text/x-diff; charset="us-ascii"; name="kiconviewsearchline-cpp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kiconviewsearchline-cpp.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" --Boundary-00=_FTNPDZ2QGzzScRg Content-Type: text/x-diff; charset="us-ascii"; name="kiconviewsearchline-h.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kiconviewsearchline-h.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: --Boundary-00=_FTNPDZ2QGzzScRg Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline = >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscrib= e << --Boundary-00=_FTNPDZ2QGzzScRg--