[PATCH] Make KListView honor renameability

Ravi ravi at kde.org
Fri Dec 19 00:29:45 GMT 2003


Hi,
  The following patch makes KListView honor QListViewItem::setRenameEnabled(). 
If there are no objections to this patch, I'll apply it on saturday:

Index: kdeui/klistview.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/klistview.cpp,v
retrieving revision 1.211
diff -u -p -w -r1.211 klistview.cpp
--- kdeui/klistview.cpp	6 Nov 2003 02:06:41 -0000	1.211
+++ kdeui/klistview.cpp	19 Dec 2003 00:19:27 -0000
@@ -1323,7 +1323,7 @@ void KListView::cleanItemHighlighter ()
 
 void KListView::rename(QListViewItem *item, int c)
 {
-  if (d->renameable.contains(c))
+  if (d->renameable.contains(c) && item->renameEnabled(c))
   {
     ensureItemVisible(item);
     d->editor->load(item,c);

Apart from this, there are several issues with KListView that relate to it 
bypassing the QListView(Item) methods. I guess such code is an artifact of 
the time when Qt did not provide the desired functionality. Much of it is 
implemented using event filters (in one disguise or another) and makes for 
scary reading - any volunteers to help me clean it up post 3.2?

Regards,
Ravi





More information about the kde-core-devel mailing list