The "dir" and "path" variables are obviously swapped here by mistake.
This results in the relativePath always being empty, and makes the function return "~/.local/share/" (or "~/.config/") instead of the correct path.
BUG: 345100
mdawson |
Frameworks |
The "dir" and "path" variables are obviously swapped here by mistake.
This results in the relativePath always being empty, and makes the function return "~/.local/share/" (or "~/.config/") instead of the correct path.
BUG: 345100
Open kmenuedit, edit an existing sub menu and change the icon, the change is correctly applied now, it is written to ~/.local/share/desktop-directories/xxx.directory instead of ~/.local/share/xxx.directory.
Also create a new sub menu and choose a different icon immediately. The correct icon does show up in the application menu now.
The added tests pass too, they fail with the original code.
Lint Skipped |
Unit Tests Skipped |
+1 This definitely looks like the correct fix.
Can you please add some unit tests for this, to ensure it doesn't break in the future? I think just three extra tests, one for a desktop file in a config directory, one in a data directory, and one present elsewhere would be enough.
No problem, feel free to ask for help! The tests can go in autotests/kdesktopfile.cpp, which already has several tests for KDesktopFile. Take a look at the existing tests in that file for an example.
Excellent! Could you add 4 more rows to the tests, to ensure a path without a folder (ex. systemConfigLocation + "/test.desktop") works correctly? Once that's done, it's a ship it from me.