From 3d8452d1bea00f928137ca675acab7eab2592427 Mon Sep 17 00:00:00 2001 From: "ben%bengoodger.com" Date: Sun, 3 Oct 2004 21:06:30 +0000 Subject: [PATCH] 252182 - make sure we write bin/profile defaults.ini files in the right place, not both in the profile (clobbering profile extension data with global extension data)... also fix some js errors preventing theme reversion from happening in safe mode ... and get rid of "optional components" section in update wizard git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_20040515_BRANCH@163167 18797224-902f-48f8-a5cc-f745e15eee43 --- .../extensions/src/nsExtensionManager.js.in | 14 ++++++++------ .../toolkit/mozapps/shared/content/richview.xml | 1 - mozilla/toolkit/mozapps/update/content/update.js | 9 +++++---- .../mozapps/update/src/nsUpdateService.js.in | 15 ++++++++------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in b/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in index 9ac927904f1..8cdccacde56 100644 --- a/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in +++ b/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in @@ -1630,7 +1630,7 @@ nsExtensionManager.prototype = { try { lastSelectedSkin = gPref.getCharPref(PREF_EM_LAST_SELECTED_SKIN); gPref.clearUserPref(PREF_EM_LAST_SELECTED_SKIN); - pref.setCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN, lastSelectedSkin); + gPref.setCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN, lastSelectedSkin); } catch (e) { } @@ -1649,7 +1649,7 @@ nsExtensionManager.prototype = { catch (e) { } } catch (e) { - dump("*** nsExtensionManager::start - failure, catching exception so finalize window can close\n"); + dump("*** nsExtensionManager::start - failure, catching exception so finalize window can close = " + e + "\n"); } win.close(); @@ -1670,7 +1670,8 @@ nsExtensionManager.prototype = { if (!gPref.prefHasUserValue(PREF_EM_LAST_SELECTED_SKIN)) { gPref.setCharPref(PREF_EM_LAST_SELECTED_SKIN, gPref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN)); - pref.clearUserPref(PREF_GENERAL_SKINS_SELECTEDSKIN); + if (gPref.prefHasUserValue(PREF_GENERAL_SKINS_SELECTEDSKIN)) + gPref.clearUserPref(PREF_GENERAL_SKINS_SELECTEDSKIN); } var items = this._ds.getItemList(null, nsIUpdateItem.TYPE_EXTENSION, {}); @@ -1698,7 +1699,7 @@ nsExtensionManager.prototype = { } } catch (e) { - dump("*** nsExtensionManager::start - (safe mode) failure, catching exception so finalize window can close\n"); + dump("*** nsExtensionManager::start - (safe mode) failure, catching exception so finalize window can close = " + e + "\n"); } win.close(); @@ -2189,8 +2190,9 @@ nsExtensionManager.prototype = { _writeDefaults: function nsExtensionManager__writeDefaults (aIsProfile) { - this._writeProfileFile(getFile(KEY_PROFILEDIR, [FILE_DEFAULTS]), - this._getPreferencesDir, aIsProfile); + var manifest = aIsProfile ? getFile(KEY_PROFILEDIR, [FILE_DEFAULTS]) : + getFile(KEY_APPDIR, [FILE_DEFAULTS]); + this._writeProfileFile(manifest, this._getPreferencesDir, aIsProfile); }, _cleanDirs: function nsExtensionManager__cleanDirs () diff --git a/mozilla/toolkit/mozapps/shared/content/richview.xml b/mozilla/toolkit/mozapps/shared/content/richview.xml index 0b930e9dc03..45c06667b1d 100644 --- a/mozilla/toolkit/mozapps/shared/content/richview.xml +++ b/mozilla/toolkit/mozapps/shared/content/richview.xml @@ -197,7 +197,6 @@ - diff --git a/mozilla/toolkit/mozapps/update/content/update.js b/mozilla/toolkit/mozapps/update/content/update.js index d5b9a06215b..c04fb36c64f 100644 --- a/mozilla/toolkit/mozapps/update/content/update.js +++ b/mozilla/toolkit/mozapps/update/content/update.js @@ -628,11 +628,12 @@ var gFoundPage = { var patches = this._currentInfo.getCollection("patches", { }); if (patches.length > 0 && !updatePerformed) this.buildPatches(patches); - - var components = this._currentInfo.getCollection("optional", { }); - if (components.length > 0) - this.buildOptional(components); + // Turning this off until we can better determine what is and is not installed. + // var components = this._currentInfo.getCollection("optional", { }); + // if (components.length > 0) + // this.buildOptional(components); + var languages = this._currentInfo.getCollection("languages", { }); if (languages.length > 0) this.buildLanguages(languages); diff --git a/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in b/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in index 8635c735261..037f2171287 100644 --- a/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in +++ b/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in @@ -795,7 +795,8 @@ nsAppUpdater.prototype = { newestVersionObj.resource = update; } } - this._parseVersionData(aDataSource, newestVersionObj.resource, this._service._newestVersion); + if (newestVersionObj.resource) + this._parseVersionData(aDataSource, newestVersionObj.resource, this._service._newestVersion); // There is a newer version of the app available or there are any critical // patches available update the severity and available updates preferences. @@ -808,7 +809,7 @@ nsAppUpdater.prototype = { var languages = this._service._newestVersion.languages; if (languages) { var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"] - .getService(Components.interfaces.nsIXULChromeRegistry); + .getService(Components.interfaces.nsIXULChromeRegistry); var selectedLocale = cr.getSelectedLocale("global"); for (var i = 0; i < languages.length; ++i) { if (languages[i].internalName == selectedLocale) @@ -816,8 +817,8 @@ nsAppUpdater.prototype = { } } - if (haveLanguage && - (newestVersionObj.version != appVersion || (patches && patches.length > 0))) { + if ((haveLanguage && (newestVersionObj.version != appVersion)) || + (patches && patches.length > 0)) { gPref.setIntPref(PREF_UPDATE_SEVERITY, 2); gPref.setBoolPref(PREF_UPDATE_APP_UPDATESAVAILABLE, true); } @@ -875,7 +876,7 @@ nsAppUpdater.prototype = { try { collectionResource = collectionResource.QueryInterface(Components.interfaces.nsIRDFResource); } - catch (e) { return; } + catch (e) { return null; } var cu = Components.classes["@mozilla.org/rdf/container-utils;1"] .getService(Components.interfaces.nsIRDFContainerUtils); @@ -883,7 +884,7 @@ nsAppUpdater.prototype = { var c = Components.classes["@mozilla.org/rdf/container;1"] .getService(Components.interfaces.nsIRDFContainer); c.Init(aDataSource, collectionResource); - + var elements = c.GetElements(); var fileArc = gRDF.GetResource(APP_NS("file")); var platform = getOSKey(); @@ -915,7 +916,7 @@ nsAppUpdater.prototype = { result.push(info); } } - + return result; },