49f2037a.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 49f2037ac22fcb430fadd5d7b29bd8af234573a4 Mon Sep 17 00:00:00 2001
  2. From: Akseli Lahtinen <akselmo@akselmo.dev>
  3. Date: Thu, 7 Mar 2024 16:01:44 +0000
  4. Subject: [PATCH] Fix link list dialog for installation button
  5. In gridview, installation buttons showed "Install..." for every item,
  6. even if the item had only single download link. This fixes it
  7. by showing correct button.
  8. The problem was using `entry` directly instead of `model`.
  9. BUG: 482349
  10. FIXED-IN: 6.1
  11. ---
  12. .../qml/private/entrygriddelegates/TileDelegate.qml | 8 ++++----
  13. 1 file changed, 4 insertions(+), 4 deletions(-)
  14. diff --git a/src/qtquick/qml/private/entrygriddelegates/TileDelegate.qml b/src/qtquick/qml/private/entrygriddelegates/TileDelegate.qml
  15. index 2fdee68b4..36224abe2 100644
  16. --- a/src/qtquick/qml/private/entrygriddelegates/TileDelegate.qml
  17. +++ b/src/qtquick/qml/private/entrygriddelegates/TileDelegate.qml
  18. @@ -40,13 +40,13 @@ Private.GridTileDelegate {
  19. visible: enabled
  20. },
  21. Kirigami.Action {
  22. - text: entry.downloadLinks.length === 1 ? i18ndc("knewstuff6", "Request installation of this item, available when there is exactly one downloadable item", "Install") : i18ndc("knewstuff6", "Show installation options, where there is more than one downloadable item", "Install…");
  23. + text: model.downloadLinks.length === 1 ? i18ndc("knewstuff6", "Request installation of this item, available when there is exactly one downloadable item", "Install") : i18ndc("knewstuff6", "Show installation options, where there is more than one downloadable item", "Install…");
  24. icon.name: "install"
  25. onTriggered: {
  26. - if (entry.downloadLinks.length === 1) {
  27. - newStuffEngine.install(entry.entry, NewStuff.ItemsModel.FirstLinkId);
  28. + if (model.downloadLinks.length === 1) {
  29. + newStuffEngine.install(entry, NewStuff.ItemsModel.FirstLinkId);
  30. } else {
  31. - downloadItemsSheet.downloadLinks = entry.downloadLinks;
  32. + downloadItemsSheet.downloadLinks = model.downloadLinks;
  33. downloadItemsSheet.entry = entry;
  34. downloadItemsSheet.open();
  35. }
  36. --
  37. GitLab