diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2012-02-14 19:29:13 +0100 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2012-02-14 19:29:13 +0100 |
commit | 302256286a5e443a67592b7addd02c0633531cfc (patch) | |
tree | 1623ee0440ce55bbfe49ea420363dd32d1833522 /src/sound-state-manager.c | |
parent | c157f744805b87d39eb49ee162645d9af25b05b5 (diff) | |
parent | bd884a0a4b3a64c2f8d6757a0598993ee9297eef (diff) | |
download | ayatana-indicator-sound-302256286a5e443a67592b7addd02c0633531cfc.tar.gz ayatana-indicator-sound-302256286a5e443a67592b7addd02c0633531cfc.tar.bz2 ayatana-indicator-sound-302256286a5e443a67592b7addd02c0633531cfc.zip |
Import upstream version 0.8.1.0
Diffstat (limited to 'src/sound-state-manager.c')
-rw-r--r-- | src/sound-state-manager.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/sound-state-manager.c b/src/sound-state-manager.c index c851407..c6b14ca 100644 --- a/src/sound-state-manager.c +++ b/src/sound-state-manager.c @@ -78,10 +78,8 @@ sound_state_manager_init (SoundStateManager* self) priv->notification = NULL; priv->settings_manager = NULL; - priv->settings_manager = g_settings_new("com.canonical.indicators.sound"); + priv->settings_manager = g_settings_new("com.canonical.indicator.sound"); - sound_state_manager_notification_init (self); - sound_state_manager_prepare_state_image_names (self); sound_state_manager_prepare_blocked_animation (self); @@ -134,6 +132,13 @@ sound_state_manager_class_init (SoundStateManagerClass *klass) static void sound_state_manager_notification_init (SoundStateManager* self) { + static gboolean initialized = FALSE; + + /* one-time lazy initialization */ + if (initialized) + return; + initialized = TRUE; + SoundStateManagerPrivate* priv = SOUND_STATE_MANAGER_GET_PRIVATE(self); if (!notify_init(PACKAGE_NAME)) @@ -164,6 +169,8 @@ sound_state_manager_show_notification (SoundStateManager *self, { SoundStateManagerPrivate* priv = SOUND_STATE_MANAGER_GET_PRIVATE(self); + sound_state_manager_notification_init (self); + if (priv->notification == NULL || g_settings_get_boolean (priv->settings_manager, "show-notify-osd-on-scroll") == FALSE){ return; |