BeOS: support for vmdir preferences.

This commit is contained in:
Adrien Destugues 2015-04-26 17:27:36 +02:00
parent c97be8dbb2
commit c226da6172
2 changed files with 19 additions and 2 deletions

View File

@ -118,6 +118,8 @@ private:
class file_open_error {}; class file_open_error {};
class file_read_error {}; class file_read_error {};
class rom_size_error {}; class rom_size_error {};
char* vmdir;
}; };
static BasiliskII *the_app; static BasiliskII *the_app;
@ -178,7 +180,7 @@ void BasiliskII::ReadyToRun(void)
// Read preferences // Read preferences
int argc = 0; int argc = 0;
char **argv = NULL; char **argv = NULL;
PrefsInit(argc, argv); PrefsInit(vmdir, argc, argv);
// Init system routines // Init system routines
SysInit(); SysInit();

View File

@ -44,8 +44,23 @@ static BPath prefs_path;
* Load preferences from settings file * Load preferences from settings file
*/ */
void LoadPrefs(void) void LoadPrefs(const char* vmdir)
{ {
#if 0
if (vmdir) {
prefs_path.SetTo(vmdir);
prefs_path.Append("prefs");
FILE *prefs = fopen(prefs_path.Path(), "r");
if (!prefs) {
printf("No file at %s found.\n", prefs_path.Path());
exit(1);
}
LoadPrefsFromStream(prefs);
fclose(prefs);
return;
}
#endif
// Construct prefs path // Construct prefs path
find_directory(B_USER_SETTINGS_DIRECTORY, &prefs_path, true); find_directory(B_USER_SETTINGS_DIRECTORY, &prefs_path, true);
prefs_path.Append(PREFS_FILE_NAME); prefs_path.Append(PREFS_FILE_NAME);