aboutsummaryrefslogtreecommitdiff
path: root/src/metadata-widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/metadata-widget.c')
-rw-r--r--src/metadata-widget.c42
1 files changed, 36 insertions, 6 deletions
diff --git a/src/metadata-widget.c b/src/metadata-widget.c
index 96d55ab..a3383df 100644
--- a/src/metadata-widget.c
+++ b/src/metadata-widget.c
@@ -127,9 +127,19 @@ metadata_widget_init (MetadataWidget *self)
GtkWidget *hbox;
GtkWidget *outer_v_box;
priv->icon_buf = NULL;
-
- outer_v_box = gtk_vbox_new (FALSE, 0);
+
+ #if GTK_CHECK_VERSION(3, 0, 0)
+ outer_v_box = gtk_box_new (FALSE, 0);
+ #else
+ outer_v_box = gtk_vbox_new (FALSE, 0);
+ #endif
+
+ #if GTK_CHECK_VERSION(3, 0, 0)
+ hbox = gtk_box_new(FALSE, 0);
+ #else
hbox = gtk_hbox_new(FALSE, 0);
+ #endif
+
priv->meta_data_h_box = hbox;
priv->current_height = 1;
@@ -162,7 +172,13 @@ metadata_widget_init (MetadataWidget *self)
FALSE,
1);
priv->theme_change_occured = FALSE;
+
+ #if GTK_CHECK_VERSION(3, 0, 0)
+ GtkWidget* vbox = gtk_box_new(FALSE, 0);
+ #else
GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
+ #endif
+
// artist
GtkWidget* artist;
@@ -235,7 +251,12 @@ metadata_widget_dispose (GObject *object)
MetadataWidgetPrivate * priv = METADATA_WIDGET_GET_PRIVATE(METADATA_WIDGET(object));
if (priv->icon_buf != NULL){
- gdk_pixbuf_unref(priv->icon_buf);
+ #if GTK_CHECK_VERSION(3, 0, 0)
+ g_object_unref(priv->icon_buf);
+ #else
+ gdk_pixbuf_unref(priv->icon_buf);
+ #endif
+ priv->icon_buf = NULL;
}
G_OBJECT_CLASS (metadata_widget_parent_class)->dispose (object);
}
@@ -243,6 +264,10 @@ metadata_widget_dispose (GObject *object)
static void
metadata_widget_finalize (GObject *object)
{
+ MetadataWidgetPrivate * priv = METADATA_WIDGET_GET_PRIVATE(METADATA_WIDGET(object));
+ g_string_free (priv->image_path, TRUE);
+ g_string_free (priv->old_image_path, TRUE);
+
G_OBJECT_CLASS (metadata_widget_parent_class)->finalize (object);
}
@@ -756,7 +781,11 @@ metadata_widget_set_icon (MetadataWidget *self)
MetadataWidgetPrivate * priv = METADATA_WIDGET_GET_PRIVATE(self);
if (priv->icon_buf != NULL){
- gdk_pixbuf_unref(priv->icon_buf);
+ #if GTK_CHECK_VERSION(3, 0, 0)
+ g_object_unref(priv->icon_buf);
+ #else
+ gdk_pixbuf_unref(priv->icon_buf);
+ #endif
priv->icon_buf = NULL;
}
@@ -766,8 +795,9 @@ metadata_widget_set_icon (MetadataWidget *self)
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height);
GString* banshee_string = g_string_new ( "banshee" );
- GString* app_panel = g_string_new ( g_utf8_strdown (dbusmenu_menuitem_property_get(priv->twin_item, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME),
- -1));
+ gchar * tmp = g_utf8_strdown (dbusmenu_menuitem_property_get(priv->twin_item, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME), -1);
+ GString* app_panel = g_string_new (tmp);
+ g_free (tmp);
GdkPixbuf* icon_buf;
// Banshee Special case!