SUMMARY If the user tries to import a resource file and the import ends up in a failure state, the resource file is still copied to the resource folder. STEPS TO REPRODUCE 1. Go to Patterns docker, try to import a file called "pattern.png~" (which will fail because of wrong filename). OBSERVED RESULT You can see that the file is there in the resource folder after you click through all messages. EXPECTED RESULT The file shouldn't be there since the import failed. SOFTWARE/OS VERSIONS Krita Version: 5.1.0-prealpha (git aab049f) Languages: en_US, en, en_US, en, en_US, en, pl_PL, pl, pl_PL, pl Hidpi: true Qt Version (compiled): 5.11.1 Version (loaded): 5.11.1
Yes, they should be removed if possible.
Yes, they should removed. Please implement this?
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1284
Git commit c76519a76452f6d7cdd2eba0911861f3ad88dd6e by Agata Cacko. Committed on 08/01/2022 at 21:38. Pushed by tymond into branch 'master'. Don't leave incorrect resource files after loading Before this commit, KisFolderStorage wouldn't check if the resource can be loaded after importing, so it didn't even know that maybe it imported an incorrect file which is later staying in the resource folder unnecessarily. This commit adds checking for whether the resource can be loaded immediately after copying it to the folder, and then removes it if the resource file is incorrect. M +7 -0 libs/resources/KisFolderStorage.cpp https://invent.kde.org/graphics/krita/commit/c76519a76452f6d7cdd2eba0911861f3ad88dd6e
Git commit 0ef02e5e43bc1ac6d03c0110379b9c169672165b by Agata Cacko. Committed on 22/02/2022 at 22:51. Pushed by tymond into branch 'krita/5.0'. Don't leave incorrect resource files after loading Before this commit, KisFolderStorage wouldn't check if the resource can be loaded after importing, so it didn't even know that maybe it imported an incorrect file which is later staying in the resource folder unnecessarily. This commit adds checking for whether the resource can be loaded immediately after copying it to the folder, and then removes it if the resource file is incorrect. (cherry picked from commit c76519a76452f6d7cdd2eba0911861f3ad88dd6e) M +7 -0 libs/resources/KisFolderStorage.cpp https://invent.kde.org/graphics/krita/commit/0ef02e5e43bc1ac6d03c0110379b9c169672165b