Commit b5853121 authored by Christophe Mutricy's avatar Christophe Mutricy

Fix loading of the VLC icon

Both in installed and non-installed mode
parent 5ae2d471
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <vlc_playlist.h> #include <vlc_playlist.h>
#include <vlc_url.h> #include <vlc_url.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixbuf.h>
#include <libnotify/notify.h> #include <libnotify/notify.h>
...@@ -224,15 +225,23 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var, ...@@ -224,15 +225,23 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
} }
else /* else we show state-of-the art logo */ else /* else we show state-of-the art logo */
{ {
GError *p_error = NULL; /* First try to get an icon from the current theme. */
char *psz_pixbuf; GtkIconTheme* p_theme = gtk_icon_theme_get_default();
char *psz_data = config_GetDataDir( p_this ); pix = gtk_icon_theme_load_icon( p_theme, "vlc", 72, 0, NULL);
if( asprintf( &psz_pixbuf, "%s/vlc48x48.png", psz_data ) >= 0 )
if( !pix )
{ {
pix = gdk_pixbuf_new_from_file( psz_pixbuf, &p_error ); /* Load icon from share/ */
free( psz_pixbuf ); GError *p_error = NULL;
char *psz_pixbuf;
char *psz_data = config_GetDataDir( p_this );
if( asprintf( &psz_pixbuf, "%s/icons/48x48/vlc.png", psz_data ) >= 0 )
{
pix = gdk_pixbuf_new_from_file( psz_pixbuf, &p_error );
free( psz_pixbuf );
}
free( psz_data );
} }
free( psz_data );
} }
free( psz_arturl ); free( psz_arturl );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment