https://bugs.kde.org/show_bug.cgi?id=526523

            Bug ID: 526523
           Summary: KFileWidget restores saved sort direction inverted on
                    next open
    Classification: Frameworks and Libraries
           Product: frameworks-kio
      Version First 6.24.0
       Reported In:
          Platform: Kubuntu
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Open/save dialogs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

The KDE file dialog correctly saves the selected sort column and sort direction
to `~/.config/kdeglobals`, but when the dialog is opened again, the sort
direction is restored as the opposite of what was selected.  This reproduces
directly with `kdialog`, 

Environment:
Kubuntu 26.04 LTS  
KDE Plasma Version: 6.6.6  
KDE Frameworks Version: 6.24.0  
Qt Version: 6.10.2  
Kernel Version: 7.0.0-34-generic (64-bit)  
Graphics Platform: Wayland  
KIO file widgets package: `libkf6kiofilewidgets6 6.24.0-0ubuntu1`  
xdg-desktop-portal-kde: `6.6.6-0ubuntu0.1`

Steps to reproduce:

1. Run:
   `kdialog --getopenfilename "$HOME"`
2. Switch to Details view if necessary.
3. Sort by Date.
4. Set the order to newest first.
5. Close the dialog.
6. Open the same dialog again:
   `kdialog --getopenfilename "$HOME"`

Actual result:

The dialog opens sorted by Date, but with the opposite direction: oldest first.

The inverse also happens:
- If I select oldest first and close the dialog,
- the next time it opens it is newest first.

Expected result:

The file dialog should reopen using the same sort direction that was selected
when it was last closed.

Additional information:

The preference is being written to `~/.config/kdeglobals`.

Relevant section:

```
[KFileDialog Settings]
Sort by=Date
Sort reversed=true
View Style=Detail
```

Despite `Sort reversed=true` being persisted, reopening the dialog shows the
opposite sort direction.

The same behavior is visible from browser file-upload dialogs using the KDE XDG
Desktop Portal file chooser, but because it also reproduces directly with
`kdialog`, the problem appears to be in KIO/KFileWidget state restoration
rather than the browser or portal itself.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to