[Pkg-mozext-commits] [gcontactsync] 72/88: Issue #44: 'null null' phonetic names added by v0.4.0rc8

David Prévot taffit at moszumanska.debian.org
Thu Sep 18 20:52:31 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 247316a44b0d82e6dbd956b9c3c2bf13d14cc939
Author: Josh Geenen <joshgeenen at gmail.com>
Date:   Wed Jul 23 22:42:46 2014 -0500

    Issue #44: 'null null' phonetic names added by v0.4.0rc8
---
 src/content/ContactConverter.js | 1 +
 src/content/GContact.js         | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/content/ContactConverter.js b/src/content/ContactConverter.js
index b91b911..2d4be23 100644
--- a/src/content/ContactConverter.js
+++ b/src/content/ContactConverter.js
@@ -339,6 +339,7 @@ com.gContactSync.ContactConverter = {
     if (com.gContactSync.Preferences.mSyncPrefs.syncPhoneticNames.value) {
       var phonFirstName = aTBContact.getValue("PhoneticFirstName");
       var phonLastName = aTBContact.getValue("PhoneticLastName");
+      com.gContactSync.LOGGER.VERBOSE_LOG(" * Phonetic: " + phonFirstName + " " + phonLastName);
       aGContact.setAttribute("givenName",
                              com.gContactSync.gdata.namespaces.GD.url,
                              0,
diff --git a/src/content/GContact.js b/src/content/GContact.js
index 1f9c302..3b1cb8d 100644
--- a/src/content/GContact.js
+++ b/src/content/GContact.js
@@ -1011,11 +1011,13 @@ com.gContactSync.GContact.prototype = {
    */
   setAttribute: function GContact_setAttribute(aTagName, aNamespace, aIndex, aAttributeName, aValue) {
     var elems = this.xml.getElementsByTagNameNS(aNamespace, aTagName);
-    if (elems.length > aIndex && aIndex >= 0) {
+    if (elems.length <= aIndex || aIndex < 0) {return false;}
+    if (aValue) {
       elems[aIndex].setAttribute(aAttributeName, aValue);
-      return true;
+    } else {
+      elems[aIndex].removeAttribute(aAttributeName);
     }
-    return false;
+    return true;
   },
   /**
    * Gets the value of a given attribute for the ith element with the given

-- 
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