diff -Nru prism-1.0b4+svn20101202r78605/debian/changelog prism-1.0b4+svn20101215r79460/debian/changelog --- prism-1.0b4+svn20101202r78605/debian/changelog 2010-12-16 05:32:00.000000000 +0000 +++ prism-1.0b4+svn20101215r79460/debian/changelog 2010-12-16 05:32:00.000000000 +0000 @@ -1,8 +1,8 @@ -prism (1.0b4+svn20101202r78605-0ubuntu1~umd1~maverick) maverick; urgency=low +prism (1.0b4+svn20101215r79460-0ubuntu1~umd1~maverick) maverick; urgency=low * New upstream snapshot - -- Fabien Tassin Fri, 03 Dec 2010 05:00:31 +0100 + -- Fabien Tassin Thu, 16 Dec 2010 05:00:29 +0100 prism (1.0b3+svn20100210r62050-0ubuntu1) lucid; urgency=low diff -Nru prism-1.0b4+svn20101202r78605/debian/control prism-1.0b4+svn20101215r79460/debian/control --- prism-1.0b4+svn20101202r78605/debian/control 2010-12-16 05:32:00.000000000 +0000 +++ prism-1.0b4+svn20101215r79460/debian/control 2010-12-16 05:32:00.000000000 +0000 @@ -19,7 +19,7 @@ imagemagick, libasound2-dev, mozilla-devscripts (>= 0.11~), - xulrunner-1.9.2-dev (>= 1.9.2.14~hg20101203r34795+nobinonly-0ubuntu1~umd1~maverick) + xulrunner-1.9.2-dev (>= 1.9.2.14~hg20101215r34828+nobinonly-0ubuntu1~umd1~maverick) Standards-Version: 3.7.3 Package: prism diff -Nru prism-1.0b4+svn20101202r78605/prism/chrome/content/webrunner.js prism-1.0b4+svn20101215r79460/prism/chrome/content/webrunner.js --- prism-1.0b4+svn20101202r78605/prism/chrome/content/webrunner.js 2010-12-03 04:21:20.000000000 +0000 +++ prism-1.0b4+svn20101215r79460/prism/chrome/content/webrunner.js 2010-12-16 04:21:13.000000000 +0000 @@ -671,12 +671,6 @@ // Default the name of the window to the webapp name document.title = WebAppProperties.name; - // Set browser homepage as initial webapp page - if (WebAppProperties.uri) { - var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); - prefs.setCharPref("browser.startup.homepage", WebAppProperties.uri); - } - // Add handlers for the main page window.addEventListener("unload", function() { WebRunner.shutdown(); }, false); #ifdef XP_WIN diff -Nru prism-1.0b4+svn20101202r78605/prism/client/stub/nsPrismStub.cpp prism-1.0b4+svn20101215r79460/prism/client/stub/nsPrismStub.cpp --- prism-1.0b4+svn20101202r78605/prism/client/stub/nsPrismStub.cpp 2010-12-03 04:21:21.000000000 +0000 +++ prism-1.0b4+svn20101215r79460/prism/client/stub/nsPrismStub.cpp 2010-12-16 04:21:14.000000000 +0000 @@ -162,6 +162,22 @@ return PR_TRUE; } +#if defined(XP_MACOSX) +void GetPathFromCFURL(CFURLRef url, char *path, size_t length) +{ + FSRef fsRef; + CFURLGetFSRef(url, &fsRef); + if (FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, NULL, NULL, NULL ) == noErr) { + CFStringRef pathStr = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); + if (pathStr) { + CFStringGetCString(pathStr, path, length, kCFStringEncodingUTF8); + CFRelease(pathStr); + } + } + CFRelease(url); +} +#endif + XRE_CreateAppDataType XRE_CreateAppData; XRE_FreeAppDataType XRE_FreeAppData; XRE_mainType XRE_main; @@ -172,8 +188,8 @@ nsresult rv; char *lastSlash; - char iniPath[MAXPATHLEN]; char tmpPath[MAXPATHLEN]; + char iniPath[MAXPATHLEN]; char webappPath[MAXPATHLEN] = { 0 }; char overridePath[MAXPATHLEN] = { 0 }; char greDir[MAXPATHLEN]; @@ -278,20 +294,7 @@ CFRelease(iniPathStr); if ((strlen(overridePath) == 0) && overrideFileURL) { - // Check whether the file exists - FSRef fsRef; - CFURLGetFSRef(overrideFileURL, &fsRef); - if (FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, NULL, NULL, NULL ) == noErr) { - // Add to XRE_main arguments - CFStringRef overridePathStr = - CFURLCopyFileSystemPath(overrideFileURL, kCFURLPOSIXPathStyle); - CFRelease(overrideFileURL); - if (overridePathStr) { - CFStringGetCString(overridePathStr, overridePath, sizeof(overridePath), - kCFStringEncodingUTF8); - CFRelease(overridePathStr); - } - } + GetPathFromCFURL(overrideFileURL, overridePath, sizeof(overridePath)); } #else @@ -380,6 +383,56 @@ return 1; } + // If we don't have an override.ini path yet, check whether it is specified in the registry (Windows) or + // in the user's Library directory (Mac) + if (strlen(overridePath) == 0) { + char vendor[128]; + rv = parser.GetString("App", "Vendor", vendor, sizeof(vendor)); + if (NS_SUCCEEDED(rv)) { + char appName[128]; + rv = parser.GetString("App", "Name", appName, sizeof(appName)); + if (NS_SUCCEEDED(rv)) { +#ifdef XP_WIN + char regPath[MAXPATHLEN]; + strcpy(regPath, "Software\\"); + strcat(regPath, vendor); + strcat(regPath, "\\"); + strcat(regPath, appName); + strcat(regPath, "\\Prism"); + HKEY hKey; + if (::RegOpenKeyEx(HKEY_CURRENT_USER, regPath, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { + DWORD read = sizeof(overridePath); + ::RegQueryValueEx(hKey, "OverridePath", 0, NULL, (LPBYTE) overridePath, &read); + } +#endif +#if defined(XP_MACOSX) + FSRef fsRef; + CFURLRef overrideFileURL = 0; + if (::FSFindFolder(kUserDomain, kDomainTopLevelFolderType, kCreateFolder, &fsRef) == noErr) { + CFURLRef homeURL = CFURLCreateFromFSRef(kCFAllocatorDefault, &fsRef); + CFURLRef prismURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault, homeURL, CFSTR(".prism"), false); + CFRelease(homeURL); + + CFStringRef vendorStr = CFStringCreateWithCString(kCFAllocatorDefault, vendor, kCFStringEncodingUTF8); + CFURLRef vendorURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault, prismURL, vendorStr, false); + CFRelease(prismURL); + CFRelease(vendorStr); + + CFStringRef appNameStr = CFStringCreateWithCString(kCFAllocatorDefault, appName, kCFStringEncodingUTF8); + CFURLRef appNameURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault, vendorURL, appNameStr, false); + CFRelease(vendorURL); + CFRelease(appNameStr); + + overrideFileURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault, appNameURL, CFSTR("override.ini"), false); + CFRelease(appNameURL); + + GetPathFromCFURL(overrideFileURL, overridePath, sizeof(overridePath)); + } +#endif + } + } + } + // Register any environment variables. This is Prism-specific. parser.GetStrings("Environment", SetEnvironmentVariable, iniPath); if (!gEnvSet && strlen(overridePath) > 0) { @@ -506,15 +559,24 @@ // If we have an override path, copy it into the command-line args if (strlen(overridePath) > 0) { newArgv = new char*[argc+3]; - newArgv[0] = argv[0]; - newArgv[1] = overrideFlag; - newArgv[2] = overridePath; - for (i=1; i