aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-03-16 10:59:17 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-03-16 10:59:17 -0500
commit324a229148cc6c7daedbfebccc01250615604ce7 (patch)
tree5ecfd9806b7b064b2a8c47ecd900a4931af7f475
parentbb95a845666552095ee043094cc890f64294b299 (diff)
parent380631efc3397de66c9ac8309c69802c4e04195d (diff)
downloadayatana-indicator-sound-324a229148cc6c7daedbfebccc01250615604ce7.tar.gz
ayatana-indicator-sound-324a229148cc6c7daedbfebccc01250615604ce7.tar.bz2
ayatana-indicator-sound-324a229148cc6c7daedbfebccc01250615604ce7.zip
don't abort isound via g_error() if it can't connect to the bus. lp:~cjcurran/indicator-sound/use_g_critical_instead_of_g_error
-rw-r--r--src/indicator-sound.c8
-rw-r--r--src/sound-service-dbus.c17
2 files changed, 12 insertions, 13 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 243e759..272c8da 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -299,8 +299,8 @@ connection_changed (IndicatorServiceManager * sm,
node_info = g_dbus_node_info_new_for_xml ( _sound_service,
&error );
if (error != NULL) {
- g_warning( "Failed to get create interface info from xml: %s",
- error->message );
+ g_critical ( "Failed to get create interface info from xml: %s",
+ error->message );
g_error_free(error);
return;
}
@@ -310,7 +310,7 @@ connection_changed (IndicatorServiceManager * sm,
interface_info = g_dbus_node_info_lookup_interface (node_info,
INDICATOR_SOUND_DBUS_INTERFACE);
if (interface_info == NULL) {
- g_error("Unable to find interface '" INDICATOR_SOUND_DBUS_INTERFACE "'");
+ g_critical ("Unable to find interface '" INDICATOR_SOUND_DBUS_INTERFACE "'");
}
}
@@ -339,7 +339,7 @@ static void create_connection_to_service (GObject *source_object,
priv->dbus_proxy = g_dbus_proxy_new_finish(res, &error);
if (error != NULL) {
- g_warning("Failed to get dbus proxy: %s", error->message);
+ g_critical ("Failed to get dbus proxy: %s", error->message);
g_error_free(error);
return;
}
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c
index 07d3d6f..7cad2bc 100644
--- a/src/sound-service-dbus.c
+++ b/src/sound-service-dbus.c
@@ -107,7 +107,7 @@ sound_service_dbus_class_init (SoundServiceDbusClass *klass)
node_info = g_dbus_node_info_new_for_xml(_sound_service, &error);
if (error != NULL) {
- g_error("Unable to parse Indicator Service Interface description: %s",
+ g_critical ("Unable to parse Indicator Service Interface description: %s",
error->message);
g_error_free(error);
}
@@ -118,7 +118,7 @@ sound_service_dbus_class_init (SoundServiceDbusClass *klass)
INDICATOR_SOUND_DBUS_INTERFACE);
if (interface_info == NULL) {
- g_error("Unable to find interface '" INDICATOR_SOUND_DBUS_INTERFACE "'");
+ g_critical("Unable to find interface '" INDICATOR_SOUND_DBUS_INTERFACE "'");
}
}
signals[TRACK_SPECIFIC_ITEM] = g_signal_new("track-specific-item-requested",
@@ -151,8 +151,8 @@ sound_service_dbus_init (SoundServiceDbus *self)
priv->connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
if (error != NULL) {
- g_error("sound-service-dbus:Unable to connect to the session bus when creating indicator sound service : %s", error->message);
- g_error_free(error);
+ g_critical ("sound-service-dbus:Unable to connect to the session bus when creating indicator sound service : %s", error->message);
+ g_error_free (error);
return;
}
/* register the service on it */
@@ -164,9 +164,8 @@ sound_service_dbus_init (SoundServiceDbus *self)
NULL,
&error);
if (error != NULL) {
- g_error("Unable to register the object to DBus: %s", error->message);
- g_error_free(error);
- return;
+ g_critical ("Unable to register the sound service on DBus: %s", error->message);
+ g_error_free (error);
}
}
@@ -275,12 +274,12 @@ sound_service_dbus_update_sound_state (SoundServiceDbus* self,
if (priv->connection == NULL ||
g_dbus_connection_is_closed (priv->connection) == TRUE){
- g_critical ("sound_service_dbus_update_sound_state - connection is %s !!",
+ g_critical ("sound_service_dbus_update_sound_state - dbus connection is %s !!",
priv->connection == NULL? "NULL" : "closed");
return;
}
- g_debug ("emitting state signal with value %i", (int)new_state);
+ //g_debug ("emitting state signal with value %i", (int)new_state);
g_dbus_connection_emit_signal( priv->connection,
NULL,
INDICATOR_SOUND_SERVICE_DBUS_OBJECT_PATH,