diff --git a/rak/functional.h b/rak/functional.h index 584f9a10..74fea735 100644 --- a/rak/functional.h +++ b/rak/functional.h @@ -460,13 +460,17 @@ template class mem_fun2 : public std::binary_function { public: typedef Ret (Object::*Function)(Arg1, Arg2); + typedef Object object_type; mem_fun2() : m_object(NULL) {} mem_fun2(Object* o, Function f) : m_object(o), m_function(f) {} - bool is_valid() const { return m_object; } + bool is_valid() const { return m_object; } - Ret operator () (Arg1 a1, Arg2 a2) { return (m_object->*m_function)(a1, a2); } + object_type* object() { return m_object; } + const object_type* object() const { return m_object; } + + Ret operator () (Arg1 a1, Arg2 a2) { return (m_object->*m_function)(a1, a2); } private: Object* m_object; diff --git a/src/core/manager.cc b/src/core/manager.cc index 24e7f618..0dd0681f 100644 --- a/src/core/manager.cc +++ b/src/core/manager.cc @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -112,7 +113,7 @@ delete_tied(Download* d) { if (tie.empty()) return; - if (::unlink(tie.c_str()) == -1) + if (::unlink(rak::path_expand(tie).c_str()) == -1) control->core()->push_log("Could not unlink tied file: " + std::string(rak::error_number::current().c_str())); } diff --git a/src/display/window_download_transfer_list.cc b/src/display/window_download_transfer_list.cc index d036bc66..52dde386 100644 --- a/src/display/window_download_transfer_list.cc +++ b/src/display/window_download_transfer_list.cc @@ -74,7 +74,7 @@ WindowDownloadTransferList::redraw() { // prettify this. (This is a very subtle hint) for (int y = 1; y < m_canvas->get_height() && itr != transfers->end(); ++y, ++itr) { - m_canvas->print(0, y, "%5u ", (*itr)->index()); + m_canvas->print(0, y, "%5u [P: %u F: %u]", (*itr)->index(), (*itr)->priority(), (*itr)->failed()); // Handle window size. for (torrent::BlockList::const_iterator bItr = (*itr)->begin(), bLast = (*itr)->end(); bItr != bLast; ++bItr) { diff --git a/src/option_handler_rules.cc b/src/option_handler_rules.cc index 3fb203ce..fbc3f3fc 100644 --- a/src/option_handler_rules.cc +++ b/src/option_handler_rules.cc @@ -235,7 +235,7 @@ apply_stop_on_ratio(Control* m, const std::string& arg) { if ((totalUpload >= min_Upload && totalUpload * 100 >= totalDone * min_Ratio) || (max_Ratio > 0 && totalUpload * 100 > totalDone * max_Ratio)) { - if ((*itr)->variable()->get_value("ignore_ratio") <= 0) + if ((*itr)->variable()->get_value("ignore_ratio") == 0) m->core()->download_list()->stop(*itr); }