[gnote] Use std::make_shared when creating FileSystemSyncServer
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Use std::make_shared when creating FileSystemSyncServer
- Date: Thu, 26 Dec 2019 13:58:59 +0000 (UTC)
commit a1c68062aaca7a11396fb7a8faa5286ac283e52d
Author: Aurimas Černius <aurisc4 gmail com>
Date: Thu Dec 26 15:56:50 2019 +0200
Use std::make_shared when creating FileSystemSyncServer
src/synchronization/filesystemsyncserver.cpp | 10 ++--------
src/synchronization/filesystemsyncserver.hpp | 3 +--
2 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/src/synchronization/filesystemsyncserver.cpp b/src/synchronization/filesystemsyncserver.cpp
index 0aead48c..b60ee1b7 100644
--- a/src/synchronization/filesystemsyncserver.cpp
+++ b/src/synchronization/filesystemsyncserver.cpp
@@ -55,14 +55,8 @@ namespace sync {
SyncServer::Ptr FileSystemSyncServer::create(const Glib::RefPtr<Gio::File> & path, Preferences & prefs)
{
- return SyncServer::Ptr(new FileSystemSyncServer(path,
- prefs.get_schema_settings(Preferences::SCHEMA_SYNC)->get_string(Preferences::SYNC_CLIENT_ID)));
-}
-
-
-SyncServer::Ptr FileSystemSyncServer::create(const Glib::RefPtr<Gio::File> & path, const Glib::ustring &
client_id)
-{
- return SyncServer::Ptr(new FileSystemSyncServer(path, client_id));
+ return std::make_shared<FileSystemSyncServer>(path,
+ prefs.get_schema_settings(Preferences::SCHEMA_SYNC)->get_string(Preferences::SYNC_CLIENT_ID));
}
diff --git a/src/synchronization/filesystemsyncserver.hpp b/src/synchronization/filesystemsyncserver.hpp
index a4239bf9..752d39ca 100644
--- a/src/synchronization/filesystemsyncserver.hpp
+++ b/src/synchronization/filesystemsyncserver.hpp
@@ -35,7 +35,7 @@ class FileSystemSyncServer
{
public:
static SyncServer::Ptr create(const Glib::RefPtr<Gio::File> & path, Preferences & prefs);
- static SyncServer::Ptr create(const Glib::RefPtr<Gio::File> & path, const Glib::ustring & client_id);
+ FileSystemSyncServer(const Glib::RefPtr<Gio::File> & path, const Glib::ustring & client_id);
virtual bool begin_sync_transaction() override;
virtual bool commit_sync_transaction() override;
virtual bool cancel_sync_transaction() override;
@@ -48,7 +48,6 @@ public:
virtual Glib::ustring id() override;
virtual bool updates_available_since(int revision) override;
private:
- FileSystemSyncServer(const Glib::RefPtr<Gio::File> & path, const Glib::ustring & client_id);
void common_ctor();
Glib::RefPtr<Gio::File> get_revision_dir_path(int rev);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]