File system-extensions.patch of Package MozillaThunderbird

Index: toolkit/mozapps/extensions/src/nsExtensionManager.js.in
===================================================================
RCS file: /cvsroot/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in,v
retrieving revision 1.144.2.52
diff -u -p -6 -r1.144.2.52 nsExtensionManager.js.in
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in	29 Jun 2006 20:11:57 -0000	1.144.2.52
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in	20 Jul 2006 07:23:39 -0000
@@ -116,12 +116,13 @@ const OP_NEEDS_UPGRADE                = 
 const OP_NEEDS_UNINSTALL              = "needs-uninstall";
 const OP_NEEDS_ENABLE                 = "needs-enable";
 const OP_NEEDS_DISABLE                = "needs-disable";
 
 const KEY_APP_PROFILE                 = "app-profile";
 const KEY_APP_GLOBAL                  = "app-global";
+const KEY_APP_SYSTEM                  = "app-system";
 
 const CATEGORY_INSTALL_LOCATIONS      = "extension-install-locations";
 
 const PREFIX_NS_EM                    = "http://www.mozilla.org/2004/em-rdf#";
 const PREFIX_NS_CHROME                = "http://www.mozilla.org/rdf/chrome#";
 const PREFIX_ITEM_URI                 = "urn:mozilla:item:";
@@ -2671,12 +2672,23 @@ function ExtensionManager() {
   var priority = nsIInstallLocation.PRIORITY_APP_PROFILE;
   var profileLocation = new DirectoryInstallLocation(KEY_APP_PROFILE, 
                                                      appProfileExtensions, false,
                                                      priority);
   InstallLocations.put(profileLocation);
 
+  // Register App-System Install Location
+  try {
+    var appSystemExtensions = getDirNoCreate("DrvD", ["usr","lib","browser-extensions","thunderbird"]);
+    var priority = nsIInstallLocation.PRIORITY_APP_PROFILE - 1;
+    var systemLocation = new DirectoryInstallLocation(KEY_APP_SYSTEM,
+                                                      appSystemExtensions, true,
+                                                      priority);
+    InstallLocations.put(systemLocation);
+  } catch (e) {}
+
+
 #ifdef XP_WIN
   // Register HKEY_LOCAL_MACHINE Install Location
   InstallLocations.put(
       new WinRegInstallLocation("winreg-app-global",
                                 nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
                                 true,
@@ -3830,13 +3842,13 @@ ExtensionManager.prototype = {
     // toolkit 1.8 extension datasource.
     if (dsExists)
       return;
 
     // Prepare themes for installation
     // Only enumerate directories in the app-profile and app-global locations.
-    var locations = [KEY_APP_PROFILE, KEY_APP_GLOBAL];
+    var locations = [KEY_APP_PROFILE, KEY_APP_GLOBAL, KEY_APP_SYSTEM];
     for (var i = 0; i < locations.length; ++i) {
       var location = InstallLocations.get(locations[i]);
       if (!location.canAccess)
         continue;
 
       var entries = location.itemLocations;
@@ -3896,13 +3908,14 @@ ExtensionManager.prototype = {
     if (this._checkForFileChanges()) {
       // Create a list of all items that are to be installed so we can migrate
       // these items's settings to the new datasource.
       var items = PendingOperations.getOperations(OP_NEEDS_INSTALL);
       for (i = items.length - 1; i >= 0; --i) {
         if (items[i].locationKey == KEY_APP_PROFILE ||
-            items[i].locationKey == KEY_APP_GLOBAL)
+            items[i].locationKey == KEY_APP_GLOBAL ||
+            items[i].locationKey == KEY_APP_SYSTEM)
           itemsToCheck.push(items[i].id);
       }
       this._finishOperations();
     }
 
     // If there are no items to migrate settings for return early.
@@ -4881,13 +4894,14 @@ ExtensionManager.prototype = {
         var restartRequired = this.installRequiresRestart(id, ds.getItemProperty(id, "type"))
         this._updateManifests(restartRequired);
         return;
       }
     }
     else if (installLocation.name == KEY_APP_PROFILE ||
-             installLocation.name == KEY_APP_GLOBAL) {
+             installLocation.name == KEY_APP_GLOBAL ||
+             installLocation.name == KEY_APP_SYSTEM) {
       // Check for a pointer file and remove it if it exists
       var pointerFile = installLocation.location.clone();
       pointerFile.append(id);
       if (pointerFile.exists() && !pointerFile.isDirectory())
         pointerFile.remove(false);
     }
openSUSE Build Service is sponsored by