summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2012-07-31 20:30:59 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2012-07-31 20:30:59 +0000
commit3be36521b4e01c9b64c4012ffa7f97f15a60fd48 (patch)
tree1674fbe877d45943003797568158dd4bc6c3c571 /gui
parent3c6c4524caff9e185b9a406947b2246902ec2bed (diff)
downloadpcsxr-3be36521b4e01c9b64c4012ffa7f97f15a60fd48.tar.gz
Patch 12651 (dokuganryu);
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@79276 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'gui')
-rw-r--r--gui/Gtk2Gui.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gui/Gtk2Gui.c b/gui/Gtk2Gui.c
index 2f853df0..ac8eabcc 100644
--- a/gui/Gtk2Gui.c
+++ b/gui/Gtk2Gui.c
@@ -606,11 +606,25 @@ static gchar *Open_Iso_Proc() {
if (gtk_dialog_run(GTK_DIALOG(chooser)) == GTK_RESPONSE_OK) {
gchar *path = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(chooser));
- strcpy(current_folder, path);
- g_free(path);
+
+ /* Workaround:
+ for some reasons gtk_file_chooser_get_current_folder return NULL
+ if a file is selected from "Recently Used" or "Searsh"*/
+ if(path != NULL) {
+ strcpy(current_folder, path);
+ g_free(path);
+ }
+
GSList * l = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER (chooser));
if(l) {
filename = l->data;
+
+ /* if the file was selected from "Recently Used" or "Searsh"
+ we need to extract the path from the filename to set it to current_folder*/
+ if(path == NULL) {
+ strncpy(current_folder, filename, strrchr(filename, '/') - filename);
+ }
+
/* free useless data */
GSList * ll = l;
while(l->next) {