[Xfce4-commits] <parole:bluesabre/gtk3> Remove rc file from notify plugin, prevent notification on pause and play.
Sean Davis
noreply at xfce.org
Sun Aug 11 15:17:04 CEST 2013
Updating branch refs/heads/bluesabre/gtk3
to 746de8b0ca1d6e1fb7f50a5538591684e0d2a2e2 (commit)
from f00499cdbec047f561d328bbc5d1eebd8b2d11f0 (commit)
commit 746de8b0ca1d6e1fb7f50a5538591684e0d2a2e2
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Tue Mar 5 19:01:03 2013 -0500
Remove rc file from notify plugin, prevent notification on pause and play.
src/plugins/notify/notify-provider.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/plugins/notify/notify-provider.c b/src/plugins/notify/notify-provider.c
index 3db76f9..cd6d7fc 100644
--- a/src/plugins/notify/notify-provider.c
+++ b/src/plugins/notify/notify-provider.c
@@ -31,8 +31,6 @@
#include "notify-provider.h"
-#define RESOURCE_FILE "xfce4/src/misc/parole-plugins/notify.rc"
-
static void notify_provider_iface_init (ParoleProviderPluginIface *iface);
static void notify_provider_finalize (GObject *object);
@@ -46,6 +44,7 @@ struct _NotifyProvider
{
GObject parent;
ParoleProviderPlayer *player;
+ gchar *last_played_uri;
NotifyNotification *notification;
};
@@ -85,7 +84,7 @@ notify_playing (NotifyProvider *notify, const ParoleStream *stream)
{
GdkPixbuf *pix;
gboolean has_video;
- gchar *title, *album, *artist, *year;
+ gchar *title, *album, *artist, *year, *uri;
gchar *message;
ParoleMediaType media_type;
@@ -95,11 +94,18 @@ notify_playing (NotifyProvider *notify, const ParoleStream *stream)
"artist", &artist,
"year", &year,
"has-video", &has_video,
- "media-type", &media_type,
+ "media-type", &media_type,
+ "uri", &uri,
NULL);
if ( has_video )
return;
+
+ if ( g_strcmp0(uri, notify->last_played_uri) == 0 )
+ return;
+
+ notify->last_played_uri = g_strdup(uri);
+ g_free(uri);
if ( !title )
{
More information about the Xfce4-commits
mailing list