[Pkg-mozext-commits] [gcontactsync] 03/17: Issue #46 - Improve merging. Cleanup of previous commit.
David Prévot
taffit at moszumanska.debian.org
Sat Nov 1 23:37:01 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository gcontactsync.
commit af787d830010997620853f17660dfa514c7a7f56
Author: Josh Geenen <joshgeenen at gmail.com>
Date: Mon Sep 1 14:40:24 2014 -0500
Issue #46 - Improve merging. Cleanup of previous commit.
---
src/content/ContactConverter.js | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/content/ContactConverter.js b/src/content/ContactConverter.js
index 3d49d52..bc90e2d 100644
--- a/src/content/ContactConverter.js
+++ b/src/content/ContactConverter.js
@@ -558,11 +558,10 @@ com.gContactSync.ContactConverter = {
var obj = arr[i],
property = aGContact.getValue(obj.elementName, obj.index, obj.type),
value = this.checkValue(aTBContact.getValue(arr[i])),
- type = aTBContact.getValue(obj.tbName + "Type");
+ type = aTBContact.getValue(obj.tbName + "Type") || obj.type;
- if (!type || type === "")
- type = obj.type;
property = property || new com.gContactSync.Property("", "");
+
if (obj.tbName === com.gContactSync.dummyEmailName &&
com.gContactSync.isDummyEmail(value)) {
value = null;
@@ -573,17 +572,15 @@ com.gContactSync.ContactConverter = {
"'/'" + value + " , type: '" + property.type +
"'/'" + type + "'");
- // If TB has a value and (Google's is empty or update Google in conflict)
- // update Google.
- if (value && !property || value && !ab.mPrefs.updateGoogleInConflicts) {
+ // If TB has a value and (Google's is empty or update Google in conflict) update Google
+ // Else if Google has a value update TB
+ if (value && (!property.value || !ab.mPrefs.updateGoogleInConflicts)) {
gContactUpdated = true;
aGContact.setValue(obj.elementName, obj.index, type, value);
- } else {
+ } else if (property.value) {
tbContactUpdated = true;
aTBContact.setValue(obj.tbName, property.value);
- // set the type, if it is an attribute with a type
- if (property.type)
- aTBContact.setValue(obj.tbName + "Type", property.type);
+ if (property.type) {aTBContact.setValue(obj.tbName + "Type", property.type);}
}
}
// TODO:
@@ -593,7 +590,7 @@ com.gContactSync.ContactConverter = {
// Groups
// Photo
// Phonetic names
- if (tbContactUpdated) aTBContact.update();
+ if (tbContactUpdated) {aTBContact.update();}
return gContactUpdated;
},
/**
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/gcontactsync.git
More information about the Pkg-mozext-commits
mailing list