[hamster-applet] treat cases when instead of file updates a delete/create is being performed (fixes bug 626211)



commit 4321554b53f23a4771196176838c7d890de4b146
Author: Toms Bauģis <toms baugis gmail com>
Date:   Tue Aug 10 17:29:56 2010 +0100

    treat cases when instead of file updates a delete/create is being performed (fixes bug 626211)

 src/hamster/db.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/hamster/db.py b/src/hamster/db.py
index 5b146d2..0807997 100644
--- a/src/hamster/db.py
+++ b/src/hamster/db.py
@@ -65,7 +65,11 @@ class Storage(storage.Storage):
                 if gio_file.query_info(gio.FILE_ATTRIBUTE_ETAG_VALUE).get_etag() == self.__last_etag:
                     # ours
                     return
+            elif event == gio.FILE_MONITOR_EVENT_CREATED:
+                # treat case when instead of a move, a remove and create has been performed
+                self.con = None
 
+            if event in (gio.FILE_MONITOR_EVENT_CHANGES_DONE_HINT, gio.FILE_MONITOR_EVENT_CREATED):
                 print "DB file has been modified externally. Calling all stations"
                 self.dispatch_overwrite()
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]