aboutsummaryrefslogtreecommitdiff
path: root/src/sound-service-dbus.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-04-04 06:02:19 -0400
committerBazaar Package Importer <james.westby@ubuntu.com>2011-04-04 06:02:19 -0400
commit0421dfae64f2f408ac0f764c4eb6117a33fecc3b (patch)
tree089b0c61ec13d8bb4357a1801796a9eb1fac8608 /src/sound-service-dbus.c
parentc5689e204992c8d821bfdeb14560f279784b6ca3 (diff)
parent1f8270d3e11c19c6b3068ebfc151a258dcf83ef1 (diff)
downloadayatana-indicator-sound-0421dfae64f2f408ac0f764c4eb6117a33fecc3b.tar.gz
ayatana-indicator-sound-0421dfae64f2f408ac0f764c4eb6117a33fecc3b.tar.bz2
ayatana-indicator-sound-0421dfae64f2f408ac0f764c4eb6117a33fecc3b.zip
* New upstream release.
- Fix crash with SIGABRT (LP: #738051) (LP: #744304) - ensure that if the service crashes the indicator will not show multiple sliders
Diffstat (limited to 'src/sound-service-dbus.c')
-rw-r--r--src/sound-service-dbus.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c
index 1b9d29e..a22e648 100644
--- a/src/sound-service-dbus.c
+++ b/src/sound-service-dbus.c
@@ -164,13 +164,10 @@ sound_service_dbus_build_sound_menu ( SoundServiceDbus* self,
{
SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self);
- // Mute button
- // TODO this additions should be fixed position, i.e. add via position and not just append
- // be explicit as it is fixed.
- dbusmenu_menuitem_child_append (priv->root_menuitem, mute_item);
- dbusmenu_menuitem_child_append (priv->root_menuitem, slider_item);
- g_debug ("just about to add the slider %i", DBUSMENU_IS_MENUITEM(slider_item));
- dbusmenu_menuitem_child_append (priv->root_menuitem, voip_input_menu_item);
+ // Mute, Volume and Voip widgets
+ dbusmenu_menuitem_child_add_position (priv->root_menuitem, mute_item, 0);
+ dbusmenu_menuitem_child_add_position (priv->root_menuitem, slider_item, 1);
+ dbusmenu_menuitem_child_add_position (priv->root_menuitem, voip_input_menu_item, 2);
// Separator
DbusmenuMenuitem* separator = dbusmenu_menuitem_new();
@@ -178,7 +175,7 @@ sound_service_dbus_build_sound_menu ( SoundServiceDbus* self,
dbusmenu_menuitem_property_set (separator,
DBUSMENU_MENUITEM_PROP_TYPE,
DBUSMENU_CLIENT_TYPES_SEPARATOR);
- dbusmenu_menuitem_child_append(priv->root_menuitem, separator);
+ dbusmenu_menuitem_child_add_position (priv->root_menuitem, separator, 3);
g_object_unref (separator);
// Sound preferences dialog
@@ -237,6 +234,13 @@ sound_service_dbus_update_sound_state (SoundServiceDbus* self,
GError * error = NULL;
+ if (priv->connection == NULL ||
+ g_dbus_connection_is_closed (priv->connection) == TRUE){
+ g_critical ("sound_service_dbus_update_sound_state - connection is %s !!",
+ priv->connection == NULL? "NULL" : "closed");
+ return;
+ }
+
g_debug ("emitting state signal with value %i", (int)new_state);
g_dbus_connection_emit_signal( priv->connection,
NULL,
@@ -246,9 +250,8 @@ sound_service_dbus_update_sound_state (SoundServiceDbus* self,
v_output,
&error );
if (error != NULL) {
- g_error("Unable to emit signal 'sinkinputwhilemuted' because : %s", error->message);
+ g_critical ("Unable to emit signal because : %s", error->message);
g_error_free(error);
- return;
}
}