Bug 446705 - Importing the same bundle with a different filename doesn't deduplicate resources
Summary: Importing the same bundle with a different filename doesn't deduplicate resou...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (show other bugs)
Version: 5.0.0-beta5
Platform: Compiled Sources Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on: 445367
Blocks:
  Show dependency treegraph
 
Reported: 2021-12-08 23:56 UTC by amyspark
Modified: 2021-12-13 13:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of the bug (197.46 KB, image/png)
2021-12-08 23:57 UTC, amyspark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description amyspark 2021-12-08 23:56:58 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
Importing the very same .bundle file (only changing its filename) results in two identical copies of all affected resources.

STEPS TO REPRODUCE
1. Import the Quiralta brush set.
2. Rename the .bundle to e.g. "test.bundle".
3. Import the renamed bundle again.

OBSERVED RESULT
Bundle is imported, and results on two copies of its resources being active at the same time.

EXPECTED RESULT
Bundle is correctly detected as a duplicate and is skipped.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 amyspark 2021-12-08 23:57:45 UTC
Created attachment 144370 [details]
Screenshot of the bug
Comment 2 amyspark 2021-12-09 21:59:16 UTC
It's a byproduct of bug 445367. The model considers duplicates too narrowly. (cc Dmitry, I'll need your review on the fix)
Comment 3 Bug Janitor Service 2021-12-09 22:17:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1215
Comment 4 Bug Janitor Service 2021-12-13 13:46:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1225
Comment 5 Dmitry Kazakov 2021-12-13 13:49:06 UTC
Git commit e23a445df24079c5b23a4055341cc6c67e46f73b by Dmitry Kazakov.
Committed on 13/12/2021 at 13:48.
Pushed by dkazakov into branch 'master'.

Fix resource duplication when any tag is selected

It looks like we switch the model when a a tag is selected, so this
model should also perform the group-by-based deduplication.

M  +6    -3    libs/resources/KisTagResourceModel.cpp

https://invent.kde.org/graphics/krita/commit/e23a445df24079c5b23a4055341cc6c67e46f73b
Comment 6 Dmitry Kazakov 2021-12-13 13:49:31 UTC
Git commit 4d7b3c3f7c9cde04196183727c0e2d3c7cc77cca by Dmitry Kazakov.
Committed on 13/12/2021 at 13:49.
Pushed by dkazakov into branch 'krita/5.0'.

Fix resource duplication when any tag is selected

It looks like we switch the model when a a tag is selected, so this
model should also perform the group-by-based deduplication.
(cherry picked from commit e23a445df24079c5b23a4055341cc6c67e46f73b)

M  +6    -3    libs/resources/KisTagResourceModel.cpp

https://invent.kde.org/graphics/krita/commit/4d7b3c3f7c9cde04196183727c0e2d3c7cc77cca