Moved the folder name and annotation for the incoming shares root folder to string constants.
Moved the folder name and annotation for the incoming shares root folder to string constants.
--- 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. */