Allow linking after prefs API changes from 3 months ago.

This commit is contained in:
nigel 2009-11-06 21:33:03 +00:00
parent 02313b55c2
commit 4ab9ed8863
2 changed files with 14 additions and 2 deletions

View File

@ -662,7 +662,7 @@ shouldProceedAfterError: (NSDictionary *) errorDict
PrefsExit(); // Purge all the old pref values PrefsExit(); // Purge all the old pref values
PrefsInit(argc, argv); PrefsInit(NULL, argc, argv);
AddPrefsDefaults(); AddPrefsDefaults();
AddPlatformPrefsDefaults(); // and only create basic ones AddPlatformPrefsDefaults(); // and only create basic ones

View File

@ -52,8 +52,20 @@ static string prefs_path;
* Load preferences from settings file * 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 // Construct prefs path
if (UserPrefsPath.empty()) { if (UserPrefsPath.empty()) {
char *home = getenv("HOME"); char *home = getenv("HOME");