diff options
| author | SND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-02-15 19:03:46 +0000 |
|---|---|---|
| committer | SND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-02-15 19:03:46 +0000 |
| commit | c50c650aa44e36cca9a8a5b63925ba6a77e81189 (patch) | |
| tree | 0efe71cc89b06d75349be3491c6aa8f8e2bb28bb | |
| parent | d3236417509da28648e0ebf93b1181ada88379f2 (diff) | |
| download | pcsxr-c50c650aa44e36cca9a8a5b63925ba6a77e81189.tar.gz | |
Improved IsoImgDir saving & detection on GTK GUI.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82923 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rwxr-xr-x | gui/GtkGui.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gui/GtkGui.c b/gui/GtkGui.c index 6f8c1048..a7987bbf 100755 --- a/gui/GtkGui.c +++ b/gui/GtkGui.c @@ -599,6 +599,7 @@ void OnFile_RunBios() { } static gchar *Open_Iso_Proc() { + struct stat sb; GtkWidget *chooser; gchar *filename; GtkFileFilter *psxfilter, *allfilter; @@ -609,9 +610,9 @@ static gchar *Open_Iso_Proc() { GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - if (current_folder[0] == '\0' && Config.IsoImgDir[0] != '\0') { + if (stat(Config.IsoImgDir, &sb) == 0 && S_ISDIR(sb.st_mode)) { strcpy(current_folder, Config.IsoImgDir); - } else if (current_folder[0] == '\0' && Config.IsoImgDir[0] == '\0') { + } else if (strlen(Config.IsoImgDir) <= 0) { strcpy(current_folder, getenv("HOME")); } else { /* Using static (recent) PATH */ @@ -664,7 +665,7 @@ static gchar *Open_Iso_Proc() { } /* If ISO path is NULL save current path. */ - if (Config.IsoImgDir[0] == '\0') { + if (!S_ISDIR(sb.st_mode)) { strcpy(Config.IsoImgDir, current_folder); SaveConfig(); } |
