git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3960 8ced0084-cf51-0410-be5f-012b33b47a6e

This commit is contained in:
Shawn Hoffman
2009-08-11 12:09:46 +00:00
parent 5be34cd7e5
commit 379f690438

View File

@ -124,7 +124,7 @@ bool DolphinApp::OnInit()
} }
#ifndef __APPLE__ #ifndef __APPLE__
// Keep the user config dir free unless user wants to save the working dir // Keep the user config dir free unless user wants to save the working dir
if (File::Exists(FULL_CONFIG_DIR "portable")) if (!File::Exists(FULL_CONFIG_DIR "portable"))
{ {
char tmp[1024]; char tmp[1024];
sprintf(tmp, "%s/.dolphin%swd", (const char*)wxStandardPaths::Get().GetUserConfigDir().mb_str(), sprintf(tmp, "%s/.dolphin%swd", (const char*)wxStandardPaths::Get().GetUserConfigDir().mb_str(),
@ -143,6 +143,7 @@ bool DolphinApp::OnInit()
{ {
PanicAlert("Portable Setting could not be saved\n Are you running Dolphin from read only media or from a directory that dolphin is not located in?"); PanicAlert("Portable Setting could not be saved\n Are you running Dolphin from read only media or from a directory that dolphin is not located in?");
} }
fclose(portable);
} }
else else
{ {
@ -151,7 +152,8 @@ bool DolphinApp::OnInit()
if (PanicYesNo("Set install location to:\n %s ?", CWD)) if (PanicYesNo("Set install location to:\n %s ?", CWD))
{ {
FILE* workingDirF = fopen(tmp, "w"); FILE* workingDirF = fopen(tmp, "w");
if (!workingDirF) PanicAlert("Install directory could not be saved"); if (!workingDirF)
PanicAlert("Install directory could not be saved");
else else
{ {
fwrite(CWD, ((std::string)CWD).size()+1, 1, workingDirF); fwrite(CWD, ((std::string)CWD).size()+1, 1, workingDirF);
@ -159,16 +161,17 @@ bool DolphinApp::OnInit()
fclose(workingDirF); fclose(workingDirF);
} }
} }
else PanicAlert("Relaunch Dolphin from the install directory and save from there"); else
PanicAlert("Relaunch Dolphin from the install directory and save from there");
} }
} }
else else
{ {
char *tmpChar; char *tmpChar;
long len; long len;
fseek(workingDir,0,SEEK_END); fseek(workingDir, 0, SEEK_END);
len=ftell(workingDir); len = ftell(workingDir);
fseek(workingDir,0,SEEK_SET); fseek(workingDir, 0, SEEK_SET);
tmpChar = new char[len]; tmpChar = new char[len];
fread(tmpChar, len, 1, workingDir); fread(tmpChar, len, 1, workingDir);
fclose(workingDir); fclose(workingDir);