# HG changeset patch # User Eric Warmenhoven # Date 972526354 0 # Node ID 84a5d80e52f143ec13505023108f437b945bff99 # Parent 66481301d9726788f11ae060e05e209abe535b98 [gaim-migrate @ 1035] remember which directory you got the last plugin from and default to /usr/local/lib/gaim/ which is where they get installed by default (please fix this, it needs to be $libdir but i don't know how to get that from configure) committer: Tailor Script diff -r 66481301d972 -r 84a5d80e52f1 src/plugins.c --- a/src/plugins.c Thu Oct 26 00:57:41 2000 +0000 +++ b/src/plugins.c Thu Oct 26 02:12:34 2000 +0000 @@ -63,6 +63,7 @@ static GtkWidget *config = NULL; static guint confighandle = 0; +static char *last_dir = NULL; /* --------------- Function Declarations --------------------- */ @@ -92,7 +93,6 @@ static void load_file(GtkWidget *w, gpointer data) { gchar *buf; - FILE *fd; if (plugin_dialog) { gtk_widget_show(plugin_dialog); @@ -105,12 +105,11 @@ gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION(plugin_dialog)); - buf = g_strconcat(g_get_home_dir(), G_DIR_SEPARATOR_S, PLUGIN_DIR, NULL); - fd = fopen(buf, "r"); - if (!fd) - mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR); + if (!last_dir) + /* someone fix me please, how do we get the dir from configure? */ + buf = g_strdup("/usr/local/lib/gaim/"); else - fclose(fd); + buf = g_strconcat(last_dir, G_DIR_SEPARATOR_S, NULL); gtk_file_selection_set_filename(GTK_FILE_SELECTION(plugin_dialog), buf); gtk_file_selection_complete(GTK_FILE_SELECTION(plugin_dialog), "*.so"); @@ -164,6 +163,10 @@ else plug->filename = g_strdup(filename); + if (last_dir) + g_free(last_dir); + last_dir = g_dirname(plug->filename); + debug_printf("Loading %s\n", filename); /* do NOT `OR' with RTLD_GLOBAL, otherwise plugins may conflict * (it's really just a way to work around other people's bad