Bugfix: Fix issue with paths that have similar content getting skipped
The bug:
Say, the user selected resource location was path = ~/.local/share/krita3
and
the AppDataLocation
returns writableLocation = ~/.local/share/krita
.
When we do path.startsWith(writableLocation)
-- this returns true, when
it shouldn't because krita3
isn't built up on ~/.local/share/krita.
The solution:
Add a trailing separator to AppDataLocation
, this will ensure that we
are comparing the right thing.
Test Plan
Change the reosurce location to something which is similar to AppDataLocation, trying changing the resources in that location (I tested changing Canvas Input Profile), restart Krita and check if the right config/resource is loaded.
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. -
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) -
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.