# HG changeset patch
# User nenolod
# Date 1137455933 28800
# Node ID 00afc39b0754bab1dcecd96ce905667b9b702035
# Parent  dd84f79979b4e3f0f39a9a2cf5dbe1f176ea0293
[svn] Use g_object_(get|set)_data() on the thumbnail object to store the skin
path. (This is probably considered hackish by some, but hey, it works
:D)

diff -r dd84f79979b4 -r 00afc39b0754 audacious/skinwin.c
--- a/audacious/skinwin.c	Mon Jan 16 15:21:41 2006 -0800
+++ b/audacious/skinwin.c	Mon Jan 16 15:58:53 2006 -0800
@@ -288,6 +288,8 @@
         gtk_list_store_set(store, &iter,
                            SKIN_VIEW_COL_PREVIEW, thumbnail,
                            SKIN_VIEW_COL_NAME, name, -1);
+	g_object_set_data(G_OBJECT(thumbnail), "skinpath", 
+		SKIN_NODE(entry->data)->name);
         g_object_unref(thumbnail);
 
         if (g_strstr_len(bmp_active_skin->path,
@@ -317,24 +319,20 @@
     GtkTreeModel *model;
     GtkTreeSelection *selection;
     GtkTreeIter iter;
+    GdkPixbuf *thumbnail;
 
     GList *node;
-    gchar *sel, name[512], desc[512], *tmp;
+    gchar *sel, *name;
     gchar *comp = NULL;
 
     selection = gtk_tree_view_get_selection(treeview);
     if (!gtk_tree_selection_get_selected(selection, &model, &iter))
         return;
 
+    gtk_tree_model_get(model, &iter, SKIN_VIEW_COL_PREVIEW, &thumbnail, -1);
     gtk_tree_model_get(model, &iter, SKIN_VIEW_COL_NAME, &sel, -1);
 
-    /* XXX: This is icky hack because we do not store the skin name
-     * in the skinlist. My attempts at doing that cause a blank skin 
-     * window. Must be doing something wrong.
-     */
-    sscanf(sel, "<big><b>%s</b></big>\n<i>%s</i>", name, desc);
-    tmp = strchr(name, '<');
-    *tmp = '\0';
+    name = g_object_get_data(G_OBJECT(thumbnail), "skinpath");
 
     /* FIXME: store name in skinlist */
     for (node = skinlist; node; node = g_list_next(node)) {