changeset 450:dd84f79979b4 trunk

[svn] Dissect the pango markup using scanf and various string delimiter hacks. This could be done in a much better way, but I'd rather not sit down and figure out why GTK is not behaving the way I want it to right now.
author nenolod
date Mon, 16 Jan 2006 15:21:41 -0800
parents bf803441d49e
children 00afc39b0754
files audacious/skinwin.c
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/audacious/skinwin.c	Mon Jan 16 14:37:05 2006 -0800
+++ b/audacious/skinwin.c	Mon Jan 16 15:21:41 2006 -0800
@@ -319,14 +319,22 @@
     GtkTreeIter iter;
 
     GList *node;
-    gchar *name;
+    gchar *sel, name[512], desc[512], *tmp;
     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_NAME, &name, -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';
 
     /* FIXME: store name in skinlist */
     for (node = skinlist; node; node = g_list_next(node)) {
@@ -335,7 +343,7 @@
             break;
     }
 
-    g_free(name);
+    g_free(sel);
 
     bmp_active_skin_load(comp);
 }