[gnote] Use UTC time in note directory watcher



commit 0ddd6b43fa7d8e1096b74be1658082cd39809c65
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat Mar 14 16:23:18 2020 +0200

    Use UTC time in note directory watcher

 .../notedirectorywatcher/notedirectorywatcherapplicationaddin.cpp   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/addins/notedirectorywatcher/notedirectorywatcherapplicationaddin.cpp 
b/src/addins/notedirectorywatcher/notedirectorywatcherapplicationaddin.cpp
index f9dfdd1f..212cc24f 100644
--- a/src/addins/notedirectorywatcher/notedirectorywatcherapplicationaddin.cpp
+++ b/src/addins/notedirectorywatcher/notedirectorywatcherapplicationaddin.cpp
@@ -87,7 +87,7 @@ bool NoteDirectoryWatcherApplicationAddin::initialized()
 
 void NoteDirectoryWatcherApplicationAddin::handle_note_saved(const gnote::NoteBase::Ptr & note)
 {
-  m_note_save_times[note->id()] = Glib::DateTime::create_now_local();
+  m_note_save_times[note->id()] = Glib::DateTime::create_now_utc();
 }
 
 void NoteDirectoryWatcherApplicationAddin::handle_file_system_change_event(
@@ -135,7 +135,7 @@ void NoteDirectoryWatcherApplicationAddin::handle_file_system_change_event(
       }
     }
 
-    record->second.last_change = Glib::DateTime::create_now_local();
+    record->second.last_change = Glib::DateTime::create_now_utc();
   }
   catch(...)
   {}
@@ -175,7 +175,7 @@ bool NoteDirectoryWatcherApplicationAddin::handle_timeout()
       // TODO: Take some actions to clear note_save_times? Not a large structure...
 
       Glib::DateTime last_change(iter.second.last_change);
-      if(Glib::DateTime::create_now_local() > last_change.add_seconds(4)) {
+      if(Glib::DateTime::create_now_utc() > last_change.add_seconds(4)) {
         if(iter.second.deleted) {
           delete_note(iter.first);
         }


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