diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-01-10 16:47:20 -0600 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-01-10 16:47:20 -0600 |
commit | 9452f0262c608fc1ee6509078b3538f68b5f0993 (patch) | |
tree | a044942081f6ed5ed2d4035e524f942c209d99ed /src | |
parent | b3a4d53a7f9433c1bd13ae89697ea06a8ce44e50 (diff) | |
download | ayatana-indicator-sound-9452f0262c608fc1ee6509078b3538f68b5f0993.tar.gz ayatana-indicator-sound-9452f0262c608fc1ee6509078b3538f68b5f0993.tar.bz2 ayatana-indicator-sound-9452f0262c608fc1ee6509078b3538f68b5f0993.zip |
now building
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/dbus-menu-manager.c | 11 | ||||
-rw-r--r-- | src/sound-service-dbus.c | 17 |
3 files changed, 13 insertions, 17 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 0443029..99a00c0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -93,6 +93,8 @@ indicator_sound_service_SOURCES = \ sound-service-dbus.c \ slider-menu-item.h \ slider-menu-item.c \ + gen-sound-service.xml.h \ + gen-sound-service.xml.c \ $(music_bridge_VALASOURCES:.vala=.c) indicator_sound_service_CFLAGS = $(PULSEAUDIO_CFLAGS) $(SOUNDSERVICE_CFLAGS) $(GCONF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall diff --git a/src/dbus-menu-manager.c b/src/dbus-menu-manager.c index f92c324..e51db0d 100644 --- a/src/dbus-menu-manager.c +++ b/src/dbus-menu-manager.c @@ -21,9 +21,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <unistd.h> #include <glib/gi18n.h> -#include <dbus/dbus-glib.h> -#include <dbus/dbus-glib-bindings.h> - #include <libdbusmenu-glib/server.h> #include <libdbusmenu-glib/client.h> @@ -79,10 +76,10 @@ DbusmenuMenuitem* dbus_menu_manager_setup() void dbus_menu_manager_update_volume(gdouble volume) { - GValue value = {0}; - g_value_init(&value, G_TYPE_DOUBLE); - g_value_set_double(&value, volume); - dbusmenu_menuitem_property_set_value(DBUSMENU_MENUITEM(volume_slider_menuitem), DBUSMENU_VOLUME_MENUITEM_LEVEL, &value); + GVariant* new_volume = g_variant_new_double(volume); + dbusmenu_menuitem_property_set_variant(DBUSMENU_MENUITEM(volume_slider_menuitem), + DBUSMENU_VOLUME_MENUITEM_LEVEL, + new_volume); } diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 987ce7c..8e0f31a 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -23,6 +23,7 @@ #endif #include <gio/gio.h> +#include <libindicator/indicator-service.h> #include "gen-sound-service.xml.h" #include "dbus-shared-names.h" #include "sound-service-dbus.h" @@ -105,11 +106,10 @@ sound_service_dbus_init (SoundServiceDbus *self) priv->sink_availability = FALSE; /* Fetch the session bus */ - priv->connection = g_bus_get_sync (DBUS_BUS_SESSION, NULL, &error); + 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("sound-service-dbus:Unable to connect to the session bus when creating indicator sound service : %s", error->message); g_error_free(error); return; } @@ -154,19 +154,16 @@ bus_method_call (GDBusConnection * connection, GDBusMethodInvocation * invocation, gpointer user_data) { - IndicatorService * service = INDICATOR_SERVICE(user_data); + IndicatorService* service = INDICATOR_SERVICE(user_data); GVariant * retval = NULL; + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (service); if (g_strcmp0(method, "GetSinkMute") == 0) { - SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (self); - g_debug("Get sink mute - sound service dbus!, - about to send over mute_value of %i", priv->mute); + g_debug("Get sink mute - sound service dbus!,about to send over mute_value of %i", priv->mute); retval = g_variant_new_boolean (priv->mute); } else if (g_strcmp0(method, "GetSinkAvailability") == 0) { - SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (self); - g_debug("Get sink availability - sound service dbus!, - about to send over availability_value of %i", priv->sink_availability); + g_debug("Get sink availability - sound service dbus!, about to send over availability_value of %i", priv->sink_availability); retval = g_variant_new_boolean (priv->sink_availability); } else { |