Bug 439594 - Deleting multiple gradients does not coincide with selection
Summary: Deleting multiple gradients does not coincide with selection
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (other bugs)
Version First Reported In: nightly build (please specify the git hash!)
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: release_blocker
Depends on:
Blocks:
 
Reported: 2021-07-07 11:47 UTC by Valeriy Fedotov
Modified: 2021-07-27 06:48 UTC (History)
1 user (show)

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


Attachments
Pictures and logs for bug description (100.88 KB, application/zip)
2021-07-07 11:47 UTC, Valeriy Fedotov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Valeriy Fedotov 2021-07-07 11:47:21 UTC
Created attachment 139918 [details]
Pictures and logs for bug description

SUMMARY

When selecting multiple gradients with Control+Click in resouce manager,
not all of selected ones are deleted, and some unselected gradiets are deleted too.

Pictures and logs are attached in archive.

Version: 5.0.0-prealpha (git 25a39d7)
Platform: Appimage, krita-5.0.0-prealpha-25a39d7-x86_64.appimage
OS: Ubuntu 20.04

STEPS TO REPRODUCE
1. Delete ~/.local/share/krita for default krita state.
2. Start Krita, go to "Manage resources" window.
3. Select gradients as resource type.
4. (See attached 01_select.png) Click 1st gradient with LMB, second with Contol+LMB, third wiht Control+LMB.
5. Press "Delete resources" Button.

OBSERVED RESULT

(See attached 02_after_delete.png)

Brush 1 and Brush 3 are deleted. (expected)
Brush 2 is not deleted (not expected)
Brush 5 is deleted (not expected)

EXPECTED RESULT

Only three selected brushes are removed, others are kept intact.

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

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2021-07-08 16:44:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/948
Comment 2 Awakening 2021-07-27 06:48:46 UTC
Git commit cea038a42043feab0b23779c148004cd8cae5a5f by Lucid Sunlight.
Committed on 26/07/2021 at 18:45.
Pushed by rempt into branch 'master'.

Delete resource by index from model, instead of selection index

Deleting a resource with "Show deleted resources" disabled
will update the proxy model and next index in selection
now points at wrong item, collect resource ids first,
and then fetch resource index from model by id instead.

M  +12   -3    plugins/extensions/resourcemanager/DlgResourceManager.cpp

https://invent.kde.org/graphics/krita/commit/cea038a42043feab0b23779c148004cd8cae5a5f