SUMMARY According to Halla, if a resource is cloned via KoResource::clone() then dynamicCast<destination>(), and this copy is modified then stored via addResource, a new resource should be created and the modifications should only impact on this new entity. However, since the filename is not changed on clone, the modifications will impact on both the original and cloned resources. During the session where the clone was created, both copies will look the same. After closing and reopening Krita, the copies will be fully isolated from one another; but in all cases, deleting such an affected resource will remove both copies, instead of just the targeted resource. STEPS TO REPRODUCE 1. Change a SeExpr script (which does not force a new filename) and store it as a new copy. 2. Go to the Script chooser and find it. 3. Reopen Krita and look for the script again. 4. Close Krita, delete the modification from .bundle_modified, and open it again. OBSERVED RESULT 2. results in two identical resources upon the next opening of Krita. 3. results in two different resources. 4. results in both copies being removed from the resource system. EXPECTED RESULT 2. and 3. should be the same 4. should affect only the cloned copy. SOFTWARE/OS VERSIONS Windows: 10 20H2 (19042.1237) macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: 5.64.0 Qt Version: 5.12.11 ADDITIONAL INFORMATION Git hash 016cca2132 This bug was tested with the upcoming MR for SeExpr scripts, but should be equally reproducible with e.g. brush presets, as the versioning is handled by the resource system. It should be noted that, if the modified script doesn't come from a bundle, then it *will* be mapped to the exact same file on disk. This is not the case with bundled scripts; however, due to the behaviour described above, deleting the modified resource will take down both the original and the copy.
Git commit 715f492b6bc73112d014b58867f7f79ceb3a2f01 by Agata Cacko. Committed on 03/10/2021 at 16:23. Pushed by tymond into branch 'master'. Use the same logic for palettes, sessions and workspaces Before this commit, handling palettes, sessions and workspaces was handled in their own respective widgets. This commit removes old logic and replaces it with the call to the KisResourceOverwriteDialog which contains universal logic for renameResource, addResource and importResourceFile. M +7 -27 libs/ui/KisMainWindow.cpp M +11 -7 libs/ui/KisPaletteEditor.cpp M +15 -37 libs/ui/dialogs/KisSessionManagerDialog.cpp https://invent.kde.org/graphics/krita/commit/715f492b6bc73112d014b58867f7f79ceb3a2f01
Git commit 7093da66be396719aaa9bffe92ce13fef2edaa7d by Agata Cacko. Committed on 03/10/2021 at 16:27. Pushed by tymond into branch 'krita/5.0'. Use the same logic for palettes, sessions and workspaces Before this commit, handling palettes, sessions and workspaces was handled in their own respective widgets. This commit removes old logic and replaces it with the call to the KisResourceOverwriteDialog which contains universal logic for renameResource, addResource and importResourceFile. M +7 -27 libs/ui/KisMainWindow.cpp M +11 -7 libs/ui/KisPaletteEditor.cpp M +15 -37 libs/ui/dialogs/KisSessionManagerDialog.cpp https://invent.kde.org/graphics/krita/commit/7093da66be396719aaa9bffe92ce13fef2edaa7d
Git commit 98097fc6cdbcd103bc8ac08f2425660ca6edccd0 by L. E. Segovia. Committed on 19/10/2021 at 16:11. Pushed by lsegovia into branch 'master'. SeExpr: update resource creation and overwriting The SeExpr preset management hadn't been updated to the new resource system. It removes the need for cloning resources, and using Tiar's helpers lets the resource system handle renames and updates. Fixes https://krita-artists.org/t/help-krita-improve-with-structured-beta-testing-of-the-new-resource-system-in-krita-5-0/28779/28 This commit completes 126565fcee90ee516d6008fa797d6ecc279a5503. Co-authored-by: Agata Cacko <tamtamy.tymona@gmail.com> M +2 -15 libs/flake/resources/KisSeExprScript.cpp M +0 -3 libs/flake/resources/KisSeExprScript.h M +50 -28 plugins/generators/seexpr/kis_wdg_seexpr.cpp M +49 -54 plugins/generators/seexpr/kis_wdg_seexpr_presets_save.cpp https://invent.kde.org/graphics/krita/commit/98097fc6cdbcd103bc8ac08f2425660ca6edccd0
Git commit db437e2236b05c8dc48b66dae603c79be7ee93a5 by L. E. Segovia. Committed on 19/10/2021 at 16:19. Pushed by lsegovia into branch 'krita/5.0'. SeExpr: update resource creation and overwriting The SeExpr preset management hadn't been updated to the new resource system. It removes the need for cloning resources, and using Tiar's helpers lets the resource system handle renames and updates. Fixes https://krita-artists.org/t/help-krita-improve-with-structured-beta-testing-of-the-new-resource-system-in-krita-5-0/28779/28 This commit completes 126565fcee90ee516d6008fa797d6ecc279a5503. Co-authored-by: Agata Cacko <tamtamy.tymona@gmail.com> (cherry picked from commit 98097fc6cdbcd103bc8ac08f2425660ca6edccd0) M +2 -15 libs/flake/resources/KisSeExprScript.cpp M +0 -3 libs/flake/resources/KisSeExprScript.h M +50 -28 plugins/generators/seexpr/kis_wdg_seexpr.cpp M +49 -54 plugins/generators/seexpr/kis_wdg_seexpr_presets_save.cpp https://invent.kde.org/graphics/krita/commit/db437e2236b05c8dc48b66dae603c79be7ee93a5