1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-24 21:44:25 +00:00

- Disabled force recheck for torrents with no metadata

This commit is contained in:
Christophe Dumez 2009-08-17 05:35:20 +00:00
parent d132d50f4d
commit 1bcb8b1ed8

View File

@ -236,6 +236,7 @@ void DownloadingTorrents::forceRecheck() {
if(index.column() == NAME){ if(index.column() == NAME){
QString hash = DLListModel->data(DLListModel->index(index.row(), HASH)).toString(); QString hash = DLListModel->data(DLListModel->index(index.row(), HASH)).toString();
QTorrentHandle h = BTSession->getTorrentHandle(hash); QTorrentHandle h = BTSession->getTorrentHandle(hash);
if(h.is_valid() && h.has_metadata())
h.force_recheck(); h.force_recheck();
} }
} }
@ -246,7 +247,7 @@ void DownloadingTorrents::displayDLListMenu(const QPoint&) {
// Enable/disable pause/start action given the DL state // Enable/disable pause/start action given the DL state
QModelIndexList selectedIndexes = downloadList->selectionModel()->selectedIndexes(); QModelIndexList selectedIndexes = downloadList->selectionModel()->selectedIndexes();
bool has_pause = false, has_start = false, has_preview = false; bool has_pause = false, has_start = false, has_preview = false;
bool show_properties_entry = false; bool one_has_metadata = false;
QTorrentHandle h; QTorrentHandle h;
qDebug("Displaying menu"); qDebug("Displaying menu");
foreach(const QModelIndex &index, selectedIndexes) { foreach(const QModelIndex &index, selectedIndexes) {
@ -257,7 +258,7 @@ void DownloadingTorrents::displayDLListMenu(const QPoint&) {
h = BTSession->getTorrentHandle(hash); h = BTSession->getTorrentHandle(hash);
if(!h.is_valid()) continue; if(!h.is_valid()) continue;
if(h.has_metadata()) { if(h.has_metadata()) {
show_properties_entry = true; one_has_metadata = true;
} }
if(h.is_paused()) { if(h.is_paused()) {
if(!has_start) { if(!has_start) {
@ -284,10 +285,12 @@ void DownloadingTorrents::displayDLListMenu(const QPoint&) {
myDLLlistMenu.addAction(actionSet_download_limit); myDLLlistMenu.addAction(actionSet_download_limit);
myDLLlistMenu.addAction(actionSet_upload_limit); myDLLlistMenu.addAction(actionSet_upload_limit);
myDLLlistMenu.addSeparator(); myDLLlistMenu.addSeparator();
if(one_has_metadata) {
myDLLlistMenu.addAction(actionForce_recheck); myDLLlistMenu.addAction(actionForce_recheck);
myDLLlistMenu.addSeparator(); myDLLlistMenu.addSeparator();
}
myDLLlistMenu.addAction(actionOpen_destination_folder); myDLLlistMenu.addAction(actionOpen_destination_folder);
if(show_properties_entry) if(one_has_metadata)
myDLLlistMenu.addAction(actionTorrent_Properties); myDLLlistMenu.addAction(actionTorrent_Properties);
if(BTSession->isQueueingEnabled()) { if(BTSession->isQueueingEnabled()) {
myDLLlistMenu.addSeparator(); myDLLlistMenu.addSeparator();