[gnote] Reuse new signals from Preferences
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Reuse new signals from Preferences
- Date: Sun, 13 Dec 2020 11:56:55 +0000 (UTC)
commit b0e44d14adde2871fccc1a5c2c4a6ea2408db674
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Dec 13 13:56:05 2020 +0200
Reuse new signals from Preferences
src/synchronization/syncmanager.cpp | 12 ++----------
src/synchronization/syncmanager.hpp | 1 -
2 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/src/synchronization/syncmanager.cpp b/src/synchronization/syncmanager.cpp
index f92faa8c..60300cfd 100644
--- a/src/synchronization/syncmanager.cpp
+++ b/src/synchronization/syncmanager.cpp
@@ -84,7 +84,8 @@ namespace sync {
{
try {
NoteManager & manager(dynamic_cast<NoteManager&>(note_mgr()));
- m_gnote.preferences().schema_sync()->signal_changed().connect(sigc::mem_fun(*this,
&SyncManager::preferences_setting_changed));
+ m_gnote.preferences().signal_sync_selected_service_addin_changed.connect(sigc::mem_fun(*this,
&SyncManager::update_sync_action));
+ m_gnote.preferences().signal_sync_autosync_timeout_changed.connect(sigc::mem_fun(*this,
&SyncManager::update_sync_action));
manager.signal_note_saved.connect(sigc::mem_fun(*this, &SyncManager::handle_note_saved_or_deleted));
manager.signal_note_deleted.connect(sigc::mem_fun(*this, &SyncManager::handle_note_saved_or_deleted));
manager.signal_note_buffer_changed.connect(sigc::mem_fun(*this,
&SyncManager::handle_note_buffer_changed));
@@ -416,15 +417,6 @@ namespace sync {
}
- void SyncManager::preferences_setting_changed(const Glib::ustring & key)
- {
- if(key == Preferences::SYNC_SELECTED_SERVICE_ADDIN || key == Preferences::SYNC_AUTOSYNC_TIMEOUT) {
- // Update sync item based on configuration.
- update_sync_action();
- }
- }
-
-
void SyncManager::update_sync_action()
{
Glib::ustring sync_addin_id = m_gnote.preferences().sync_selected_service_addin();
diff --git a/src/synchronization/syncmanager.hpp b/src/synchronization/syncmanager.hpp
index 1cf91494..142adcf9 100644
--- a/src/synchronization/syncmanager.hpp
+++ b/src/synchronization/syncmanager.hpp
@@ -77,7 +77,6 @@ namespace sync {
private:
void handle_note_saved_or_deleted(const NoteBase::Ptr & note);
void handle_note_buffer_changed(const NoteBase::Ptr & note);
- void preferences_setting_changed(const Glib::ustring & key);
void update_sync_action();
void background_sync_checker();
void set_state(SyncState new_state);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]