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

List:       kde-core-devel
Subject:    [PATCH] Make KListView honor renameability
From:       Ravi <ravi () kde ! org>
Date:       2003-12-19 0:29:45
[Download RAW message or body]

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

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

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