Bug 446802 - Deleting resource from resource manager doesn't always work
Summary: Deleting resource from resource manager doesn't always work
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (show other bugs)
Version: 5.0.0-beta5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Eoin O'Neill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-10 20:19 UTC by sh_zam
Modified: 2021-12-15 12:57 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sh_zam 2021-12-10 20:19:15 UTC
STEPS TO REPRODUCE
1. Open Resource Manager
2. Select a tag other than "All" in tag filter combo-box. 
3. Delete a random resource from the options

OBSERVED RESULT
Resource isn't deleted and the command line logs:
```
QSqlQuery::value: not positioned on a valid record
```

EXPECTED RESULT
Resource should be deleted and the view should be appropriately (related: 446801).

ADDITIONAL INFORMATION
Krita Version: ./krita-5.0.0-beta5-e18c9f0-x86_64.appimage
Comment 1 Eoin O'Neill 2021-12-15 00:00:38 UTC
Git commit f08c134f133785529c6edab5d283cbadaf9b7116 by Eoin O'Neill.
Committed on 14/12/2021 at 23:59.
Pushed by eoinoneill into branch 'krita/5.0'.

Fix resource deletion failure when browsing tag in resource manager.

M  +2    -2    plugins/extensions/resourcemanager/DlgResourceManager.cpp

https://invent.kde.org/graphics/krita/commit/f08c134f133785529c6edab5d283cbadaf9b7116
Comment 2 Dmitry Kazakov 2021-12-15 12:36:26 UTC
Git commit 818e51416fc10aa186800101d5c2c64c4c86a401 by Dmitry Kazakov, on behalf of Eoin O'Neill.
Committed on 15/12/2021 at 12:35.
Pushed by dkazakov into branch 'master'.

Fix resource deletion failure when browsing tag in resource manager.

M  +2    -2    plugins/extensions/resourcemanager/DlgResourceManager.cpp

https://invent.kde.org/graphics/krita/commit/818e51416fc10aa186800101d5c2c64c4c86a401
Comment 3 Dmitry Kazakov 2021-12-15 12:36:42 UTC
Git commit 533fb9bd754a2c68381fc5aeff14041c7dd7ebf1 by Dmitry Kazakov.
Committed on 15/12/2021 at 12:35.
Pushed by dkazakov into branch 'master'.

Fix updates of KisTagResourceModel when the resource is set inactive

When we change the active state of the resource, we do that via
KisResourceModel. Therefore KisTagResourceModel was not explicitly
notified about this change. Now we connect both models to
KisResourceLocator so that they get proper notifications when the
resource's state changes.

M  +5    -1    libs/resources/KisResourceLocator.cpp
M  +6    -3    libs/resources/KisResourceLocator.h
M  +17   -6    libs/resources/KisResourceModel.cpp
M  +6    -0    libs/resources/KisResourceModel.h
M  +26   -0    libs/resources/KisTagResourceModel.cpp
M  +2    -0    libs/resources/KisTagResourceModel.h

https://invent.kde.org/graphics/krita/commit/533fb9bd754a2c68381fc5aeff14041c7dd7ebf1
Comment 4 Dmitry Kazakov 2021-12-15 12:57:29 UTC
Git commit d20b9f0581ab8795dee718b6b389a9dbe756238b by Dmitry Kazakov.
Committed on 15/12/2021 at 12:41.
Pushed by dkazakov into branch 'krita/5.0'.

Fix updates of KisTagResourceModel when the resource is set inactive

When we change the active state of the resource, we do that via
KisResourceModel. Therefore KisTagResourceModel was not explicitly
notified about this change. Now we connect both models to
KisResourceLocator so that they get proper notifications when the
resource's state changes.

M  +5    -1    libs/resources/KisResourceLocator.cpp
M  +6    -3    libs/resources/KisResourceLocator.h
M  +17   -6    libs/resources/KisResourceModel.cpp
M  +6    -0    libs/resources/KisResourceModel.h
M  +26   -0    libs/resources/KisTagResourceModel.cpp
M  +2    -0    libs/resources/KisTagResourceModel.h

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