[gnote] Update inserttimestamp



commit c46e4fbf76244c535fac1fc79339d2a31c4ae618
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat Oct 12 15:19:18 2019 +0300

    Update inserttimestamp

 src/addins/inserttimestamp/inserttimestamp.desktop.in.in  | 2 +-
 src/addins/inserttimestamp/inserttimestampnoteaddin.cpp   | 5 +++--
 src/addins/inserttimestamp/inserttimestamppreferences.cpp | 9 ++++-----
 3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/addins/inserttimestamp/inserttimestamp.desktop.in.in 
b/src/addins/inserttimestamp/inserttimestamp.desktop.in.in
index e92cca14..730456ea 100644
--- a/src/addins/inserttimestamp/inserttimestamp.desktop.in.in
+++ b/src/addins/inserttimestamp/inserttimestamp.desktop.in.in
@@ -4,7 +4,7 @@ _Name=Insert Timestamp
 _Description=Inserts current date and time at the cursor position.
 _Authors=Hubert Figuiere and Tomboy Project
 Category=Tools
-Version=0.4
+Version=0.5
 DefaultEnabled=false
 Module=libinserttimestamp
 LibgnoteRelease=@LIBGNOTE_RELEASE@
diff --git a/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp 
b/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp
index 22935ebb..895e34ce 100644
--- a/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp
+++ b/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp
@@ -24,6 +24,7 @@
 
 #include "sharp/datetime.hpp"
 #include "iactionmanager.hpp"
+#include "ignote.hpp"
 #include "inserttimestamppreferences.hpp"
 #include "inserttimestamppreferencesfactory.hpp"
 #include "inserttimestampnoteaddin.hpp"
@@ -54,7 +55,7 @@ namespace inserttimestamp {
     register_main_window_action_callback("inserttimestamp-insert",
       sigc::mem_fun(*this, &InsertTimestampNoteAddin::on_menu_item_activated));
 
-    Glib::RefPtr<Gio::Settings> settings = 
gnote::Preferences::obj().get_schema_settings(SCHEMA_INSERT_TIMESTAMP);
+    Glib::RefPtr<Gio::Settings> settings = 
gnote::IGnote::obj().preferences().get_schema_settings(SCHEMA_INSERT_TIMESTAMP);
     m_date_format = settings->get_string(INSERT_TIMESTAMP_FORMAT);
     settings->signal_changed().connect(
       sigc::mem_fun(*this, &InsertTimestampNoteAddin::on_format_setting_changed));
@@ -83,7 +84,7 @@ namespace inserttimestamp {
   void InsertTimestampNoteAddin::on_format_setting_changed(const Glib::ustring & key)
   {
     if(key == INSERT_TIMESTAMP_FORMAT) {
-      m_date_format = gnote::Preferences::obj().get_schema_settings(
+      m_date_format = gnote::IGnote::obj().preferences().get_schema_settings(
           SCHEMA_INSERT_TIMESTAMP)->get_string(INSERT_TIMESTAMP_FORMAT);
     }
   }
diff --git a/src/addins/inserttimestamp/inserttimestamppreferences.cpp 
b/src/addins/inserttimestamp/inserttimestamppreferences.cpp
index 51ba3e3e..01886414 100644
--- a/src/addins/inserttimestamp/inserttimestamppreferences.cpp
+++ b/src/addins/inserttimestamp/inserttimestamppreferences.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2011-2013,2017 Aurimas Cernius
+ * Copyright (C) 2011-2013,2017,2019 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -24,11 +24,10 @@
 #include "sharp/datetime.hpp"
 #include "sharp/propertyeditor.hpp"
 
+#include "ignote.hpp"
 #include "preferences.hpp"
 #include "inserttimestamppreferences.hpp"
  
-using gnote::Preferences;
-
 namespace inserttimestamp {
 
   const char * SCHEMA_INSERT_TIMESTAMP = "org.gnome.gnote.insert-timestamp";
@@ -59,7 +58,7 @@ namespace inserttimestamp {
     int row = 0;
 
     // Get current values
-    Glib::RefPtr<Gio::Settings> settings = Preferences::obj().get_schema_settings(SCHEMA_INSERT_TIMESTAMP);
+    Glib::RefPtr<Gio::Settings> settings = 
gnote::IGnote::obj().preferences().get_schema_settings(SCHEMA_INSERT_TIMESTAMP);
     Glib::ustring dateFormat = settings->get_string(INSERT_TIMESTAMP_FORMAT);
 
     sharp::DateTime now = sharp::DateTime::now();
@@ -182,7 +181,7 @@ namespace inserttimestamp {
     if (iter) {
       Glib::ustring format;
       iter->get_value(1, format);
-      Preferences::obj().get_schema_settings(SCHEMA_INSERT_TIMESTAMP)->set_string(
+      gnote::IGnote::obj().preferences().get_schema_settings(SCHEMA_INSERT_TIMESTAMP)->set_string(
           INSERT_TIMESTAMP_FORMAT, format);
     }
   }


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