Moved the folder name and annotation for the incoming shares root folder to string constants.
authorjonathandicarlo@jonathan-dicarlos-macbook-pro.local
Tue, 24 Jun 2008 18:38:29 -0700
changeset 44730 1ed6147ab1f9a7eccdcccc931e43c980ad32be0f
parent 44726 6d56acb301c26a2a8d3f8802d0d90e6e09eb2e6f
child 44731 d3c67942281be44c167c751b9b1084331b8283a2
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
Moved the folder name and annotation for the incoming shares root folder to string constants.
services/sync/modules/engines/bookmarks.js
--- a/services/sync/modules/engines/bookmarks.js
+++ b/services/sync/modules/engines/bookmarks.js
@@ -43,16 +43,20 @@ const Cu = Components.utils;
 
 // Annotation to use for shared bookmark folders, incoming and outgoing:
 const INCOMING_SHARED_ANNO = "weave/shared-incoming";
 const OUTGOING_SHARED_ANNO = "weave/shared-outgoing";
 const SERVER_PATH_ANNO = "weave/shared-server-path";
 // Standard names for shared files on the server
 const KEYRING_FILE_NAME = "keyring";
 const SHARED_BOOKMARK_FILE_NAME = "shared_bookmarks";
+// Information for the folder that contains all incoming shares
+const INCOMING_SHARE_ROOT_ANNO = "weave/mounted-shares-folder";
+const INCOMING_SHARE_ROOT_NAME = "Shared Folders";
+
 
 Cu.import("resource://weave/log4moz.js");
 Cu.import("resource://weave/dav.js");
 Cu.import("resource://weave/util.js");
 Cu.import("resource://weave/crypto.js");
 Cu.import("resource://weave/async.js");
 Cu.import("resource://weave/engines.js");
 Cu.import("resource://weave/syncCores.js");
@@ -508,25 +512,26 @@ BookmarksEngine.prototype = {
        function will exit without doing anything.  It won't create a duplicate.
     */
     let bms = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
       getService(Ci.nsINavBookmarksService);
 
     /* Get the toolbar "Shared Folders" folder (identified by its annotation).
        If it doesn't already exist, create it: */
     let root;
-    let a = this._annoSvc.getItemsWithAnnotation("weave/mounted-shares-folder",
+    let a = this._annoSvc.getItemsWithAnnotation(INCOMING_SHARE_ROOT_ANNO,
                                                  {});
     if (a.length == 1)
       root = a[0];
     if (!root) {
-      root = bms.createFolder(bms.toolbarFolder, "Shared Folders",
+      root = bms.createFolder(bms.toolbarFolder,
+			      INCOMING_SHARE_ROOT_NAME,
                               bms.DEFAULT_INDEX);
       this._annoSvc.setItemAnnotation(root,
-                                      "weave/mounted-shares-folder",
+                                      INCOMING_SHARE_ROOT_ANNO,
                                       true,
                                       0,
                                       this._annoSvc.EXPIRE_NEVER);
     }
     /* Inside "Shared Folders", create a new folder annotated with
        the originating user and the directory path specified by the incoming
        share offer.  Unless a folder with these exact annotations already
        exists, in which case do nothing. */