SUMMARY When renaming a brush preset in the brush preset editor, the brush preset will be renamed and will appear in the `Settings > Manage Resources` window as a single renamed version of the previous brush. However, opening the preset chooser (docker or drop-down) will show two copies of the same brush. Both are selectable and restarting krita does not solve the issue. STEPS TO REPRODUCE 1. Click on `a) Eraser Circle` in the preset chooser 2. Open the preset editor, click the `Rename this preset` button at the top and change the name to `a) Eraser Dot` and apply changes. 3. Open `Settings > Resource Manager` and type Eraser in the filter. You will notice that there is only one copy of the original preset which is appropriately renamed to `a) Eraser Dot` 4. Open the brush chooser and navigate to the eraser presets. OBSERVED RESULT There will be two presets visible in the preset chooser, one name `a) Eraser Dot` and another name `a) Eraser Circle`. EXPECTED RESULT There should only be one preset named `a) Eraser Dot` in the preset chooser. ADDITIONAL INFORMATION Within the resource manager, it clearly shows that `a) Eraser Dot` is a versioned file based on the previous preset. (`a)_Eraser_Circle.0001.kpp`) so it must be that the preset chooser isn't properly filtering out versioned brush presets.
Created attachment 144289 [details] Database illustrating the problem... So, upon further debugging, I managed to determine that there are two copies of the preset located in two different storage bundles. When one of the presets is renamed, the other one is exposed in the preset chooser as it's own entry. I'm not sure what we do about this.
Upon rename, all versions of the previous preset should be deactivated. So, if I have eraser_a, two versions in two different bundles. eraser_a 1 and 2, then I as a user only know about 'eraser_a', so upon rename to 'eraser_b', all resources 'eraser_a' should be deactivated. At the least, that's how I'd go about it.
Okay, I can reproduce this problem. It is caused by the new deduplication strategy. The new resource has different signature, so you start seeing the same resource **from a different bundle** :) I need to think about how to fix this problem :)
Okay, I have found the reason for this bug. The problem is that we have duplicated instance of `a) Eraser Circle` in two storages, in "folder storage" and in "Krita 4 Default Resources.bundle". When you rename the resource, you rename the resource in the folder storage and it gets a new version, which works perfectly correct. But you start seeing the resource from the default bundle, which is now not deduplicated (which is kind of correct behavior). To confirm this explanation, one can test with `d) Ink-4 Pen Rough`, which works as expected, because it does not have a duplicate in teh folder storage. I guess we have two complementary solutions for this: 1) Remove the duplicated resources from the folder storage. Though I'm not sure why we added them in the first place, perhaps we were considering them as fallbacks for people who don't want to use the default bundle? 2) Modify the tooltip of the presets and show the storage, where the resource is stored. That way the user will at least understand where this resource came from.
Yes, there are two presets in the folder storage, this one and 'b)_Basic-5_Size_default.kpp' to make sure that we always have at least one eraser and one brush available, so that's intentional. We can remove them from the bundle, but I also am fine with 2).
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1231
Git commit 57b37cc1809fe8209d20d77f3468f16e945a05cd by Dmitry Kazakov. Committed on 14/12/2021 at 13:04. Pushed by dkazakov into branch 'master'. Show resource location in the tooltip It lets the user to understand where this resource comes from and disable it in some complicated duplication corner cases. M +15 -6 libs/resourcewidgets/KisIconToolTip.cpp https://invent.kde.org/graphics/krita/commit/57b37cc1809fe8209d20d77f3468f16e945a05cd
Git commit c7a568bed09d00ca8625df88a8598e571fc4d8ce by Dmitry Kazakov. Committed on 14/12/2021 at 13:05. Pushed by dkazakov into branch 'krita/5.0'. Hack-out the changed strings for Krita 5.0 We cannot have new strings in Krita 5.0, so we need to use existing ones instead. M +6 -2 libs/resourcewidgets/KisIconToolTip.cpp https://invent.kde.org/graphics/krita/commit/c7a568bed09d00ca8625df88a8598e571fc4d8ce
Git commit 99221d62c8560d3ac22e3eef983fee97c74e5356 by Dmitry Kazakov. Committed on 14/12/2021 at 13:05. Pushed by dkazakov into branch 'krita/5.0'. Show resource location in the tooltip It lets the user to understand where this resource comes from and disable it in some complicated duplication corner cases. (cherry picked from commit 57b37cc1809fe8209d20d77f3468f16e945a05cd) M +15 -6 libs/resourcewidgets/KisIconToolTip.cpp https://invent.kde.org/graphics/krita/commit/99221d62c8560d3ac22e3eef983fee97c74e5356