[gnote] Replace std::string by Glib::ustring in Note



commit 1c9689215a61c19420ac9ebb317a44574ddc4836
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat Feb 4 14:01:03 2017 +0200

    Replace std::string by Glib::ustring in Note

 src/note.cpp |   20 ++++++++++----------
 src/note.hpp |   13 ++++++-------
 2 files changed, 16 insertions(+), 17 deletions(-)
---
diff --git a/src/note.cpp b/src/note.cpp
index 9cc02e2..ba6a335 100644
--- a/src/note.cpp
+++ b/src/note.cpp
@@ -300,7 +300,7 @@ namespace gnote {
   }
 
   Note::Ptr Note::create_existing_note(NoteData *data,
-                                 std::string filepath,
+                                 Glib::ustring filepath,
                                  NoteManager & manager)
   {
     if (!data->change_date().is_valid()) {
@@ -348,7 +348,7 @@ namespace gnote {
   }
 
   
-  Note::Ptr Note::load(const std::string & read_file, NoteManager & manager)
+  Note::Ptr Note::load(const Glib::ustring & read_file, NoteManager & manager)
   {
     NoteData *data = new NoteData(url_from_path(read_file));
     NoteArchiver::read(read_file, *data);
@@ -473,7 +473,7 @@ namespace gnote {
 
   void Note::remove_tag(Tag & tag)
   {
-    std::string tag_name = tag.normalized_name();
+    Glib::ustring tag_name = tag.normalized_name();
     NoteData::TagMap & thetags(m_data.data().tags());
     NoteData::TagMap::iterator iter;
 
@@ -547,7 +547,7 @@ namespace gnote {
   }
 
 
-  void Note::process_rename_link_update(const std::string & old_title)
+  void Note::process_rename_link_update(const Glib::ustring & old_title)
   {
     NoteBase::List linking_notes = manager().get_notes_linking_to(old_title);
     const Note::Ptr self = static_pointer_cast<Note>(shared_from_this());
@@ -581,7 +581,7 @@ namespace gnote {
   }
 
   void Note::process_rename_link_update_end(int response, Gtk::Dialog *dialog,
-                                            const std::string & old_title, const Note::Ptr & self)
+                                            const Glib::ustring & old_title, const Note::Ptr & self)
   {
     if(dialog) {
       NoteRenameDialog *dlg = static_cast<NoteRenameDialog*>(dialog);
@@ -614,8 +614,8 @@ namespace gnote {
 
   bool Note::contains_text(const Glib::ustring & text)
   {
-    const std::string text_lower = text.lowercase();
-    const std::string text_content_lower = text_content().lowercase();
+    const Glib::ustring text_lower = text.lowercase();
+    const Glib::ustring text_content_lower = text_content().lowercase();
     return text_content_lower.find(text_lower) != Glib::ustring::npos;
   }
 
@@ -628,7 +628,7 @@ namespace gnote {
     if (!contains_text(old_title))
       return;
 
-    const std::string old_title_lower = old_title.lowercase();
+    const Glib::ustring old_title_lower = old_title.lowercase();
 
     const NoteTag::Ptr link_tag = m_tag_table->get_link_tag();
 
@@ -687,7 +687,7 @@ namespace gnote {
     return m_buffer->get_slice(m_buffer->begin(), m_buffer->end());
   }
 
-  void Note::set_text_content(const std::string & text)
+  void Note::set_text_content(const Glib::ustring & text)
   {
     if(m_buffer) {
       m_buffer->set_text(text);
@@ -790,7 +790,7 @@ namespace gnote {
 
   void Note::set_pinned(bool pinned) const
   {
-    std::string new_pinned;
+    Glib::ustring new_pinned;
     Glib::RefPtr<Gio::Settings> settings = Preferences::obj().get_schema_settings(Preferences::SCHEMA_GNOTE);
     Glib::ustring old_pinned = settings->get_string(Preferences::MENU_PINNED_NOTES);
     bool is_currently_pinned = old_pinned.find(uri()) != Glib::ustring::npos;
diff --git a/src/note.hpp b/src/note.hpp
index 864c47b..4018b42 100644
--- a/src/note.hpp
+++ b/src/note.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2011-2015 Aurimas Cernius
+ * Copyright (C) 2011-2015,2017 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -25,7 +25,6 @@
 #define __NOTE_HPP_
 
 #include <list>
-#include <string>
 #include <queue>
 
 #include <gtkmm/textbuffer.h>
@@ -103,10 +102,10 @@ public:
                                    NoteManager & manager);
 
   static Note::Ptr create_existing_note(NoteData *data,
-                                        std::string filepath,
+                                        Glib::ustring filepath,
                                         NoteManager & manager);
   virtual void delete_note() override;
-  static Note::Ptr load(const std::string &, NoteManager &);
+  static Note::Ptr load(const Glib::ustring &, NoteManager &);
   virtual void save() override;
   virtual void queue_save(ChangeType c) override;
   using NoteBase::remove_tag;
@@ -119,7 +118,7 @@ public:
   virtual void rename_without_link_update(const Glib::ustring & newTitle) override;
   virtual void set_xml_content(const Glib::ustring & xml) override;
   Glib::ustring text_content();
-  void set_text_content(const std::string & text);
+  void set_text_content(const Glib::ustring & text);
 
   const Glib::RefPtr<NoteTagTable> & get_tag_table();
   bool has_buffer() const
@@ -178,9 +177,9 @@ private:
   bool on_window_destroyed(GdkEventAny *ev);
   void on_save_timeout();
   void process_child_widget_queue();
-  void process_rename_link_update(const std::string & old_title);
+  void process_rename_link_update(const Glib::ustring & old_title);
   void process_rename_link_update_end(int response, Gtk::Dialog *dialog,
-                                      const std::string & old_title, const Note::Ptr & self);
+                                      const Glib::ustring & old_title, const Note::Ptr & self);
   void on_note_window_embedded();
   void on_note_window_foregrounded();
 


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