Bug 173834 - Allow ordering of profiles in konsole profile applet
Summary: Allow ordering of profiles in konsole profile applet
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-konsoleprofiles (show other bugs)
Version: unspecified
Platform: Ubuntu Unspecified
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-29 14:48 UTC by Olaf Lenz
Modified: 2021-11-18 22:58 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.13


Attachments
Patch to konsoleprofiles.qml to enable alphabetical sorting of ListView entries. (541 bytes, patch)
2013-08-21 16:50 UTC, Norbert Eicker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olaf Lenz 2008-10-29 14:48:19 UTC
Version:            (using KDE 4.1.2)
Installed from:    Ubuntu Packages

When the number of profiles gets large (>10 or so), the list in the profile applet gets really confusing and hard to use.

It would be very nice, if the list of profiles would use the same order that hopefully will be used by konsole itself at some stage, as soon as wish #168530 is handled.

Together with the previously reported wish #173832 , this would give the konsole profile applet basically the same features as the konsole profile menu provides itself.
Comment 1 Olaf Lenz 2008-10-29 14:51:43 UTC
This is just to add links to the related bugs:
bug 173832 wishes for icons in the konsole profile plasmoid,
bug 168530 wishes for ordering of konsole profile in the konsole menu.
Comment 2 Gilboa Davara 2012-06-17 09:27:40 UTC
Is it being looked at?
(I'm currently on 4.9 beta2)

- Gilboa
Comment 3 g111 2013-01-23 07:26:14 UTC
I second this wish. Entries in the konsole profiles widget should be sorted the same way as in the konsole "Manage Profiles..." GUI or the "Settings->Switch Profile" menu. Currently (KDE 4.9) these entries are sorted alphabetically. This would be fine for the widget, too.

The user could decide to choose profile names that will order the entries in an acceptable way. Also the same profiles would be sorted the same way on different PCs.
Comment 4 rich.peiffer 2013-02-06 21:29:34 UTC
I use this widget extensively as I support many systems for my job.  The lack of an ordered list (even if it just alphabetic is fine with me) is making this very difficult to use.  Is anyone actually looking at this?

Please understand I'm not complaining as this work is done by volunteers, but I need to know if I need to look at some other options as my list has now grown to over 50 entries and it's very difficult to quickly locate which profile I need.
Comment 5 Peter Albrecht 2013-06-05 18:28:53 UTC
I can confirm this bug for openSUSE 12.3 (x86_64) with KDE 4.10.2 and Konsole version 2.10.2.

The Konsole profiles seem to have no sorting - at least not alphabetically, which makes finding a specific profile very time consuming.
Comment 6 Peter Albrecht 2013-06-05 19:29:18 UTC
I can also confirm this on Gentoo Linux (x86_64) with KDE 4.10.2 and Konsole version 2.10.2: no sorting algorithm recognizable, but alphabetical sorting would be desired.

In Gentoo Linux, the "Konsole Profiles" widget is in package "kde-base/kdeplasma-addons". Within this source package, one can find "./applets/konsoleprofiles/package/contents/ui/konsoleprofiles.qml". This UI definition contains a "ListView" (with id=view), which seems to hold the profiles we would like to have sorted.

But according to http://qt-project.org/forums/viewthread/11108 there is no simple function "ListView.sort()", yet. Quote Andre: "Instead, you could create your model from C++ and use a QSortFilterProxyModel to do the sorting, and then expose that model to your QML."

But since I have almost no KDE development experience, this is way too difficult for me to implement.

I also found in "./dataengines/konsoleprofiles/konsoleprofilesengine.cpp" a function implementation for "void KonsoleProfilesEngine::loadProfiles()", which seems to look like a good way to sort the profiles. But again: My KDE development skills are not sufficient to even understand, what exactly happens there.

But maybe this information might help somebody else to fix this nasty problem. Please. :)
Comment 7 Norbert Eicker 2013-08-21 16:48:54 UTC
(In reply to comment #6)
> I can also confirm this on Gentoo Linux (x86_64) with KDE 4.10.2 and Konsole
> version 2.10.2: no sorting algorithm recognizable, but alphabetical sorting
> would be desired.
Same here with openSUSE 12.3 (x86_64) with KDE 4.10.2.

> In Gentoo Linux, the "Konsole Profiles" widget is in package
> "kde-base/kdeplasma-addons". Within this source package, one can find
> "./applets/konsoleprofiles/package/contents/ui/konsoleprofiles.qml". This UI
> definition contains a "ListView" (with id=view), which seems to hold the
> profiles we would like to have sorted.
> 
> But according to http://qt-project.org/forums/viewthread/11108 there is no
> simple function "ListView.sort()", yet. Quote Andre: "Instead, you could
> create your model from C++ and use a QSortFilterProxyModel to do the
> sorting, and then expose that model to your QML."
> 
> But since I have almost no KDE development experience, this is way too
> difficult for me to implement.
> 
> I also found in "./dataengines/konsoleprofiles/konsoleprofilesengine.cpp" a
> function implementation for "void KonsoleProfilesEngine::loadProfiles()",
> which seems to look like a good way to sort the profiles. But again: My KDE
> development skills are not sufficient to even understand, what exactly
> happens there.
> 
> But maybe this information might help somebody else to fix this nasty
> problem. Please. :)

In fact after learning how QML, DataSource, DataModel, etc. works, fixing this isn't too complicated (as always). Basically you just have to replace the DataModel by a SortFilterModel and to choose an appropriate sortRole and sortOrder.

See the attached patch which has to be applied to konsoleprofiles.qml
Comment 8 Norbert Eicker 2013-08-21 16:50:42 UTC
Created attachment 81839 [details]
Patch to konsoleprofiles.qml to enable alphabetical sorting of ListView entries.
Comment 9 Kino 2013-12-12 20:34:53 UTC
I confirm this bug for 4.9.*, 4.10.* and 4.11.* on Fedora 18 and 19.

The patch proposed by Norbert Eicker fix the problem. 

I have to apply it manually every time Fedora update kde.

Please apply the patch to trunk.
Comment 10 Kino 2013-12-12 20:37:02 UTC
*** This bug has been confirmed by popular vote. ***
Comment 11 Gilboa Davara 2013-12-24 12:20:11 UTC
(In reply to comment #9)
> I confirm this bug for 4.9.*, 4.10.* and 4.11.* on Fedora 18 and 19.
> 
> The patch proposed by Norbert Eicker fix the problem. 
> 
> I have to apply it manually every time Fedora update kde.
> 
> Please apply the patch to trunk.

ACK. Works just fine on KDE 4.11.97 (4.12 beta) on Fedora 20.

- Gilboa
Comment 12 Christoph Feck 2014-02-09 17:01:27 UTC
Git commit f815a5213dde02ce0ae4a6a3c84e66c871421de4 by Christoph Feck, on behalf of Norbert Eicker.
Committed on 09/02/2014 at 16:59.
Pushed by cfeck into branch 'master'.

Sort profiles in Konsole profiles applet
FIXED-IN: 4.13

M  +6    -2    applets/konsoleprofiles/package/contents/ui/konsoleprofiles.qml

http://commits.kde.org/kdeplasma-addons/f815a5213dde02ce0ae4a6a3c84e66c871421de4
Comment 13 Christoph Feck 2014-02-09 17:04:45 UTC
Thanks Norbert for the patch!

In the future, please use https://reviewboard.kde.org/ for proposing patches.