[gnote: 13/21] Make SyncManager more testable
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote: 13/21] Make SyncManager more testable
- Date: Tue, 20 Jun 2017 20:16:00 +0000 (UTC)
commit 101fb9ede719d5a793742d7cca4edb11dfb0f273
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sat Apr 22 19:18:08 2017 +0300
Make SyncManager more testable
src/synchronization/syncmanager.cpp | 8 +++++++-
src/synchronization/syncmanager.hpp | 3 ++-
2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/synchronization/syncmanager.cpp b/src/synchronization/syncmanager.cpp
index 7232908..31f8f2b 100644
--- a/src/synchronization/syncmanager.cpp
+++ b/src/synchronization/syncmanager.cpp
@@ -285,7 +285,7 @@ namespace sync {
// delegate to run in the main gtk thread.
// To be consistent, any exceptions in the delgate will be caught
// and then rethrown in the synchronization thread.
- utils::main_context_call([this, server]() { delete_notes(server); });
+ delete_notes_in_main_thread(server);
// TODO: Add following updates to syncDialog treeview
@@ -678,6 +678,12 @@ namespace sync {
}
+ void SyncManager::delete_notes_in_main_thread(const SyncServer::Ptr & server)
+ {
+ utils::main_context_call([this, server]() { delete_notes(server); });
+ }
+
+
void SyncManager::delete_notes(const SyncServer::Ptr & server)
{
try {
diff --git a/src/synchronization/syncmanager.hpp b/src/synchronization/syncmanager.hpp
index 9d751fa..ca55be2 100644
--- a/src/synchronization/syncmanager.hpp
+++ b/src/synchronization/syncmanager.hpp
@@ -56,6 +56,8 @@ namespace sync {
virtual void connect_system_signals();
virtual SyncServiceAddin *get_sync_service_addin(const Glib::ustring & sync_service_id);
virtual SyncServiceAddin *get_configured_sync_service();
+ virtual void delete_notes_in_main_thread(const SyncServer::Ptr & server);
+ void delete_notes(const SyncServer::Ptr & server);
SyncClient::Ptr m_client;
SyncUI::Ptr m_sync_ui;
@@ -78,7 +80,6 @@ namespace sync {
NoteBase::Ptr find_note_by_uuid(const Glib::ustring & uuid);
NoteManagerBase & note_mgr();
void get_synchronized_xml_bits(const Glib::ustring & noteXml, Glib::ustring & title, Glib::ustring &
tags, Glib::ustring & content);
- void delete_notes(const SyncServer::Ptr & server);
void create_note(const NoteUpdate & noteUpdate);
void update_note(const Note::Ptr & existingNote, const NoteUpdate & noteUpdate);
void delete_note(const Note::Ptr & existingNote);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]