Bug 389223

Summary: File > Sessions list ORDER is not the same as in ~/.local/share/konqueror/sessions
Product: [Applications] konqueror Reporter: dachgo.info
Component: generalAssignee: Konqueror Bugs <konqueror-bugs-null>
Status: REPORTED ---    
Severity: normal CC: dolgener
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: LISTS: ~/.local/share/konqueror/sessions AND Konqueror > File > Sessions

Description dachgo.info 2018-01-19 19:34:47 UTC
The order of sessions in the File > Sessions list and the File > Sessions > Manage... list appears to be the order of session creation time rather then the order of sessions in the directory ~/.local/share/konqueror/sessions.

REMINDER: the DEPRECATED Settings > Load Profile | Manage Profiles displayed profiles in the same order as the directory ~/.kde/share/apps/konqueror/profiles.
Comment 1 dachgo.info 2018-01-19 22:32:32 UTC
Created attachment 110005 [details]
LISTS:   ~/.local/share/konqueror/sessions   AND   Konqueror > File > Sessions

Graphic snapshot of LISTS:
~/.local/share/konqueror/sessions AND File > Sessions
Comment 2 dolgener 2020-09-03 13:31:40 UTC
Since a (at least apparently) random instead of alphabetical (or user-defined) order makes it unnecessary difficult to use (i.e. to find the item of interst in a bigger list), I also looked for any way to arrange the list of sessions in a senseful manner.
To my surprise, the (obviously non-alphanumeric) sort order does not reflect the creation nor modification date. Otherwise, I would have expected newly added entries or items "pseudo-modified" by "touch" to move to one end of the list, shouldn't I?

The only file in each directory whose name corresponds to that of the session is usually (but not always) called "1" (although rarly names like "_1.41" or "_1.184" do occur). So the name of this subordinated file cannot be the deciding factor either. And finally I don't find anything in these files like an ID from which the sequence could be derived.
So there even is no obvious workaround to bring the list into a reasonable form, even with increased effort.
If you are not a developer, you won't be able to figure it out the source code either.

CAN SOMEBODY GIVE A HINT ON HOW TO CHANGE THE SORT ORDER MANUALLY?

The big and great solution of course would be a session editor, which would work similar to the bookmark editor.
Comment 3 dolgener 2020-09-05 12:25:13 UTC
If this irritates you too, you may use the following script as a workaround solution (e.g. bound to a user-defined key combination), which presents sessions in alphabetical order instead of randomly for better picking. Aside from that, it has the pleasant side effect that you don't have to open a normal konqueror window first to start a session and close that afterwards again. (Earlier konqueror versions with profiles were much more ergonomic in this respect.)

#!/bin/bash

# Hint: does not work with session names containing spaces,
# "ls --quoting-style=shell-always" and/or "ls -Q" won't help.
# Workaround for this: use U+2000 (EN QUAD) 
#  instead of U+0020 (SPACE) in session names


ALPHABETICAL_SESSIONSLIST=$(ls ~/.local/share/konqueror/sessions/ | sed -r "s/(.*)/\1 \1/" | tr "\n" " ") 
SELECTED_SESSION=$(kdialog --geometry=400x800+2000+0 --menu "Select konqueror session:" $ALPHABETICAL_SESSIONSLIST)
konqueror --open-session "$SELECTED_SESSION"