Added setting for session directory.

Added support for quotation in settings.

Added key for changing the priority of all files in a torrent.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@477 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-06-26 19:51:20 +00:00
parent 28b369dc83
commit 2c5ce1989a
15 changed files with 118 additions and 64 deletions
+1 -9
View File
@@ -36,21 +36,13 @@
namespace core {
void
DownloadStore::activate(const std::string& path) {
DownloadStore::use(const std::string& path) {
m_path = path;
if (m_path.empty())
throw std::logic_error("core::DownloadStore::activate(...) received an empty path");
if (*m_path.rbegin() != '/')
m_path += '/';
}
void
DownloadStore::disable() {
m_path = "";
}
void
DownloadStore::save(Download* d) {
if (!is_active())
+2 -2
View File
@@ -34,8 +34,8 @@ class Download;
class DownloadStore {
public:
void activate(const std::string& path);
void disable();
// Disable by passing an empty string.
void use(const std::string& path);
bool is_active() { return !m_path.empty(); }
+2 -2
View File
@@ -97,8 +97,8 @@ Manager::insert(std::string uri) {
}
}
Manager::iterator
Manager::erase(DownloadList::iterator itr) {
Manager::DListItr
Manager::erase(DListItr itr) {
if ((*itr)->get_download().is_active())
throw std::logic_error("core::Manager::erase(...) called on an active download");
+3 -7
View File
@@ -40,11 +40,11 @@ namespace core {
class Manager {
public:
typedef DownloadList::iterator iterator;
typedef DownloadList::iterator DListItr;
typedef sigc::slot1<void, DownloadList::iterator> SlotReady;
typedef sigc::slot0<void> SlotFailed;
Manager() : m_portFirst(6890), m_portLast(6999), m_debugTracker(-1) {}
Manager() : m_portFirst(6890), m_portLast(6999) {}
DownloadList& get_download_list() { return m_downloadList; }
DownloadStore& get_download_store() { return m_downloadStore; }
@@ -59,7 +59,7 @@ public:
void cleanup();
void insert(std::string uri);
iterator erase(DownloadList::iterator itr);
DListItr erase(DListItr itr);
void start(Download* d);
void stop(Download* d);
@@ -68,8 +68,6 @@ public:
void set_port_range(int a, int b) { m_portFirst = a; m_portLast = b; }
void debug_tracker() { m_debugTracker = 0; }
private:
void create_http(const std::string& uri);
void create_final(std::istream* s);
@@ -88,8 +86,6 @@ private:
int m_portFirst;
int m_portLast;
int m_debugTracker;
};
}