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



commit a8e67b612011ec0fd8aaf5e78ed2cf0462f648ad
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Feb 12 14:52:54 2017 +0200

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

 src/synchronization/silentui.cpp    |    6 +++---
 src/synchronization/silentui.hpp    |    6 +++---
 src/synchronization/syncdialog.cpp  |   10 +++++-----
 src/synchronization/syncdialog.hpp  |    6 +++---
 src/synchronization/syncmanager.cpp |    2 +-
 src/synchronization/syncui.cpp      |    2 +-
 src/synchronization/syncui.hpp      |   11 ++++++-----
 7 files changed, 22 insertions(+), 21 deletions(-)
---
diff --git a/src/synchronization/silentui.cpp b/src/synchronization/silentui.cpp
index 7b09e8e..a6810ca 100644
--- a/src/synchronization/silentui.cpp
+++ b/src/synchronization/silentui.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2012-2014 Aurimas Cernius
+ * Copyright (C) 2012-2014,2017 Aurimas Cernius
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -67,7 +67,7 @@ namespace sync {
   }
 
 
-  void SilentUI::note_synchronized(const std::string & DBG(noteTitle), NoteSyncType DBG(type))
+  void SilentUI::note_synchronized(const Glib::ustring & DBG(noteTitle), NoteSyncType DBG(type))
   {
     DBG_OUT("note synchronized, Title: %s, Type: %d", noteTitle.c_str(), int(type));
   }
@@ -75,7 +75,7 @@ namespace sync {
 
   void SilentUI::note_conflict_detected(const Note::Ptr & localConflictNote,
                                         NoteUpdate remoteNote,
-                                        const std::list<std::string> &)
+                                        const std::list<Glib::ustring> &)
   {
     DBG_OUT("note conflict detected, overwriting without a care");
     // TODO: At least respect conflict prefs
diff --git a/src/synchronization/silentui.hpp b/src/synchronization/silentui.hpp
index 306791e..53f8bf4 100644
--- a/src/synchronization/silentui.hpp
+++ b/src/synchronization/silentui.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2012-2014 Aurimas Cernius
+ * Copyright (C) 2012-2014,2017 Aurimas Cernius
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -39,10 +39,10 @@ namespace sync {
   private:
     explicit SilentUI(NoteManagerBase &);
     virtual void sync_state_changed(SyncState state) override;
-    virtual void note_synchronized(const std::string & noteTitle, NoteSyncType type) override;
+    virtual void note_synchronized(const Glib::ustring & noteTitle, NoteSyncType type) override;
     virtual void note_conflict_detected(const Note::Ptr & localConflictNote,
                                         NoteUpdate remoteNote,
-                                        const std::list<std::string> & noteUpdateTitles) override;
+                                        const std::list<Glib::ustring> & noteUpdateTitles) override;
     virtual void present_ui() override;
     void on_connecting();
     void on_idle();
diff --git a/src/synchronization/syncdialog.cpp b/src/synchronization/syncdialog.cpp
index 21ffca0..4066836 100644
--- a/src/synchronization/syncdialog.cpp
+++ b/src/synchronization/syncdialog.cpp
@@ -59,7 +59,7 @@ class SyncTitleConflictDialog
   : public Gtk::Dialog
 {
 public:
-  SyncTitleConflictDialog(const Note::Ptr & existingNote, const std::list<std::string> & noteUpdateTitles)
+  SyncTitleConflictDialog(const Note::Ptr & existingNote, const std::list<Glib::ustring> & noteUpdateTitles)
     : Gtk::Dialog(_("Note Conflict"), true)
     , m_existing_note(existingNote)
     , m_note_update_titles(noteUpdateTitles)
@@ -197,7 +197,7 @@ private:
     }
 
   Note::Ptr m_existing_note;
-  std::list<std::string> m_note_update_titles;
+  std::list<Glib::ustring> m_note_update_titles;
 
   Gtk::Button *continueButton;
 
@@ -562,7 +562,7 @@ void SyncDialog::sync_state_changed_(SyncState state)
 }
 
 
