From 269bbdf01d76db6d6be441f1403a0d42dbce1a02 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 6 Dec 2009 15:03:49 +0000 Subject: [PATCH] - Fix file prioritizing behavior. Priorities cannot be changed if the torrent has not metadata, is not valid or is a seed. * Use the same behavior in Web UI and Regular UI --- src/httpconnection.cpp | 2 +- src/proplistdelegate.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/httpconnection.cpp b/src/httpconnection.cpp index b8e961ff1..3eea651e6 100644 --- a/src/httpconnection.cpp +++ b/src/httpconnection.cpp @@ -361,7 +361,7 @@ void HttpConnection::respondCommand(QString command) int file_id = parser.post("id").toInt(); int priority = parser.post("priority").toInt(); QTorrentHandle h = BTSession->getTorrentHandle(hash); - if(h.is_valid()) { + if(h.is_valid() && h.has_metadata() && !h.get_torrent_handle().is_seed()) { h.file_priority(file_id, priority); } } diff --git a/src/proplistdelegate.h b/src/proplistdelegate.h index d889f4ea2..02f057047 100644 --- a/src/proplistdelegate.h +++ b/src/proplistdelegate.h @@ -122,7 +122,7 @@ public: if(index.column() != PRIORITY) return 0; if(properties) { QTorrentHandle h = properties->getCurrentTorrent(); - if(!h.is_valid() || h.is_seed() || !h.has_metadata()) return 0; + if(!h.is_valid() || h.get_torrent_handle().is_seed() || !h.has_metadata()) return 0; } QComboBox* editor = new QComboBox(parent); editor->setFocusPolicy(Qt::StrongFocus);