From 5342a761a63518f75f010f966c559655ac125889 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Mon, 8 Jul 2013 23:06:26 +0000 Subject: [PATCH] gtk: check if a "last opened" directory exists before setting directory to defaut in lua open dialog --- trunk/src/drivers/sdl/gui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trunk/src/drivers/sdl/gui.cpp b/trunk/src/drivers/sdl/gui.cpp index bf4070ee..a07243ee 100644 --- a/trunk/src/drivers/sdl/gui.cpp +++ b/trunk/src/drivers/sdl/gui.cpp @@ -1521,7 +1521,9 @@ void loadLua () const char* last_file; g_config->getOption("SDL.LastLoadLua", &last_file); gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(fileChooser), last_file); - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fileChooser), "/usr/share/fceux/luaScripts"); + + if(strcmp(last_file, "") == 0) + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fileChooser), "/usr/share/fceux/luaScripts"); if (gtk_dialog_run (GTK_DIALOG (fileChooser)) ==GTK_RESPONSE_ACCEPT) {