[gnote: 9/21] Add ctor to SyncLockInfo that takes client id as arg



commit babc51a7d37363d6c939313f9f53503d96a13fbe
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Apr 9 16:59:17 2017 +0300

    Add ctor to SyncLockInfo that takes client id as arg

 src/synchronization/isyncmanager.cpp |    9 +++++++++
 src/synchronization/isyncmanager.hpp |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/synchronization/isyncmanager.cpp b/src/synchronization/isyncmanager.cpp
index 59fa070..c3a4134 100644
--- a/src/synchronization/isyncmanager.cpp
+++ b/src/synchronization/isyncmanager.cpp
@@ -36,6 +36,15 @@ SyncLockInfo::SyncLockInfo()
 {
 }
 
+SyncLockInfo::SyncLockInfo(const Glib::ustring & client)
+  : client_id(client)
+  , transaction_id(sharp::uuid().string())
+  , renew_count(0)
+  , duration(0, 2, 0) // default of 2 minutes
+  , revision(0)
+{
+}
+
 Glib::ustring SyncLockInfo::hash_string()
 {
   return Glib::ustring::compose("%1-%2-%3-%4-%5", transaction_id, client_id, renew_count, duration.string(), 
revision);
diff --git a/src/synchronization/isyncmanager.hpp b/src/synchronization/isyncmanager.hpp
index e14995c..ce61235 100644
--- a/src/synchronization/isyncmanager.hpp
+++ b/src/synchronization/isyncmanager.hpp
@@ -41,6 +41,7 @@ public:
   int revision;
 
   SyncLockInfo();
+  explicit SyncLockInfo(const Glib::ustring & client);
   Glib::ustring hash_string();
 };
 


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