Fix torrent renaming. Closes #3398

This commit is contained in:
ngosang 2015-07-12 09:38:25 +02:00
commit 7c164dfcb9

View file

@ -684,7 +684,7 @@ void TransferListWidget::renameSelectedTorrent()
const QModelIndexList selectedIndexes = selectionModel()->selectedRows(); const QModelIndexList selectedIndexes = selectionModel()->selectedRows();
if (selectedIndexes.size() != 1) return; if (selectedIndexes.size() != 1) return;
if (!selectedIndexes.first().isValid()) return; if (!selectedIndexes.first().isValid()) return;
QModelIndex mi = mapToSource(selectedIndexes.first()); QModelIndex mi = listModel->index(mapToSource(selectedIndexes.first()).row(), TorrentModelItem::TR_NAME);
const QString hash = getHashFromRow(mi.row()); const QString hash = getHashFromRow(mi.row());
const QTorrentHandle h = BTSession->getTorrentHandle(hash); const QTorrentHandle h = BTSession->getTorrentHandle(hash);
if (!h.is_valid()) return; if (!h.is_valid()) return;