KListView started, and almost ready

Benjamin Meyer ben at meyerhome.net
Wed Apr 4 10:03:42 BST 2007


On Wednesday 04 April 2007 02:31, Rafael Fernández López wrote:
> Hi all,
>
> I want to introduce two new  classes I would like to commit, if no one
> disagrees:
>
> - [kdelibs/kdeui/itemviews] KListView: This class inherits QListView, and
> its purpose is to draw correctly new categories.
> - [kdelibs/kdeui/itemviews] KItemCategorizer: The categorizer interface.
> KListView will ask if a categorizer was set, if it was, it will ask for
> each item in which category is it (asking for the role that was sorted the
> model, that must be a QSortFilterProxyModel). It needs to be reimplemented
> for different views.
>
> The patch is at http://www.ereslibre.es/kdelibs.diff

[snip]

looks nice

Some code comments:

No __ in ifndef's, that is reserved for the compiler
setModel is virtual, but doesn't have virtual to the left of it.  Either all 
reimplimented virtual functions should or none should.
There is no documentation (or at least stubs so doxygen wont complain).
Probably want to run it through astyle to get the coding style to match 
kdelibs
astyle --indent=spaces=4 --brackets=linux --indent-labels --pad=oper --one-line=keep-statements --convert-tabs --indent-preprocessor 
$file

Rather then KListView how about KCategoryView?
Rather then KItemCategorizer why couldn't just setting a role to query work?
There seems to be some important TODOs todo :)

Starting an autotest would be very cool (but not required)  Just making a stub 
that had one test that only constructed the class would be cool.

As the first use is Dolphin why don't you add the source to Dolphin first.  
Then it will be in svn, it will be tracked, you can work on the above things, 
fix the rest of the TODOs and get more feedback.  Then it can be easily moved 
into kdeui.

-Benjamin Meyer




More information about the kde-core-devel mailing list