https://bugs.kde.org/show_bug.cgi?id=421575
Bug ID: 421575 Summary: Paths in kis_paintoppresets.blacklist containing backward slashes are ignored Product: krita Version: 4.3.0-beta1 Platform: MS Windows OS: MS Windows Status: REPORTED Severity: normal Priority: NOR Component: Tagging Assignee: krita-bugs-n...@kde.org Reporter: odraenco...@gmail.com Target Milestone: --- SUMMARY Paths in kis_paintoppresets.blacklist use / (forward slash) as directory separator, except that SOMETIMES the last directory separator becomes a \ (backward slash) instead. When this happens, Krita fails at blacklisting the path and overwritten brush presets, backups, etc. show up in the brush list. I'm not familiar with the code, but it's possible that somewhere Krita checks if a preset filepath matches the blacklist entries EXACTLY (e.g. filepath_a == filepath_b) and that fails, or some function to resolve paths into their canonical versions fails at resolving backward slashes on Windows, or something like that. Anyway, the simplest fix is to stop using backward slashes in blacklisted paths, or to replace "paintoppresets\" with "paintoppresets/" before comparing paths. STEPS TO REPRODUCE 1. Select the brush b)_Basic-2_Opacity. 2. On the brush settings editor, click "Save new brush preset..." and save as "Test". 3. Select the brush Test. 4. On the brush settings editor, change a setting. E.g. click on the "size" checkbox to change size with pressure. 5. Click "overwrite brush". OBSERVED RESULT <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE m_blackListFile> <resourceFilesList> <file> <name>~/AppData/Roaming/krita/paintoppresets\Test_backup_2020-05-15-140459.kpp</name> </file> </resourceFilesList> The "Test" preset shows twice on Krita because the backup isn't blacklisted. EXPECTED RESULT <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE m_blackListFile> <resourceFilesList> <file> <name>~/AppData/Roaming/krita/paintoppresets/Test_backup_2020-05-15-140459.kpp</name> </file> </resourceFilesList> The "Test" preset shows once on Krita as the backup is properly blacklisted. SOFTWARE/OS VERSIONS Windows 7 (64bit) Krita 4.3.0-beta1 (git 5149f63) ADDITIONAL INFORMATION Manually editing kis_paintoppresets.blacklist with Notepad++ and replacing \ with / fixes the issue. It seems that SOMETIMES blacklisted paths are added correctly, with /, while other times they were added incorrectly, with \. This suggests that the bug only happens under certain circumstances, and that the code to add entries to the blacklist has two different ways to generate paths, one with /, another with \, which alternate sometimes for some reason. -- You are receiving this mail because: You are watching all bug changes.