diff options
author | H.Habighorst <tearofadragon@googlemail.com> | 2009-08-23 20:31:14 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-23 20:31:14 +0800 |
commit | ff7084ffe4a935a4cfafc9cd44a9b9daf43cb976 (patch) | |
tree | 12165a7c8893a318994897c4899f68c653c11882 /calendar/gui | |
parent | 8443ed41e32438e22e862d5645117cfdb2f03cc9 (diff) | |
download | gsoc2013-evolution-ff7084ffe4a935a4cfafc9cd44a9b9daf43cb976.tar gsoc2013-evolution-ff7084ffe4a935a4cfafc9cd44a9b9daf43cb976.tar.gz gsoc2013-evolution-ff7084ffe4a935a4cfafc9cd44a9b9daf43cb976.tar.bz2 gsoc2013-evolution-ff7084ffe4a935a4cfafc9cd44a9b9daf43cb976.tar.lz gsoc2013-evolution-ff7084ffe4a935a4cfafc9cd44a9b9daf43cb976.tar.xz gsoc2013-evolution-ff7084ffe4a935a4cfafc9cd44a9b9daf43cb976.tar.zst gsoc2013-evolution-ff7084ffe4a935a4cfafc9cd44a9b9daf43cb976.zip |
Bug 571488 - Migrate from deprecated gnome_sound to libcanberra
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/alarm-notify/Makefile.am | 6 | ||||
-rw-r--r-- | calendar/gui/alarm-notify/alarm-queue.c | 16 | ||||
-rw-r--r-- | calendar/gui/alarm-notify/notify-main.c | 6 |
3 files changed, 17 insertions, 11 deletions
diff --git a/calendar/gui/alarm-notify/Makefile.am b/calendar/gui/alarm-notify/Makefile.am index 680c5e95e5..ea1c36e0d9 100644 --- a/calendar/gui/alarm-notify/Makefile.am +++ b/calendar/gui/alarm-notify/Makefile.am @@ -25,7 +25,8 @@ AM_CPPFLAGS = \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DEVOLUTION_LIBEXECDIR=\""$(privlibexecdir)"\" \ - $(EVOLUTION_CALENDAR_CFLAGS) + $(EVOLUTION_CALENDAR_CFLAGS) \ + $(CANBERRA_CFLAGS) glade_DATA = \ alarm-notify.glade @@ -51,7 +52,8 @@ evolution_alarm_notify_LDADD = \ $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/calendar/common/libevolution-calendarprivate.la \ $(CAMEL_LIBS) \ - $(EVOLUTION_CALENDAR_LIBS) + $(EVOLUTION_CALENDAR_LIBS) \ + $(CANBERRA_LIBS) if OS_WIN32 evolution_alarm_notify_LDFLAGS = -mwindows diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 1aaca186ca..8d272764bd 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -34,7 +34,7 @@ #include <bonobo/bonobo-main.h> #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libgnome/gnome-sound.h> +#include <canberra-gtk.h> #include <libecal/e-cal-time-util.h> #include <libecal/e-cal-component.h> @@ -1641,13 +1641,23 @@ audio_notification (time_t trigger, CompQueuedAlarms *cqa, if (attach && icalattach_get_is_url (attach)) { const gchar *url; + gchar *filename; + GError *error = NULL; url = icalattach_get_url (attach); + filename = g_filename_from_uri (url, NULL, &error); - if (url && *url && g_file_test (url, G_FILE_TEST_EXISTS)) { + if (error != NULL) { + g_warning ("%s", error->message); + g_error_free (error); + } else if (g_file_test (filename, G_FILE_TEST_EXISTS)) { flag = 1; - gnome_sound_play (url); /* this sucks */ + ca_context_play ( + ca_gtk_context_get(), 0, + CA_PROP_MEDIA_FILENAME, filename, NULL); } + + g_free (filename); } if (!flag) diff --git a/calendar/gui/alarm-notify/notify-main.c b/calendar/gui/alarm-notify/notify-main.c index 887adaa1d5..b3ff0db6a5 100644 --- a/calendar/gui/alarm-notify/notify-main.c +++ b/calendar/gui/alarm-notify/notify-main.c @@ -31,7 +31,6 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> #include <libgnome/gnome-init.h> -#include <libgnome/gnome-sound.h> #include <libgnomeui/gnome-client.h> #include <libgnomeui/gnome-ui-init.h> #include <glade/glade.h> @@ -48,8 +47,6 @@ #include "config-data.h" #include <camel/camel-object.h> - - static BonoboGenericFactory *factory; static AlarmNotify *alarm_notify_service = NULL; @@ -142,8 +139,6 @@ main (gint argc, gchar **argv) glade_init (); - gnome_sound_init ("localhost"); - e_icon_factory_init (); init_alarm_service (NULL); @@ -173,7 +168,6 @@ main (gint argc, gchar **argv) alarm_done (); e_passwords_shutdown (); - gnome_sound_shutdown (); return 0; } |