changeset 3439:93584d1b3e7e trunk

Add plugin pointer to the plugin treestore.
author William Pitcock <nenolod@atheme.org>
date Fri, 07 Sep 2007 07:09:35 -0500
parents 7043b5c94a94
children 7f32f40201a4
files src/audacious/ui_preferences.c
diffstat 1 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_preferences.c	Fri Sep 07 03:41:14 2007 -0500
+++ b/src/audacious/ui_preferences.c	Fri Sep 07 07:09:35 2007 -0500
@@ -77,6 +77,7 @@
     PLUGIN_VIEW_COL_DESC,
     PLUGIN_VIEW_COL_FILENAME,
     PLUGIN_VIEW_COL_ID,
+    PLUGIN_VIEW_COL_PLUGIN_PTR,
     PLUGIN_VIEW_N_COLS
 };
 
@@ -214,7 +215,6 @@
     GtkTreeIter iter;
     GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
     gint pluginnr;
-    gchar *filename, *basename;
     Plugin *plugin;
     /*GList *diplist, *tmplist; */
 
@@ -222,15 +222,9 @@
     gtk_tree_model_get_iter(model, &iter, path);
     gtk_tree_model_get(model, &iter,
                        PLUGIN_VIEW_COL_ID, &pluginnr,
-                       PLUGIN_VIEW_COL_FILENAME, &filename,
+		       PLUGIN_VIEW_COL_PLUGIN_PTR, &plugin,
                        -1);
 
-    basename = g_path_get_basename(filename);
-    g_free(filename);
-
-    /* get our plugin */
-    plugin = plugin_get_plugin(basename);
-
     /* do something with the value */
     plugin->enabled ^= 1;
 
@@ -240,7 +234,6 @@
 
     /* clean up */
     gtk_tree_path_free(path);
-    g_free(basename);
 }
 
 
@@ -389,7 +382,7 @@
 
     store = gtk_list_store_new(PLUGIN_VIEW_N_COLS,
                                G_TYPE_BOOLEAN, G_TYPE_STRING,
-                               G_TYPE_STRING, G_TYPE_INT);
+                               G_TYPE_STRING, G_TYPE_INT, G_TYPE_POINTER);
 
     column = gtk_tree_view_column_new();
     gtk_tree_view_column_set_title(column, _("Enabled"));
@@ -446,7 +439,8 @@
                            PLUGIN_VIEW_COL_ACTIVE, plugin->enabled,
                            PLUGIN_VIEW_COL_DESC, description[0],
                            PLUGIN_VIEW_COL_FILENAME, description[1],
-                           PLUGIN_VIEW_COL_ID, id++, -1);
+                           PLUGIN_VIEW_COL_ID, id++,
+			   PLUGIN_VIEW_COL_PLUGIN_PTR, plugin, -1);
 
         g_free(description[1]);
         g_free(description[0]);