[gnote] Replace std::string by Glib::ustring in SyncServiceAddin
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Replace std::string by Glib::ustring in SyncServiceAddin
- Date: Sun, 12 Feb 2017 15:14:55 +0000 (UTC)
commit 3c1a9292ac9f52c6d8fc6710b3a6f1d3683e8e39
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Feb 12 15:42:33 2017 +0200
Replace std::string by Glib::ustring in SyncServiceAddin
.../filesystemsyncserviceaddin.cpp | 18 +++++++++---------
.../filesystemsyncserviceaddin.hpp | 10 +++++-----
.../webdavsyncservice/webdavsyncserviceaddin.cpp | 4 ++--
.../webdavsyncservice/webdavsyncserviceaddin.hpp | 4 ++--
src/synchronization/syncserviceaddin.hpp | 6 +++---
5 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/src/addins/filesystemsyncservice/filesystemsyncserviceaddin.cpp
b/src/addins/filesystemsyncservice/filesystemsyncserviceaddin.cpp
index 972b840..54f77ef 100644
--- a/src/addins/filesystemsyncservice/filesystemsyncserviceaddin.cpp
+++ b/src/addins/filesystemsyncservice/filesystemsyncserviceaddin.cpp
@@ -65,7 +65,7 @@ gnote::sync::SyncServer::Ptr FileSystemSyncServiceAddin::create_sync_server()
{
gnote::sync::SyncServer::Ptr server;
- std::string syncPath;
+ Glib::ustring syncPath;
if(get_config_settings(syncPath)) {
m_path = syncPath;
if(sharp::directory_exists(m_path) == false) {
@@ -95,7 +95,7 @@ Gtk::Widget *FileSystemSyncServiceAddin::create_preferences_control(EventHandler
table->set_col_spacings(10);
// Read settings out of gconf
- std::string syncPath;
+ Glib::ustring syncPath;
if(get_config_settings(syncPath) == false) {
syncPath = "";
}
@@ -127,7 +127,7 @@ Gtk::Widget *FileSystemSyncServiceAddin::create_preferences_control(EventHandler
bool FileSystemSyncServiceAddin::save_configuration()
{
- std::string syncPath = m_path_button->get_filename();
+ Glib::ustring syncPath = m_path_button->get_filename();
if(syncPath == "") {
// TODO: Figure out a way to send the error back to the client
@@ -145,8 +145,8 @@ bool FileSystemSyncServiceAddin::save_configuration()
else {
// Test creating/writing/deleting a file
// FIXME: Should throw gnote::sync::GnoteSyncException once string changes are OK again
- std::string testPathBase = Glib::build_filename(syncPath, "test");
- std::string testPath = testPathBase;
+ Glib::ustring testPathBase = Glib::build_filename(syncPath, "test");
+ Glib::ustring testPath = testPathBase;
int count = 0;
// Get unique new file name
@@ -155,7 +155,7 @@ bool FileSystemSyncServiceAddin::save_configuration()
}
// Test ability to create and write
- std::string testLine = "Testing write capabilities.";
+ Glib::ustring testLine = "Testing write capabilities.";
std::ofstream fout(testPath.c_str());
if(fout.is_open()) {
fout << testLine;
@@ -213,14 +213,14 @@ bool FileSystemSyncServiceAddin::is_configured()
}
-std::string FileSystemSyncServiceAddin::name()
+Glib::ustring FileSystemSyncServiceAddin::name()
{
char *res = _("Local Folder");
return res ? res : "";
}
-std::string FileSystemSyncServiceAddin::id()
+Glib::ustring FileSystemSyncServiceAddin::id()
{
return "local";
}
@@ -238,7 +238,7 @@ bool FileSystemSyncServiceAddin::initialized()
}
-bool FileSystemSyncServiceAddin::get_config_settings(std::string & syncPath)
+bool FileSystemSyncServiceAddin::get_config_settings(Glib::ustring & syncPath)
{
syncPath = gnote::Preferences::obj().get_schema_settings(
gnote::Preferences::SCHEMA_SYNC)->get_string(gnote::Preferences::SYNC_LOCAL_PATH);
diff --git a/src/addins/filesystemsyncservice/filesystemsyncserviceaddin.hpp
b/src/addins/filesystemsyncservice/filesystemsyncserviceaddin.hpp
index 255307e..bf61923 100644
--- a/src/addins/filesystemsyncservice/filesystemsyncserviceaddin.hpp
+++ b/src/addins/filesystemsyncservice/filesystemsyncserviceaddin.hpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2012-2013 Aurimas Cernius
+ * Copyright (C) 2012-2013,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
@@ -61,15 +61,15 @@ public:
virtual bool save_configuration() override;
virtual void reset_configuration() override;
virtual bool is_configured() override;
- virtual std::string name() override;
- virtual std::string id() override;
+ virtual Glib::ustring name() override;
+ virtual Glib::ustring id() override;
virtual bool is_supported() override;
virtual bool initialized() override;
private:
- bool get_config_settings(std::string & syncPath);
+ bool get_config_settings(Glib::ustring & syncPath);
Gtk::FileChooserButton *m_path_button;
- std::string m_path;
+ Glib::ustring m_path;
bool m_initialized;
bool m_enabled;
};
diff --git a/src/addins/webdavsyncservice/webdavsyncserviceaddin.cpp
b/src/addins/webdavsyncservice/webdavsyncserviceaddin.cpp
index 62264f2..3c04674 100644
--- a/src/addins/webdavsyncservice/webdavsyncserviceaddin.cpp
+++ b/src/addins/webdavsyncservice/webdavsyncserviceaddin.cpp
@@ -99,14 +99,14 @@ bool WebDavSyncServiceAddin::are_settings_valid()
}
-std::string WebDavSyncServiceAddin::name()
+Glib::ustring WebDavSyncServiceAddin::name()
{
const char *res = _("WebDAV");
return res;
}
-std::string WebDavSyncServiceAddin::id()
+Glib::ustring WebDavSyncServiceAddin::id()
{
return "wdfs";
}
diff --git a/src/addins/webdavsyncservice/webdavsyncserviceaddin.hpp
b/src/addins/webdavsyncservice/webdavsyncserviceaddin.hpp
index 7720313..35dbefc 100644
--- a/src/addins/webdavsyncservice/webdavsyncserviceaddin.hpp
+++ b/src/addins/webdavsyncservice/webdavsyncserviceaddin.hpp
@@ -70,13 +70,13 @@ public:
/// The name that will be shown in the preferences to distinguish
/// between this and other SyncServiceAddins.
/// </summary>
- virtual std::string name() override;
+ virtual Glib::ustring name() override;
/// <summary>
/// Specifies a unique identifier for this addin. This will be used to
/// set the service in preferences.
/// </summary>
- virtual std::string id() override;
+ virtual Glib::ustring id() override;
virtual std::string fuse_mount_directory_error() override;
protected:
diff --git a/src/synchronization/syncserviceaddin.hpp b/src/synchronization/syncserviceaddin.hpp
index d1d86e6..306039b 100644
--- a/src/synchronization/syncserviceaddin.hpp
+++ b/src/synchronization/syncserviceaddin.hpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2012-2013 Aurimas Cernius
+ * Copyright (C) 2012-2013,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
@@ -49,8 +49,8 @@ namespace sync {
{
return true;
}
- virtual std::string name() = 0;
- virtual std::string id() = 0;
+ virtual Glib::ustring name() = 0;
+ virtual Glib::ustring id() = 0;
virtual bool is_supported() = 0;
virtual void initialize () = 0;
virtual void shutdown () = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]