diff --git a/doc/rtorrent.1.xml b/doc/rtorrent.1.xml
index b1b2297f..b8547f3f 100644
--- a/doc/rtorrent.1.xml
+++ b/doc/rtorrent.1.xml
@@ -119,6 +119,15 @@
+
+ 1 - 6
+
+
+Change view.
+
+
+
+
^s
@@ -269,7 +278,7 @@ Disconnect peer.
*
-Choke/Snubb peer.
+Choke/Snub peer.
@@ -548,8 +557,8 @@ deleted, the association is then cleared.
load_start = file
-Load and possibly start a file, or possibly mutiple files by using the
-wildcard "*". This is meant for use with
+Load and possibly start a file, or possibly multiple files by using the
+wild-card "*". This is meant for use with
schedule, though ensure that the
start is non-zero. The loaded file will be tied
to the filename provided.
@@ -573,6 +582,78 @@ torrent::input_error exception on bad input.
+
+ DISPLAY SETTINGS
+
+ Display related settings.
+
+
+
+
+
+ view_add = name
+
+
+Create a new view.
+
+
+
+
+
+ view_sort = name
+ view_sort = name,seconds
+
+
+Sort a view according the the criteria set by
+view_sort_current. If the optional argument is
+supplied, the view is not sorted if a change happened during the last
+seconds. This command is meant to be used with
+schedule.
+
+
+
+
+
+ view_sort_new = name,...
+ view_sort_current = name,...
+
+
+Set the sorting criteria for when new elements inserted or
+view_sort is called. The list can contain any
+number of criteria, including zero, from the following:
+
+
+
+name, name_reverse,
+stopped, started,
+complete, incomplete,
+state_changed,
+state_changed_reverse
+
+
+
+
+
+ view_filter = name,...
+
+
+Set a list of filter to apply when new new downloads are added and
+when view_sort gets called. All filters must
+match for the download to be included.
+
+
+
+stopped, started,
+complete, incomplete,
+
+
+
+
+
+
+
+
+
ADVANCED SETTINGS
@@ -659,8 +740,8 @@ Changes the working directory of the process using
session_on_completion = yes
-Controls whetever the session torrent is updated when a torrent
-finishes. By default on.
+Controls if the session torrent is saved when a torrent finishes. By
+default on.
@@ -669,7 +750,16 @@ finishes. By default on.
session_lock = yes
-Controls whetever a lock file is created in the session directory.
+Controls if a lock file is created in the session directory on startup.
+
+
+
+
+
+ session_save =
+
+
+Save the session files for all downloads.
diff --git a/src/core/download_list.cc b/src/core/download_list.cc
index 9f7c9fad..4a26b423 100644
--- a/src/core/download_list.cc
+++ b/src/core/download_list.cc
@@ -339,10 +339,7 @@ DownloadList::check_hash_throw(Download* download) {
close_throw(download);
download->download()->hash_resume_clear();
-
open_throw(download);
- download->download()->hash_resume_save();
-
// If any more stuff is added here, make sure resume etc are still
// correct.
@@ -353,7 +350,9 @@ void
DownloadList::hash_done(Download* download) {
check_contains(download);
- if (!download->download()->is_hash_checked() || download->download()->is_hash_checking())
+ if (!download->download()->is_hash_checked() ||
+ download->download()->is_hash_checking() ||
+ download->download()->is_active())
throw torrent::internal_error("DownloadList::hash_done(...) download in invalid state.");
// Need to find some sane conditional here. Can we check the total
@@ -375,6 +374,10 @@ DownloadList::hash_done(Download* download) {
if (download->is_done())
download->variable()->set("complete", (int64_t)1);
+ // Save resume data so we update time-stamps and priorities if
+ // they were invalid/changed when loading.
+ download->download()->hash_resume_save();
+
if (download->variable()->get_value("state") == 1)
resume(download);
@@ -432,12 +435,12 @@ DownloadList::confirm_finished(Download* download) {
download->download()->tracker_list().send_completed();
- download->download()->hash_resume_save();
-
// Do this before the slots are called in case one of them closes
// the download.
- if (!download->is_active() && control->variable()->get_value("session_on_completion") == 1)
+ if (!download->is_active() && control->variable()->get_value("session_on_completion") == 1) {
+ download->download()->hash_resume_save();
control->core()->download_store()->save(download);
+ }
std::for_each(m_slotMapFinished.begin(), m_slotMapFinished.end(), download_list_call(download));
}
diff --git a/src/core/view_manager.cc b/src/core/view_manager.cc
index 0731171f..2ec0fe00 100644
--- a/src/core/view_manager.cc
+++ b/src/core/view_manager.cc
@@ -48,6 +48,13 @@
namespace core {
+class ViewSortFalse : public ViewSort {
+public:
+ virtual bool operator () (Download* d1, Download* d2) const {
+ return false;
+ }
+};
+
class ViewSortName : public ViewSort {
public:
virtual bool operator () (Download* d1, Download* d2) const {
@@ -117,7 +124,7 @@ ViewManager::ViewManager(DownloadList* dl) :
m_list(dl) {
// m_sort["first"] = new ViewSortNot(new ViewSort());
-// m_sort["last"] = new ViewSort();
+ m_sort["last"] = new ViewSortFalse();
m_sort["name"] = new ViewSortName();
m_sort["name_reverse"] = new ViewSortReverse(new ViewSortName());
diff --git a/src/main.cc b/src/main.cc
index 2fbdbd09..c88aa76c 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -165,6 +165,7 @@ main(int argc, char** argv) {
// Currently not doing any sorting on main.
control->variable()->process_command("view_add = main");
+ //control->variable()->process_command("view_sort_current = name,started,name");
control->variable()->process_command("view_add = name");
control->variable()->process_command("view_sort_new = name,name");
@@ -207,11 +208,6 @@ main(int argc, char** argv) {
// control->variable()->process_command("schedule = scheduler,10,10,download_scheduler=");
- // Move env and go through "try_import".
-// if (!control->variable()->process_file("~/.rtorrent.rc"))
-// control->core()->get_log_important().push_front("Could not load \"~/.rtorrent.rc\".");
-
- // Complain.
control->variable()->process_command("try_import = ~/.rtorrent.rc");
int firstArg = parse_options(control, argc, argv);