Uncaught exception when dragging multiple items between groups (macOS)

Change group after all the torrents are retrieved from drop data to avoid
premature view item index changes.

Fixes: #51
This commit is contained in:
Mike Gelfand 2017-07-04 22:59:55 +03:00
parent 709ca6a4b2
commit 0994e96f31
1 changed files with 8 additions and 3 deletions

View File

@ -3163,10 +3163,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