diff options
author | Arthur Mello <arthur.mello@canonical.com> | 2016-06-24 11:45:30 -0300 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-08-29 14:37:39 +0200 |
commit | c5c092a25f41e3cfb8dc3b3578c5c40ecd6c0dd7 (patch) | |
tree | c97c16cbc726594e80326c6d1444173d1e08e22b /src/settings-live.cpp | |
parent | 686579f67c368512ac36267dd5bd13eff2a0abb5 (diff) | |
download | ayatana-indicator-datetime-c5c092a25f41e3cfb8dc3b3578c5c40ecd6c0dd7.tar.gz ayatana-indicator-datetime-c5c092a25f41e3cfb8dc3b3578c5c40ecd6c0dd7.tar.bz2 ayatana-indicator-datetime-c5c092a25f41e3cfb8dc3b3578c5c40ecd6c0dd7.zip |
Do not fail tests if schema is not installed
Diffstat (limited to 'src/settings-live.cpp')
-rw-r--r-- | src/settings-live.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/settings-live.cpp b/src/settings-live.cpp index 39d8e18..17c0ef7 100644 --- a/src/settings-live.cpp +++ b/src/settings-live.cpp @@ -38,14 +38,20 @@ LiveSettings::~LiveSettings() g_clear_object(&m_settings); } -LiveSettings::LiveSettings(): m_settings(g_settings_new(SETTINGS_INTERFACE)) +LiveSettings::LiveSettings(): m_settings(g_settings_new(SETTINGS_INTERFACE)), m_gsettings_cal_notification(NULL) { g_signal_connect (m_settings, "changed", G_CALLBACK(on_changed_ccid), this); if (ayatana_common_utils_is_lomiri()) { - m_settings_cal_notification = g_settings_new_with_path(SETTINGS_NOTIFY_SCHEMA_ID, SETTINGS_NOTIFY_CALENDAR_PATH); - g_signal_connect (m_settings_cal_notification, "changed", G_CALLBACK(on_changed_cal_notification), this); + GSettingsSchemaSource *source = g_settings_schema_source_get_default(); + if (g_settings_schema_source_lookup(source, SETTINGS_NOTIFY_SCHEMA_ID, true)) { + m_gsettings_cal_notification = g_settings_new_with_path(SETTINGS_NOTIFY_SCHEMA_ID, SETTINGS_NOTIFY_CALENDAR_PATH); + } + + if (m_gsettings_cal_notification) { + g_signal_connect (m_settings_cal_notification, "changed", G_CALLBACK(on_changed_cal_notification), this); + } } // init the Properties from the GSettings backend |