|
|
@ -1159,11 +1159,13 @@ void GUI::deleteSelection(){ |
|
|
|
QString fileName = sortedIndex.second.data().toString(); |
|
|
|
QString fileName = sortedIndex.second.data().toString(); |
|
|
|
// Delete item from download list
|
|
|
|
// Delete item from download list
|
|
|
|
DLListModel->removeRow(sortedIndex.first); |
|
|
|
DLListModel->removeRow(sortedIndex.first); |
|
|
|
// Get handle and pause the torrent
|
|
|
|
// Get handle and remove the torrent
|
|
|
|
torrent_handle h = handles.value(fileName); |
|
|
|
QMap<QString, torrent_handle>::iterator it = handles.find(fileName); |
|
|
|
|
|
|
|
if(it != handles.end() && it.key() == fileName) { |
|
|
|
|
|
|
|
torrent_handle h = it.value(); |
|
|
|
s->remove_torrent(h); |
|
|
|
s->remove_torrent(h); |
|
|
|
// Remove torrent from handles
|
|
|
|
// Remove torrent from handles
|
|
|
|
handles.remove(fileName); |
|
|
|
handles.erase(it); |
|
|
|
// remove it from scan dir or it will start again
|
|
|
|
// remove it from scan dir or it will start again
|
|
|
|
if(isScanningDir){ |
|
|
|
if(isScanningDir){ |
|
|
|
QFile::remove(scan_dir+fileName+".torrent"); |
|
|
|
QFile::remove(scan_dir+fileName+".torrent"); |
|
|
@ -1177,6 +1179,9 @@ void GUI::deleteSelection(){ |
|
|
|
setInfoBar("'" + fileName +"' "+tr("removed.", "<file> removed.")); |
|
|
|
setInfoBar("'" + fileName +"' "+tr("removed.", "<file> removed.")); |
|
|
|
--nbTorrents; |
|
|
|
--nbTorrents; |
|
|
|
tabs->setTabText(0, tr("Transfers") +" ("+QString(misc::toString(nbTorrents).c_str())+")"); |
|
|
|
tabs->setTabText(0, tr("Transfers") +" ("+QString(misc::toString(nbTorrents).c_str())+")"); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
std::cout << "Error: Could not find the torrent handle supposed to be removed\n"; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -2090,7 +2095,9 @@ void GUI::on_download_button_clicked(){ |
|
|
|
QModelIndex index; |
|
|
|
QModelIndex index; |
|
|
|
foreach(index, selectedIndexes){ |
|
|
|
foreach(index, selectedIndexes){ |
|
|
|
if(index.column() == NAME){ |
|
|
|
if(index.column() == NAME){ |
|
|
|
downloadFromUrl(index.data().toString()); |
|
|
|
// Get Item url
|
|
|
|
|
|
|
|
QString url = searchResultsUrls.value(index.data().toString()); |
|
|
|
|
|
|
|
downloadFromUrl(url); |
|
|
|
setRowColor(index.row(), "red", false); |
|
|
|
setRowColor(index.row(), "red", false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|