--- a/gflib/doc/gflib/tmpl/gf_plugin_info.sgml Sun Nov 15 02:22:37 2009 -0600
+++ b/gflib/doc/gflib/tmpl/gf_plugin_info.sgml Sun Dec 06 12:56:54 2009 -0600
@@ -24,6 +24,7 @@
--- a/gflib/gflib/gf_plugin_manager.c Sun Nov 15 02:22:37 2009 -0600
+++ b/gflib/gflib/gf_plugin_manager.c Sun Dec 06 12:56:54 2009 -0600
@@ -136,6 +136,44 @@
+gf_plugin_manager_refresh_filenames(void) { + root = g_node_new(NULL); + for(l = paths; l; l = l->next) { + const gchar *path = l->data; + const gchar *basename = NULL; + child = g_node_prepend_data(root, g_strdup(path)); + if(!g_file_test(path, G_FILE_TEST_IS_DIR)) + g_mkdir_with_parents(path, S_IRUSR | S_IWUSR | S_IXUSR); + dir = g_dir_open(path, 0, &error); + gf_log_warning("GfPluginManager", "Failed to open %s: %s\n", + (error->message) ? error->message : + while((basename = g_dir_read_name(dir))) + g_node_prepend_data(child, g_strdup(basename)); /******************************************************************************
*****************************************************************************/
@@ -182,6 +220,14 @@
+gf_plugin_manager_refresh_filenames_free(GNode *node, gpointer data) { * gf_plugin_manager_refresh:
* @path_str : A #G_SEARCHPATH_SEPARATOR delimited list of directories to
@@ -192,32 +238,16 @@
gf_plugin_manager_refresh(void) {
- GfPluginManagerLoadData pmld;
- for(p = paths; p; p = p->next) {
+ GNode *file_tree = NULL;
- if(!g_file_test(pmld.path, G_FILE_TEST_IS_DIR)) {
- g_mkdir_with_parents(pmld.path, S_IRUSR | S_IWUSR | S_IXUSR);
+ file_tree = gf_plugin_manager_refresh_filenames(); - pmld.dir = g_dir_open(pmld.path, 0, &error);
- gf_log_warning("GfPluginManager", "Failed to open %s: %s\n",
- (error->message) ? error->message :
+ /* free the data associated with the nodes */ + g_node_traverse(file_tree, G_PRE_ORDER, G_TRAVERSE_ALL, -1, + gf_plugin_manager_refresh_filenames_free, NULL); - g_hash_table_foreach(loaders, gf_plugin_manager_loader_refresh, &pmld);
+ /* free the nodes themselves */ + g_node_destroy(file_tree);