[Wishlist] Save the sorting criterion to view profile

David Faure dfaure at trolltech.com
Fri May 23 21:21:55 BST 2003


On Friday 23 May 2003 21:47, Anna Nymos wrote:
> On Tuesday 22 April 2003 21:44, David Faure wrote:
> > Yes, I would prefer to see this in konq_propsview like the listviews do.
> > This is more intuitive (auto-saving), and also allows to save into a
> > particular directory.
> 
> Sorry for responding so late,
> I made a new patch to save sorting criterion using KonqPropsView. Could you 
> please have a look into it and commit it if it's ok? Thanks in advance.
> This solves http://bugs.kde.org/show_bug.cgi?id=26561

Great.
Only one flaw in the patch:
+    QString sortcrit=KonqIconViewFactory::defaultViewProps()->getSortCriterion();
+    KRadioAction *sort_action = (KRadioAction *)actionCollection()->action(sortcrit.latin1());
This is quite dangerous, it could lead to memory corruption if sortcrit contained (for whichever
reason) the name of an action that's not a KRadioAction. I suggest
KRadioAction *sort_action = dynamic_cast<KRadioAction *>(actionCollection()->action(sortcrit.latin1()));
at least, for proper type checking.

The other way would be to have an enum in konqpropsview, and a switch here, 
(and one in konqpropsview to save a readable string etc. etc.). Indeed quite 
some more code for not much gain.

I just saw that the sort criterion of the listview isn't really saved in konqpropsview,
only the "case insensitive" boolean (which is a bit redundant with the above).
Bah, the iconview and the listview have different concepts about sorting,
that's for sure (the listview allows many more possibilities).

Ah you don't have CVS access, right? Would like to, or shall I just commit
your patch?

> >[..]
> > After all this is just one more property of the iconview,
> > like e.g. the icon size, so it should all be together (KonqPropsView).
> > If the sorting criterion should go into a profile, the icon size etc.
> > should do so too - I think this is an independent missing feature.
> 
> I didn't implement saving properties to profile because this feature is not 
> needed by many people, is it? The only reason why I saved it into profile 
> last time is, that I didn't think about autosaving when I did the patch.

Fine with me :)

-- 
David FAURE, faure at kde.org, sponsored by TrollTech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
Qtella users - stability patches at http://blackie.dk/~dfaure/qtella.html




More information about the kfm-devel mailing list