changeset 12:bbe09d5791dd

Fixed double initialisation - Journal and copy queue were started 2 times when new files were added throught DBus
author Goffi <goffi@goffi.org>
date Tue, 28 Sep 2010 14:24:18 +0800
parents c065a70c3e7b
children 894530949e30
files gcp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gcp	Tue Sep 28 14:10:37 2010 +0800
+++ b/gcp	Tue Sep 28 14:24:18 2010 +0800
@@ -154,6 +154,7 @@
                 debug (_("gcp launched"))
                 self._main_instance = True
                 self.buffer_size = const_BUFF_SIZE
+                self.__launched = False #True when journal is initialised and copy is started
             else:
                 raise e
 
@@ -474,8 +475,10 @@
                 return (False, _error_msg)
             debug(_("adding args to gcp: %s") % str(args).decode('utf-8','replace'))
             self.__checkArgs(options, source_path, args)
-            self.journal = Journal()
-            gobject.idle_add(self.__copyNextFile)
+            if not self.__launched:
+                self.journal = Journal()
+                gobject.idle_add(self.__copyNextFile)
+                self.__launched = True
         return (True,'')
 
     def go(self):