Bug 495872

Summary: Tabs get saved in wrong order, and loaded in even wronger order.
Product: [Applications] kate Reporter: navid.zamani+kde
Component: sessionsAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: waqar.17a
Priority: NOR    
Version: 24.08.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description navid.zamani+kde 2024-11-06 12:07:51 UTC
SUMMARY
I just moved from Kate 23.08.5 (latest in Mint) to 24.08.2 (latest in Gentoo),
and when I save a session, the .katesession file records the wrong tab order, and when I load it again, it loads the tabs in an even wronger order again.
Neither of that was the case with 23.08.5.

STEPS TO REPRODUCE
1. Open Kate, and open six files (say A,B,C,D,E,F) in the window. Activate file D.
2. Save this as a (non-anonymous) session, and close Kate.
3. Open Kate again, and load the same session. (I have it configured so it asks me for a session.)

OBSERVED RESULT
• After step 2, the .katesession file contains the [Document …] sections in the right order, but the [MainWindow0-ViewSpace 0] contains:

    Active View=3
    Count=4
    Documents=0,4,1,5,2,3
    View 0=1
    View 1=5
    View 2=2
    View 3=3

• After step 3, the tabs are now in the order A,D,C,F,B,E, which reflects neither the original tab state, nor the `Documents` setting in the session file. (No idea what the `View …` settings are for.)

EXPECTED RESULT
The tabs should be kept in the order in which they were, of course. :)

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux, default/linux/amd64/23.0/desktop/plasma, ~amd64, fully updated on 2024-10-31
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.3

ADDITIONAL INFORMATION
Even editing the .katesession file does not cause it to load the tabs in the right order.
Feel free to ask me for any additionally necessary details you may need, however technical, complex or involved. :)
Comment 1 Waqar Ahmed 2024-11-06 12:13:10 UTC
Its fixed on master, probably the fix isn't available on stable

*** This bug has been marked as a duplicate of bug 495419 ***
Comment 2 navid.zamani+kde 2024-11-06 12:14:55 UTC
Hey, yes, I just got told on IRC that this is a known bug and already fixed on master. :)

Strange… I always search for existing bugs to avoid making duplicates. (I’m a programmer myself.)

Sorry to bother. :)