comparison modules/service.js @ 358:c00b3db58dcf

add 'snowl' to all observer topics to avoid conflicts with other extensions/core code; use the Observers component everywhere
author Myk Melez <myk@mozilla.org>
date Tue, 04 Nov 2008 12:11:07 -0800
parents 1db123f46ed7
children 6916b17a0536
comparison
equal deleted inserted replaced
357:1db123f46ed7 358:c00b3db58dcf
74 getService(Ci.nsIPrefService). 74 getService(Ci.nsIPrefService).
75 QueryInterface(Ci.nsIPrefBranch). 75 QueryInterface(Ci.nsIPrefBranch).
76 QueryInterface(Ci.nsIPrefBranch2); 76 QueryInterface(Ci.nsIPrefBranch2);
77 this.__defineGetter__("_prefSvc", function() { return prefSvc }); 77 this.__defineGetter__("_prefSvc", function() { return prefSvc });
78 return this._prefSvc; 78 return this._prefSvc;
79 },
80
81 // Observer Service
82 get _obsSvc() {
83 let obsSvc = Cc["@mozilla.org/observer-service;1"].
84 getService(Ci.nsIObserverService);
85 delete this._obsSvc;
86 this._obsSvc = obsSvc;
87 return this._obsSvc;
88 }, 79 },
89 80
90 get _dirSvc() { 81 get _dirSvc() {
91 let dirSvc = Cc["@mozilla.org/file/directory_service;1"]. 82 let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
92 getService(Ci.nsIProperties); 83 getService(Ci.nsIProperties);
235 let row = this._getAccountsStatement.row; 226 let row = this._getAccountsStatement.row;
236 227
237 let type; 228 let type;
238 try { 229 try {
239 type = eval(row.type); 230 type = eval(row.type);
240 this._log.info("got " + row.type + " for " + row.name);
241 } 231 }
242 catch(ex) { 232 catch(ex) {
243 this._log.error("error getting " + row.name + ": " + ex); 233 this._log.error("error getting " + row.name + ": " + ex);
244 continue; 234 continue;
245 } 235 }