SUMMARY When testing "import a different resource file with the same filename", I wasn't able to import a second resource with the same filename as an existing resource. STEPS TO REPRODUCE 1. Copy an existing workspace from Krita's resources folder to another directory. 2. Try to import in Krita's resource manager OBSERVED RESULT Despite being a valid resource, I was shown a "the following files couldn't be opened as resources" error dialog. EXPECTED RESULT I would expect this to simply overwrite the existing resource, otherwise it should produce a more clear error message. ADDITIONAL INFO krita/5.0 branch, resource testing day.
Did you use the Window -> Workspaces menu or the toolbar button for importing? Or does it happen in both?
Created attachment 143280 [details] Error dialog This happens in Resource Manager, I had the same issue importing same-name brush tips and presets. Despite the preset beign a valid one there is an error message showing. (attached) Importing from "Predefined brush tips" works as expected.
Something must have changed behind the scenes because I can't reproduce this bug anymore. Now i'm getting even more confusing behavior where it prompts to overwrite and then doesn't? I have to look into it more...
I dunno, maybe it is possible to make it work with PSDs too. But then it's a wishlist item.
Uhh ignore my previous comment...
I've observed 2 pretty strange behaviors here: Strange behavior 1: If you copy "Default.kws" to another location, and rename it to "Storyboarding.kws" *without changing the workspace's internal "name" attribute* it will, for some reason, appear in the workspaces list as a second workspace called "Animation" upon import with overwrite prompt. This new workspace, that should be named "default" (based on the internal name) OR "storyboard" (based on the filename), while looking like the default workspace, actually looks like the OLD (pre-5.0) "animation" workspace... After restarting Krita, this seems to resolve itself. Specifically, from the GUI you can only see 1 "animation" workspace (that looks as it should), 2 "default" workspaces (based on the shared internal workspace name XML attribute) that both correctly look like they should. Finally, there is no longer any "storyboarding" workspace. That's also expected. ------------------------------------------------------------------------------------------------------------------- Strange behavior 2: This is similar, but slightly different. If you copy "Default.kws" to another location, and rename it to "Animation.kws", *and then change the workspace's internal "name" XML attribute to "Animation"*, and import, it will prompt and overwrite, as you'd expect. There will still be only 1 workspace named "Animation" in the list. However, the "Animation" workspace, which should look like the default workspace that we copied, will for some reason look like the OLD (pre-5.0) animation workspace instead! After restarting Krita, this also seems to resolve itself! Specifically, there will be only 1 "Animation" workspace in the list, and it will correctly look like the default layout that we copied. ------------------------------------------------------------------------------------------------------------------- These are probably the same or similar bug[s].
Just a quick addendum to the last post: If you copy "Default.kws" to another location, and rename it to "Big Paint.kws", *and then change the workspace's internal "name" XML attribute to "Big_Paint"*, and import, it will prompt and overwrite, as you'd expect. BUT..... There will then be 2 "Animation" workspaces, with one looking like the new Krita 5.0 animation workspace, and the other looking like the old (pre-5.0) animation workspace. This is kind of the missing link between the two behaviors mentioned above.
Git commit e715c2676cfa97e72e9e0bd869359d827524d2f4 by Eoin O'Neill. Committed on 15/11/2021 at 22:43. Pushed by eoinoneill into branch 'master'. Fix workspace import overwrite issues. Resolution to MR1155. Patch file by tiar. Tested and seems to work appropriately. M +2 -1 libs/resources/KisResourceCacheDb.cpp M +1 -0 libs/resources/KisResourceCacheDb.h M +6 -2 libs/resources/KisResourceLocator.cpp M +32 -2 libs/resources/KisResourceModel.cpp https://invent.kde.org/graphics/krita/commit/e715c2676cfa97e72e9e0bd869359d827524d2f4
Git commit 88a68a54190b34617b6c688e0c9eee7135a0cec2 by Eoin O'Neill. Committed on 15/11/2021 at 22:46. Pushed by eoinoneill into branch 'krita/5.0'. Fix workspace import overwrite issues. Resolution to MR1155. Patch file by tiar. Tested and seems to work appropriately. (cherry picked from commit e715c2676cfa97e72e9e0bd869359d827524d2f4) M +2 -1 libs/resources/KisResourceCacheDb.cpp M +1 -0 libs/resources/KisResourceCacheDb.h M +6 -2 libs/resources/KisResourceLocator.cpp M +32 -2 libs/resources/KisResourceModel.cpp https://invent.kde.org/graphics/krita/commit/88a68a54190b34617b6c688e0c9eee7135a0cec2
Git commit 9db2dc681aade8d87fcc2b2a0366a6f4022d5938 by Agata Cacko, on behalf of Eoin O'Neill. Committed on 19/11/2021 at 04:32. Pushed by tymond into branch 'master'. Additional changes made to file importing to acommodate for MR1162. Should now work correctly with empty string syntax. M +0 -1 libs/resources/KisResourceCacheDb.cpp M +7 -11 libs/resources/KisResourceModel.cpp https://invent.kde.org/graphics/krita/commit/9db2dc681aade8d87fcc2b2a0366a6f4022d5938
Git commit b1c5f6d6da5cb3d1896c03066e0172beb6377dca by Agata Cacko. Committed on 19/11/2021 at 04:47. Pushed by tymond into branch 'master'. Change null strings to empty in CacheDb queries Before this commit, CacheDb queries could sometimes fail because the string supplied was null instead of empty (most common in storages, where an empty string indicates the resource folder). Null strings in queries cause issues because comparison with a null is always string. This commit ensures that null strings are converted to empty strings before being used in in WHERE part in an sql query. M +23 -13 libs/resources/KisResourceCacheDb.cpp https://invent.kde.org/graphics/krita/commit/b1c5f6d6da5cb3d1896c03066e0172beb6377dca
Git commit a250a25dfd8307b4cad5f68ef014859a30e13254 by Agata Cacko. Committed on 19/11/2021 at 05:32. Pushed by tymond into branch 'krita/5.0'. Change null strings to empty in CacheDb queries Before this commit, CacheDb queries could sometimes fail because the string supplied was null instead of empty (most common in storages, where an empty string indicates the resource folder). Null strings in queries cause issues because comparison with a null is always string. This commit ensures that null strings are converted to empty strings before being used in in WHERE part in an sql query. M +23 -13 libs/resources/KisResourceCacheDb.cpp https://invent.kde.org/graphics/krita/commit/a250a25dfd8307b4cad5f68ef014859a30e13254
Git commit def99efd67a6884ea17f27e0729e6c8ff5b6c079 by Agata Cacko, on behalf of Eoin O'Neill. Committed on 19/11/2021 at 05:31. Pushed by tymond into branch 'krita/5.0'. Additional changes made to file importing to acommodate for MR1162. Should now work correctly with empty string syntax. M +0 -1 libs/resources/KisResourceCacheDb.cpp M +7 -11 libs/resources/KisResourceModel.cpp https://invent.kde.org/graphics/krita/commit/def99efd67a6884ea17f27e0729e6c8ff5b6c079