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

            Bug ID: 521281
           Summary: KDE systemsettings Locations doesn't respect comments
                    and empty lines in ~/.config/user-dirs.dirs
    Classification: I don't know
           Product: kde
      Version First unspecified
       Reported In:
          Platform: Debian stable
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

DESCRIPTION
When changing the XDG directory paths via the "Locations" module in KDE System
Settings, the ~/.config/user-dirs.dirs file is completely overwritten. During
this process, all manually added comments and empty lines are permanently lost.

STEPS TO REPRODUCE
1. Open ~/.config/user-dirs.dirs in a text editor.
2. Add a comment line starting with # (for example, to document previous
default folder locations).
3. Add some empty lines to separate entries for better readability.
4. Save the file.
5. run "xdg-user-dirs-update" in the terminal.
6. Open KDE System Settings -> Applications -> Locations.
7. Change any path and click "Apply".
8. Re-open ~/.config/user-dirs.dirs in the text editor.
9. Now all comments and empty lines are gone.

OBSERVED RESULT
When you change the entries in the System Settings under Locations, the
~/.config/user-dirs.dirs file is completely rewritten. During this process,
comments and empty lines in this file are lost. For example, I manually edited
this file and commented out the old entries with their original positions as
comments, and also used empty lines to separate the respective entries from
each other. After editing via the System Settings, these comments and the empty
lines used for structuring are all gone. 

EXPECTED RESULT
The parser should be smart enough to recognize comments by the starting #
character and empty lines by the line ending at the very beginning of the line,
and therefore ignore them or take them into account when writing the
configuration.

SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux 13
KDE Plasma Version: 6.3.6
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.2
Kernel Version: 6.12.90+deb13.1-amd64 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
none

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

Reply via email to