[Pkg-mozext-commits] [gcontactsync] 17/88: Added the getGAbByName function
David Prévot
taffit at moszumanska.debian.org
Thu Sep 18 20:52:25 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 2f9192fcd6e0ea287165b411d3a45b7f5a933747
Author: Josh Geenen <joshgeenen at gmail.com>
Date: Sat Dec 28 11:29:25 2013 -0600
Added the getGAbByName function
---
src/content/GAbManager.js | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/content/GAbManager.js b/src/content/GAbManager.js
index b3cba5e..f71817b 100644
--- a/src/content/GAbManager.js
+++ b/src/content/GAbManager.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2008-2011
+ * Portions created by the Initial Developer are Copyright (C) 2008-2013
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -34,9 +34,9 @@
*
* ***** END LICENSE BLOCK ***** */
-if (!com) var com = {}; // A generic wrapper variable
+if (!com) {var com = {};} // A generic wrapper variable
// A wrapper for all GCS functions and variables
-if (!com.gContactSync) com.gContactSync = {};
+if (!com.gContactSync) {com.gContactSync = {};}
/**
* An object that can obtain address books by the name or URI, find the synced
@@ -204,6 +204,19 @@ com.gContactSync.GAbManager.getGAbByURI = function GAbManager_getGAbByURI(aURI)
};
/**
+ * Returns the Address Book if it can be found. If it cannot be found
+ * it tries once to make it and return the newly made address book.
+ * @param aDirName {string} The name of the address book.
+ * @param aDontMakeAb {boolean} True if the address book shouldn't be created
+ * if not found.
+ * @returns {GAddressBook} The GAddressBook with the name given, null if not found and
+ * aDontMakeAb is true.
+ */
+com.gContactSync.GAbManager.getGAbByName = function GAbManager_getGAbByName(aDirName, aDontMakeAb) {
+ return this.getGAb(this.getAbByName(aDirName, aDontMakeAb));
+};
+
+/**
* Returns a GAddressBook object for the given nsIAbDirectory.
* If a GAddressBook for the directory's URI or pref branch has already been
* returned and is still stored, it is returned and no new object is created.
--
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