[network/ktorrent] plugins/shutdown: Fix columns in ShutdownTorrentModel

Jack Hill <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit c0e3fc623c39604d24d33fee08b784ac332e66b3 by Jack Hill.
Committed on 06/08/2026 at 19:21.
Pushed by jackh into branch 'master'.

Fix columns in ShutdownTorrentModel

I somehow got some of these the wrong way round.

Amends c216e54aee4f344a1dd138d21614222a294cd89a

M  +5    -5    plugins/shutdown/shutdowntorrentmodel.cpp

https://invent.kde.org/network/ktorrent/-/commit/c0e3fc623c39604d24d33fee08b784ac332e66b3

diff --git a/plugins/shutdown/shutdowntorrentmodel.cpp b/plugins/shutdown/shutdowntorrentmodel.cpp
index d0d6cb2cf..6c17c3c3f 100644
--- a/plugins/shutdown/shutdowntorrentmodel.cpp
+++ b/plugins/shutdown/shutdowntorrentmodel.cpp
@@ -62,7 +62,7 @@ QVariant ShutdownTorrentModel::data(const QModelIndex &index, int role) const
 
     const Column column{index.column()};
     if (role == Qt::CheckStateRole) {
-        if (column != Column::EVENT) {
+        if (column != Column::TORRENT) {
             return QVariant();
         }
 
@@ -70,9 +70,9 @@ QVariant ShutdownTorrentModel::data(const QModelIndex &index, int role) const
     } else if (role == Qt::DisplayRole) {
         const TriggerItem &cond = conds.at(index.row());
         switch (column) {
-        case Column::EVENT:
-            return cond.tc->getDisplayName();
         case Column::TORRENT:
+            return cond.tc->getDisplayName();
+        case Column::EVENT:
             if (cond.trigger == DOWNLOADING_COMPLETED) {
                 return i18n("Downloading finishes");
             } else {
@@ -170,11 +170,11 @@ Qt::ItemFlags ShutdownTorrentModel::flags(const QModelIndex &index) const
 
     const Column column{index.column()};
     Qt::ItemFlags flags = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
-    if (column == Column::EVENT) {
+    if (column == Column::TORRENT) {
         flags |= Qt::ItemIsUserCheckable;
     }
 
-    if (column == Column::TORRENT) {
+    if (column == Column::EVENT) {
         flags |= Qt::ItemIsEditable;
     }
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.