# HG changeset patch # User William Pitcock # Date 1189166975 18000 # Node ID 93584d1b3e7e47a17641bf8481ce844242e04580 # Parent 7043b5c94a94a1e9a2f1924ea474a7ec10602b40 Add plugin pointer to the plugin treestore. diff -r 7043b5c94a94 -r 93584d1b3e7e src/audacious/ui_preferences.c --- 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]);