From 1982429b8ccf43b0499c894cff1c7e99cccb0050 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Wed, 8 Nov 2006 14:57:30 +0000 Subject: [PATCH] * Moving some API headers torrent/data and torrent/peer. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@803 e378c898-3ddf-0310-93e7-cc216c733640 --- src/core/download.h | 11 ++++++++--- src/display/window_download_chunks_seen.cc | 6 +++--- src/display/window_download_transfer_list.cc | 4 ++-- src/display/window_download_transfer_list.h | 2 +- src/display/window_peer_list.cc | 4 ++-- src/display/window_peer_list.h | 2 +- src/ui/download.h | 2 +- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/core/download.h b/src/core/download.h index bc795dde..28e319c9 100644 --- a/src/core/download.h +++ b/src/core/download.h @@ -104,12 +104,12 @@ public: // Helper functions for calling functions in download_type // through sigc++. template - void call() { (m_download.*func)(); } + void call() { (m_download.*func)(); } template - void call(Arg1 a1) { (m_download.*func)(a1); } + void call(Arg1 a1) { (m_download.*func)(a1); } - bool operator == (const std::string& str) { return str == m_download.info_hash(); } + bool operator == (const std::string& str) const; void set_connection_type(const std::string& t) { m_download.set_connection_type(string_to_connection_type(t)); } @@ -152,6 +152,11 @@ private: sigc::connection m_connStorageError; }; +inline bool +Download::operator == (const std::string& str) const { + return str.size() == torrent::HashString::size_data && *torrent::HashString::cast_from(str) == m_download.info_hash(); +} + } #endif diff --git a/src/display/window_download_chunks_seen.cc b/src/display/window_download_chunks_seen.cc index da650156..9f61de8e 100644 --- a/src/display/window_download_chunks_seen.cc +++ b/src/display/window_download_chunks_seen.cc @@ -41,9 +41,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "core/download.h" diff --git a/src/display/window_download_transfer_list.cc b/src/display/window_download_transfer_list.cc index 5a535094..3430331e 100644 --- a/src/display/window_download_transfer_list.cc +++ b/src/display/window_download_transfer_list.cc @@ -39,8 +39,8 @@ #include #include #include -#include -#include +#include +#include #include "core/download.h" diff --git a/src/display/window_download_transfer_list.h b/src/display/window_download_transfer_list.h index 8c500eb4..b0066bc4 100644 --- a/src/display/window_download_transfer_list.h +++ b/src/display/window_download_transfer_list.h @@ -38,7 +38,7 @@ #define RTORRENT_DISPLAY_WINDOW_DOWNLOAD_TRANSFER_LIST_H #include -#include +#include #include "window.h" diff --git a/src/display/window_peer_list.cc b/src/display/window_peer_list.cc index 1548213e..5e43f7d0 100644 --- a/src/display/window_peer_list.cc +++ b/src/display/window_peer_list.cc @@ -38,9 +38,9 @@ #include #include -#include #include -#include +#include +#include #include "core/download.h" #include "rak/algorithm.h" diff --git a/src/display/window_peer_list.h b/src/display/window_peer_list.h index 31b94af4..0595773c 100644 --- a/src/display/window_peer_list.h +++ b/src/display/window_peer_list.h @@ -38,7 +38,7 @@ #define RTORRENT_DISPLAY_PEER_LIST_H #include -#include +#include #include "window.h" diff --git a/src/ui/download.h b/src/ui/download.h index c5efb682..f0117d31 100644 --- a/src/ui/download.h +++ b/src/ui/download.h @@ -38,7 +38,7 @@ #define RTORRENT_UI_DOWNLOAD_H #include -#include +#include #include #include "display/manager.h"