| Summary: | beginRemoveRows called with invalid index in KisAllResourcesModel::beginExternalResourceRemov | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | Alvin Wong <alvin> |
| Component: | Resource Management | Assignee: | Tiar <tamtamy.tymona> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | halla, tamtamy.tymona |
| Priority: | NOR | ||
| Version First Reported In: | git master (please specify the git hash!) | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/graphics/krita/commit/84fa30520fabaf2a5a4435f3cecedbb2ecfd15c5 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Alvin Wong
2022-05-03 14:03:13 UTC
I fixed it here: https://invent.kde.org/tymond/krita/-/commits/tiar/fix_invalid_indexes_on_externalRemove_in_KisResourceModel but I don't see any improvements in how many tests pass on CI... https://invent.kde.org/tymond/krita/-/pipelines/178840/test_report Note that "I fixed it" involves "I ignore the invalid indexes" since that's the correct approach since the indexes can be invalid if the resources are deduplicated, which is what happens in that test. Well, it did seem to fix `plugins_impex_psd_kis_psd_test`. The count itself isn't a solid indicator because currently some tests do fail randomly. Ah ok! Then I will just push it to master :) A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1492 Git commit 1efcf547f30daf37e84fc017ce571493ccba2b39 by Agata Cacko. Committed on 27/06/2022 at 19:29. Pushed by nalvarez into branch 'master'. Fix invalid indexes on external Remove in ResourceModel Before this commit, if the index was invalid, KisResourceModel would still try to use it to remove resources from the model. Considering that the index can be invalid in a correct state of Krita, when the resource has been deduplicated in SQL query so it doesn't appear in the model, this commit just ignores invalid indexes. Before this commit there was also always just one endRemoveRows() called despite that beginRemoveRows() could be called multiple times. Qt needs the endRemoveRows() to be called the same amount of times as beginRemoveRows(), so this commit makes sure that the amounts of calls for both functions match. M +17 -3 libs/resources/KisResourceModel.cpp https://invent.kde.org/graphics/krita/commit/1efcf547f30daf37e84fc017ce571493ccba2b39 Git commit 84fa30520fabaf2a5a4435f3cecedbb2ecfd15c5 by Agata Cacko. Committed on 28/06/2022 at 11:35. Pushed by tymond into branch 'krita/5.1'. Fix invalid indexes on external Remove in ResourceModel Before this commit, if the index was invalid, KisResourceModel would still try to use it to remove resources from the model. Considering that the index can be invalid in a correct state of Krita, when the resource has been deduplicated in SQL query so it doesn't appear in the model, this commit just ignores invalid indexes. Before this commit there was also always just one endRemoveRows() called despite that beginRemoveRows() could be called multiple times. Qt needs the endRemoveRows() to be called the same amount of times as beginRemoveRows(), so this commit makes sure that the amounts of calls for both functions match. (cherry picked from commit 1efcf547f30daf37e84fc017ce571493ccba2b39) M +17 -3 libs/resources/KisResourceModel.cpp https://invent.kde.org/graphics/krita/commit/84fa30520fabaf2a5a4435f3cecedbb2ecfd15c5 |