diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2015-01-21 15:07:29 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2015-01-21 15:07:29 -0600 |
commit | 9feba7c10f246f0341829f76a7d6f46867d25103 (patch) | |
tree | 23ea003fd51b2adb07ce062ad50db30d42b9d7ee /src/snap.cpp | |
parent | d82ebaccf5bc926854167f45b7057ed921bb9f71 (diff) | |
download | ayatana-indicator-datetime-9feba7c10f246f0341829f76a7d6f46867d25103.tar.gz ayatana-indicator-datetime-9feba7c10f246f0341829f76a7d6f46867d25103.tar.bz2 ayatana-indicator-datetime-9feba7c10f246f0341829f76a7d6f46867d25103.zip |
in Snap, fix the code that checks AccountsService.Sound for Silent Mode
Diffstat (limited to 'src/snap.cpp')
-rw-r--r-- | src/snap.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/snap.cpp b/src/snap.cpp index e916eff..832ba1c 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -57,7 +57,7 @@ public: m_settings(settings), m_cancellable(g_cancellable_new()) { - auto object_path = g_strdup_printf("/org/freedesktop/Accounts/User/%lu", (gulong)getuid()); + auto object_path = g_strdup_printf("/org/freedesktop/Accounts/User%lu", (gulong)getuid()); accounts_service_sound_proxy_new_for_bus(G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES, "org.freedesktop.Accounts", @@ -91,11 +91,10 @@ public: // force the system to stay awake auto awake = std::make_shared<uin::Awake>(m_engine->app_name()); - // create the sound. // calendar events are muted in silent mode; alarm clocks never are std::shared_ptr<uin::Sound> sound; - g_message("silent_mode is %d", (int)silent_mode()); if (appointment.is_ubuntu_alarm() || !silent_mode()) { + // create the sound. const auto uri = get_alarm_uri(appointment, m_settings); const auto volume = m_settings->alarm_volume.get(); const bool loop = interactive; @@ -164,20 +163,20 @@ private: if (error != nullptr) { if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) - g_warning("%s Couldn't accounts service sound proxy: %s", G_STRLOC, error->message); + g_warning("%s Couldn't find accounts service sound proxy: %s", G_STRLOC, error->message); + + g_clear_error(&error); } else { static_cast<Impl*>(gself)->m_accounts_service_sound_proxy = accounts_service_sound_proxy; - g_message("got accounts sound service proxy"); } } bool silent_mode() const { - g_message("%s %s %p %d", G_STRLOC, G_STRFUNC, m_accounts_service_sound_proxy, (int)accounts_service_sound_get_silent_mode(m_accounts_service_sound_proxy)); return (m_accounts_service_sound_proxy != nullptr) - && (!accounts_service_sound_get_silent_mode(m_accounts_service_sound_proxy)); + && (accounts_service_sound_get_silent_mode(m_accounts_service_sound_proxy)); } std::string get_alarm_uri(const Appointment& appointment, |