mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-14 22:22:31 +00:00
* Added the framework for a download scheduler.
* Added "state_changed" variable to downloads that returns the last time the download called DownloadList::pause/resume. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@674 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -69,6 +69,19 @@ private:
|
||||
std::string m_value;
|
||||
};
|
||||
|
||||
class ViewSortVariableValue : public ViewSort {
|
||||
public:
|
||||
ViewSortVariableValue(const std::string& name) :
|
||||
m_name(name) {}
|
||||
|
||||
virtual bool less(Download* d1, Download* d2) const {
|
||||
return d1->variable()->get_value(m_name) < d2->variable()->get_value(m_name);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
};
|
||||
|
||||
class ViewSortReverse : public ViewSort {
|
||||
public:
|
||||
ViewSortReverse(ViewSort* s) : m_sort(s) {}
|
||||
@@ -87,11 +100,14 @@ ViewManager::ViewManager(DownloadList* dl) :
|
||||
|
||||
// m_sort["first"] = new ViewSortNot(new ViewSort());
|
||||
// m_sort["last"] = new ViewSort();
|
||||
m_sort["name"] = new ViewSortName();
|
||||
m_sort["name_reverse"] = new ViewSortReverse(new ViewSortName());
|
||||
m_sort["name"] = new ViewSortName();
|
||||
m_sort["name_reverse"] = new ViewSortReverse(new ViewSortName());
|
||||
|
||||
m_sort["started"] = new ViewSortVariable("state", "started");
|
||||
m_sort["stopped"] = new ViewSortVariable("state", "stopped");
|
||||
m_sort["started"] = new ViewSortVariable("state", "started");
|
||||
m_sort["stopped"] = new ViewSortVariable("state", "stopped");
|
||||
|
||||
m_sort["state_changed"] = new ViewSortVariableValue("state_changed");
|
||||
m_sort["state_changed_reverse"] = new ViewSortReverse(new ViewSortVariableValue("state_changed"));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user