[plasma/discover/Plasma/6.7] discover/qml: Submit usefulness for the right review regardless of how the list is sorted

Nate Graham <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit b5b6d30ab8062953a81a50c7f53a747e3a8e71f9 by Nate Graham.
Committed on 31/07/2026 at 13:39.
Pushed by ngraham into branch 'Plasma/6.7'.

Submit usefulness for the right review regardless of how the list is sorted

This fixes a bug where `ReviewsModel.markUseful()` was expecting a row in the
source model, but `index` was a row in the `sortModel`, causing votes to be
submitted for the wrong review.


(cherry picked from commit d0ffa18aa2cff1c2c023b01cfc2f018bde7232f1)

88bb8152 Fix a bug where review usefulness vote was submitted for the wrong review

Co-authored-by: Taras Oleksyn <[email protected]>

M  +4    -1    discover/qml/ReviewsPage.qml

https://invent.kde.org/plasma/discover/-/commit/b5b6d30ab8062953a81a50c7f53a747e3a8e71f9

diff --git a/discover/qml/ReviewsPage.qml b/discover/qml/ReviewsPage.qml
index 28b6a909e..558d09338 100644
--- a/discover/qml/ReviewsPage.qml
+++ b/discover/qml/ReviewsPage.qml
@@ -210,8 +210,11 @@ Kirigami.OverlaySheet {
             width: ListView.view.width
             separator: index !== ListView.view.count - 1
             onMarkUseful: useful => {
-                page.model.markUseful(index, useful);
+                const modelIndex = sortModel.index(index, 0);
+                const sourceIndex = sortModel.mapToSource(modelIndex);
+                page.model.markUseful(sourceIndex.row, useful);
             }
+
         }
     }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.