From 4ab9ed88637afa662f35cd6417dfa9524a93f4b7 Mon Sep 17 00:00:00 2001 From: nigel <> Date: Fri, 6 Nov 2009 21:33:03 +0000 Subject: [PATCH] Allow linking after prefs API changes from 3 months ago. --- BasiliskII/src/MacOSX/PrefsEditor.mm | 2 +- BasiliskII/src/MacOSX/prefs_macosx.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/BasiliskII/src/MacOSX/PrefsEditor.mm b/BasiliskII/src/MacOSX/PrefsEditor.mm index 24e9dde0..1b9cd13a 100644 --- a/BasiliskII/src/MacOSX/PrefsEditor.mm +++ b/BasiliskII/src/MacOSX/PrefsEditor.mm @@ -662,7 +662,7 @@ shouldProceedAfterError: (NSDictionary *) errorDict PrefsExit(); // Purge all the old pref values - PrefsInit(argc, argv); + PrefsInit(NULL, argc, argv); AddPrefsDefaults(); AddPlatformPrefsDefaults(); // and only create basic ones diff --git a/BasiliskII/src/MacOSX/prefs_macosx.cpp b/BasiliskII/src/MacOSX/prefs_macosx.cpp index f08a02bd..74000fd7 100644 --- a/BasiliskII/src/MacOSX/prefs_macosx.cpp +++ b/BasiliskII/src/MacOSX/prefs_macosx.cpp @@ -52,8 +52,20 @@ static string prefs_path; * Load preferences from settings file */ -void LoadPrefs(void) +void LoadPrefs(const char *vmdir) { + if (vmdir) { + prefs_path = string(vmdir) + '/' + string("prefs"); + FILE *prefs = fopen(prefs_path.c_str(), "r"); + if (!prefs) { + printf("No file at %s found.\n", prefs_path.c_str()); + exit(1); + } + LoadPrefsFromStream(prefs); + fclose(prefs); + return; + } + // Construct prefs path if (UserPrefsPath.empty()) { char *home = getenv("HOME");