-void SyncDialog::note_synchronized(const std::string & noteTitle, NoteSyncType type)
+void SyncDialog::note_synchronized(const Glib::ustring & noteTitle, NoteSyncType type)
 {
   // FIXME: Change these strings to be more user-friendly
   // TODO: Update status for a note when status changes ("Uploading" -> "Uploaded", etc)
@@ -593,7 +593,7 @@ void SyncDialog::note_synchronized(const std::string & noteTitle, NoteSyncType t
 
 void SyncDialog::note_conflict_detected(const Note::Ptr & localConflictNote,
                                         NoteUpdate remoteNote,
-                                        const std::list<std::string> & noteUpdateTitles)
+                                        const std::list<Glib::ustring> & noteUpdateTitles)
 {
   int dlgBehaviorPref = Preferences::obj()
     .get_schema_settings(Preferences::SCHEMA_SYNC)->get_int(Preferences::SYNC_CONFIGURED_CONFLICT_BEHAVIOR);
@@ -622,7 +622,7 @@ void SyncDialog::note_conflict_detected(const Note::Ptr & localConflictNote,
 void SyncDialog::note_conflict_detected_(
   const Note::Ptr & localConflictNote,
   NoteUpdate remoteNote,
-  const std::list<std::string> & noteUpdateTitles,
+  const std::list<Glib::ustring> & noteUpdateTitles,
   SyncTitleConflictResolution savedBehavior,
   SyncTitleConflictResolution resolution,
   std::exception **mainThreadException)
diff --git a/src/synchronization/syncdialog.hpp b/src/synchronization/syncdialog.hpp
index c077bd9..418857f 100644
--- a/src/synchronization/syncdialog.hpp
+++ b/src/synchronization/syncdialog.hpp
@@ -45,10 +45,10 @@ namespace sync {
     static Ptr create(NoteManagerBase &);
 
     virtual void sync_state_changed(SyncState state) override;
-    virtual void note_synchronized(const std::string & noteTitle, NoteSyncType type) override;
+    virtual void note_synchronized(const Glib::ustring & noteTitle, NoteSyncType type) override;
     virtual void note_conflict_detected(const Note::Ptr & localConflictNote,
                                         NoteUpdate remoteNote,
-                                        const std::list<std::string> & noteUpdateTitles) override;
+                                        const std::list<Glib::ustring> & noteUpdateTitles) override;
     virtual void present_ui() override;
     void header_text(const Glib::ustring &);
     void message_text(const Glib::ustring &);
@@ -61,7 +61,7 @@ namespace sync {
     static void on_expander_activated(GtkExpander*, gpointer);
     void note_conflict_detected_(const Note::Ptr & localConflictNote,
                                  NoteUpdate remoteNote,
-                                 const std::list<std::string> & noteUpdateTitles,
+                                 const std::list<Glib::ustring> & noteUpdateTitles,
                                  SyncTitleConflictResolution savedBehavior,
                                  SyncTitleConflictResolution resolution,
                                  std::exception **mainThreadException);
diff --git a/src/synchronization/syncmanager.cpp b/src/synchronization/syncmanager.cpp
index 28e963c..7232908 100644
--- a/src/synchronization/syncmanager.cpp
+++ b/src/synchronization/syncmanager.cpp
@@ -213,7 +213,7 @@ namespace sync {
 
       // Gather list of new/updated note titles
       // for title conflict handling purposes.
-      std::list<std::string> noteUpdateTitles;
+      std::list<Glib::ustring> noteUpdateTitles;
       for(auto & iter : noteUpdates) {
         if(iter.second.m_title != "") {
           noteUpdateTitles.push_back(iter.second.m_title);
diff --git a/src/synchronization/syncui.cpp b/src/synchronization/syncui.cpp
index 3e79ce5..b4e184e 100644
--- a/src/synchronization/syncui.cpp
+++ b/src/synchronization/syncui.cpp
@@ -30,7 +30,7 @@ namespace sync {
   {
   }
 
-  void SyncUI::note_synchronized_th(const std::string & noteTitle, NoteSyncType type)
+  void SyncUI::note_synchronized_th(const Glib::ustring & noteTitle, NoteSyncType type)
   {
     utils::main_context_invoke([this, noteTitle, type]() { note_synchronized(noteTitle, type); });
   }
diff --git a/src/synchronization/syncui.hpp b/src/synchronization/syncui.hpp
index 112ac9d..3d0459f 100644
--- a/src/synchronization/syncui.hpp
+++ b/src/synchronization/syncui.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2012-2014 Aurimas Cernius
+ * Copyright (C) 2012-2014,2017 Aurimas Cernius
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -23,7 +23,8 @@
 
 
 #include <list>
-#include <string>
+
+#include <glibmm/ustring.h>
 
 #include "base/macros.hpp"
 #include "syncutils.hpp"
@@ -41,11 +42,11 @@ namespace sync {
     typedef sigc::slot<void> SlotIdle;
 
     virtual void sync_state_changed(SyncState state) = 0;
-    void note_synchronized_th(const std::string & noteTitle, NoteSyncType type);
-    virtual void note_synchronized(const std::string & noteTitle, NoteSyncType type) = 0;
+    void note_synchronized_th(const Glib::ustring & noteTitle, NoteSyncType type);
+    virtual void note_synchronized(const Glib::ustring & noteTitle, NoteSyncType type) = 0;
     virtual void note_conflict_detected(const Note::Ptr & localConflictNote,
                                         NoteUpdate remoteNote,
-                                        const std::list<std::string> & noteUpdateTitles) = 0;
+                                        const std::list<Glib::ustring> & noteUpdateTitles) = 0;
     virtual void present_ui() = 0;
 
     sigc::connection signal_connecting_connect(const SlotConnecting & slot);


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