From 7d67da43712ae55e17ff2916a07abeaffd439421 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 11 Oct 2009 18:46:35 +0000 Subject: [PATCH] Fix saving torrent state on fresh configs Do not try to call doIteration() on the reactor if it has already stopped --- ChangeLog | 4 ++++ deluge/core/torrentmanager.py | 4 ++++ deluge/ui/gtkui/gtkui.py | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6a89deb3d..e3a9d2588 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,11 @@ ==== GtkUI ==== * Fix path errors when adding torrents externally in Windows * Fix localclient authentication by stripping the lines read from the auth file + * Do not try to call doIteration() on the reactor if it has already stopped +==== Core ==== + * Fix saving torrent state on fresh configs + ==== Misc ==== * Add man pages for deluge-console and deluge-gtk diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 3d947bb0e..152eec71c 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -132,6 +132,10 @@ class TorrentManager(component.Component): # Get the core config self.config = ConfigManager("core.conf") + # Make sure the state folder has been created + if not os.path.exists(os.path.join(get_config_dir(), "state")): + os.makedirs(os.path.join(get_config_dir(), "state")) + # Create the torrents dict { torrent_id: Torrent } self.torrents = {} diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 767c7049d..8e3879356 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -233,7 +233,7 @@ class GtkUI(object): # Process any pending gtk events since the mainloop has been quit if not deluge.common.windows_check(): - while gtk.events_pending(): + while gtk.events_pending() and reactor.running: reactor.doIteration(0) # Shutdown all components