don't sync bookmarks/history unless they have been enabled
authorDan Mills <thunder@mozilla.com>
Wed, 05 Mar 2008 18:36:58 -0800
changeset 44363 b03427f958ddbd5ccc1fb682d7afc18fe87cb7b3
parent 44362 d77e6b94661780d0a8cc1352d37597b2943490f3
child 44364 7fc265bb2933cb63dc6db955c9f0568bfcaced4f
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)
don't sync bookmarks/history unless they have been enabled
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -261,22 +261,18 @@ WeaveSyncService.prototype = {
     root.addAppender(capp);
 
     let dapp = Log4Moz.Service.newAppender("dump", formatter);
     dapp.level = Log4Moz.Level[this._prefs.getCharPref("log.appender.dump")];
     root.addAppender(dapp);
 
     let brief = this._dirSvc.get("ProfD", Ci.nsIFile);
     brief.QueryInterface(Ci.nsILocalFile);
-
     brief.append("weave");
     brief.append("logs");
-    if (!brief.exists())
-      brief.create(brief.DIRECTORY_TYPE, PERMS_DIRECTORY);
-
     brief.append("brief-log.txt");
     if (!brief.exists())
       brief.create(brief.NORMAL_FILE_TYPE, PERMS_FILE);
 
     let verbose = brief.parent.clone();
     verbose.append("verbose-log.txt");
     if (!verbose.exists())
       verbose.create(verbose.NORMAL_FILE_TYPE, PERMS_FILE);
@@ -400,20 +396,24 @@ WeaveSyncService.prototype = {
     let success = false;
 
     try {
       if (!this._lock())
 	return;
 
       this._os.notifyObservers(null, "weave:service:sync:start", "");
 
-      this._bmkEngine.sync(cont);
-      yield;
-      this._histEngine.sync(cont);
-      yield;
+      if (this._prefs.getBoolPref("bookmarks")) {
+        this._bmkEngine.sync(cont);
+        yield;
+      }
+      if (this._prefs.getBoolPref("history")) {
+        this._histEngine.sync(cont);
+        yield;
+      }
 
       success = true;
       this._unlock();
 
     } catch (e) {
       this._log.error("Exception caught: " + (e.message? e.message : e));
 
     } finally {