]> granicus.if.org Git - transmission/commitdiff
Uncaught exception when dragging multiple items between groups (macOS)
authorMike Gelfand <mikedld@mikedld.com>
Tue, 4 Jul 2017 19:59:55 +0000 (22:59 +0300)
committerMike Gelfand <mikedld@mikedld.com>
Tue, 4 Jul 2017 19:59:55 +0000 (22:59 +0300)
Change group after all the torrents are retrieved from drop data to avoid
premature view item index changes.

Fixes: #51
macosx/Controller.m

index 9075bd75de5b0a4263522193f16d9f601bf2cedf..7f924747f5d75c4fdf1fc0e0ebe49239d886ab9d 100644 (file)
@@ -3125,10 +3125,15 @@ static void removeKeRangerRansomware()
         {
             Torrent * torrent = [fTableView itemAtRow: i];
             [movingTorrents addObject: torrent];
+        }
 
-            //change groups
-            if (item)
-                [torrent setGroupValue: [item groupIndex] determinationType: TorrentDeterminationUserSpecified];
+        //change groups
+        if (item)
+        {
+            const NSInteger groupIndex = [item groupIndex];
+
+            for (Torrent * torrent in movingTorrents)
+                [torrent setGroupValue: groupIndex determinationType: TorrentDeterminationUserSpecified];
         }
 
         //reorder queue order