aboutsummaryrefslogtreecommitdiff
path: root/src/metadata-widget.c
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2011-01-27 16:42:03 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2011-01-27 16:42:03 +0100
commit74888f5ce08b9f89ac0d62c8664a26628f098765 (patch)
treecd39c3c2752166e210666ec88e7cc85668d4e000 /src/metadata-widget.c
parentb0babf1fab9b3e74f32de4635dd9eed78cccfc62 (diff)
parent1529af0e1224f04616054095742b698d8814cec4 (diff)
downloadayatana-indicator-sound-74888f5ce08b9f89ac0d62c8664a26628f098765.tar.gz
ayatana-indicator-sound-74888f5ce08b9f89ac0d62c8664a26628f098765.tar.bz2
ayatana-indicator-sound-74888f5ce08b9f89ac0d62c8664a26628f098765.zip
Merge against new HEAD
Diffstat (limited to 'src/metadata-widget.c')
-rw-r--r--src/metadata-widget.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/metadata-widget.c b/src/metadata-widget.c
index 09365d5..a37053b 100644
--- a/src/metadata-widget.c
+++ b/src/metadata-widget.c
@@ -101,8 +101,7 @@ metadata_widget_init (MetadataWidget *self)
// image
priv->album_art = gtk_image_new();
- priv->image_path = g_string_new(dbusmenu_menuitem_property_get(priv->twin_item,
- DBUSMENU_METADATA_MENUITEM_ARTURL));
+ priv->image_path = g_string_new("");
priv->old_image_path = g_string_new("");
g_signal_connect(priv->album_art, "expose-event",
@@ -120,8 +119,7 @@ metadata_widget_init (MetadataWidget *self)
// artist
GtkWidget* artist;
- artist = gtk_label_new(dbusmenu_menuitem_property_get(priv->twin_item,
- DBUSMENU_METADATA_MENUITEM_ARTIST));
+ artist = gtk_label_new("");
gtk_misc_set_alignment(GTK_MISC(artist), (gfloat)0, (gfloat)0);
gtk_misc_set_padding (GTK_MISC(artist), (gfloat)10, (gfloat)0);
gtk_widget_set_size_request (artist, 140, 15);
@@ -131,8 +129,7 @@ metadata_widget_init (MetadataWidget *self)
// title
GtkWidget* piece;
- piece = gtk_label_new(dbusmenu_menuitem_property_get( priv->twin_item,
- DBUSMENU_METADATA_MENUITEM_TITLE) );
+ piece = gtk_label_new("");
gtk_misc_set_alignment(GTK_MISC(piece), (gfloat)0, (gfloat)0);
gtk_misc_set_padding (GTK_MISC(piece), (gfloat)10, (gfloat)-5);
gtk_widget_set_size_request (piece, 140, 15);
@@ -142,8 +139,7 @@ metadata_widget_init (MetadataWidget *self)
// container
GtkWidget* container;
- container = gtk_label_new(dbusmenu_menuitem_property_get( priv->twin_item,
- DBUSMENU_METADATA_MENUITEM_ALBUM) );
+ container = gtk_label_new("");
gtk_misc_set_alignment(GTK_MISC(container), (gfloat)0, (gfloat)0);
gtk_misc_set_padding (GTK_MISC(container), (gfloat)10, (gfloat)0);
gtk_widget_set_size_request (container, 140, 15);
@@ -397,7 +393,6 @@ metadata_widget_button_press_event (GtkWidget *menuitem,
return FALSE;
}
-// TODO: Manage empty/mangled music details <unknown artist> etc.
static void
metadata_widget_property_update(DbusmenuMenuitem* item, gchar* property,
GVariant* value, gpointer userdata)
@@ -480,16 +475,18 @@ metadata_widget_set_twin_item(MetadataWidget* self,
metadata_widget_style_labels( self, GTK_LABEL(priv->artist_label));
g_string_erase(priv->image_path, 0, -1);
- g_string_overwrite( priv->image_path,
- 0,
- dbusmenu_menuitem_property_get( priv->twin_item,
- DBUSMENU_METADATA_MENUITEM_ARTURL ));
+ const gchar *arturl = dbusmenu_menuitem_property_get( priv->twin_item,
+ DBUSMENU_METADATA_MENUITEM_ARTURL );
+ if (arturl != NULL){
+ g_string_overwrite( priv->image_path,
+ 0,
+ arturl);
- // if its a remote image queue a redraw incase the download took too long
- if (g_str_has_prefix (dbusmenu_menuitem_property_get (priv->twin_item, DBUSMENU_METADATA_MENUITEM_ARTURL ),
- g_get_user_cache_dir())){
- gtk_widget_queue_draw(GTK_WIDGET(self));
- }
+ // if its a remote image queue a redraw incase the download took too long
+ if (g_str_has_prefix (arturl, g_get_user_cache_dir())){
+ gtk_widget_queue_draw(GTK_WIDGET(self));
+ }
+ }
}
/**