1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-24 00:32:27 +01:00

Change remaining Components.{classes,interfaces,results} -> C[cir].

This commit is contained in:
Doug Kearns
2009-06-15 19:40:31 +10:00
parent 6201338184
commit 4570c6ced5
5 changed files with 21 additions and 31 deletions

View File

@@ -1,7 +1,5 @@
const win = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] const win = Cc["@mozilla.org/embedcomp/window-watcher;1"].getService(Ci.nsIWindowWatcher).activeWindow;
.getService(Components.interfaces.nsIWindowWatcher)
.activeWindow;
const liberator = win.liberator; const liberator = win.liberator;
let page = liberator.findHelp(decodeURIComponent(document.location.search.substr(1))); let page = liberator.findHelp(decodeURIComponent(document.location.search.substr(1)));

View File

@@ -32,10 +32,8 @@ function Addressbook() //{{{
////////////////////// PRIVATE SECTION ///////////////////////////////////////// ////////////////////// PRIVATE SECTION /////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{ /////////////////////////////////////////////////////////////////////////////{{{
const abManager = Components.classes["@mozilla.org/abmanager;1"] const abManager = Cc["@mozilla.org/abmanager;1"].getService(Ci.nsIAbManager);
.getService(Components.interfaces.nsIAbManager); const rdf = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
const rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"]
.getService(Components.interfaces.nsIRDFService);
const kPersonalAddressbookURI = "moz-abmdbdirectory://abook.mab"; const kPersonalAddressbookURI = "moz-abmdbdirectory://abook.mab";
@@ -55,7 +53,7 @@ function Addressbook() //{{{
function getDirectoryFromURI(uri) function getDirectoryFromURI(uri)
{ {
return rdf.GetResource(uri).QueryInterface(Components.interfaces.nsIAbDirectory); return rdf.GetResource(uri).QueryInterface(Ci.nsIAbDirectory);
} }
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
@@ -142,8 +140,7 @@ function Addressbook() //{{{
add: function (address, firstname, lastname, displayName) add: function (address, firstname, lastname, displayName)
{ {
let directory = getDirectoryFromURI(kPersonalAddressbookURI); let directory = getDirectoryFromURI(kPersonalAddressbookURI);
let card = Components.classes["@mozilla.org/addressbook/cardproperty;1"] let card = Cc["@mozilla.org/addressbook/cardproperty;1"].createInstance(Ci.nsIAbCard);
.createInstance(Components.interfaces.nsIAbCard);
if (!address || !directory || !card) if (!address || !directory || !card)
return false; return false;
@@ -165,11 +162,11 @@ function Addressbook() //{{{
while (dirs.hasMoreElements()) while (dirs.hasMoreElements())
{ {
let addrbook = dirs.getNext().QueryInterface(Components.interfaces.nsIAbDirectory); let addrbook = dirs.getNext().QueryInterface(Ci.nsIAbDirectory);
let cards = addrbook.childCards; let cards = addrbook.childCards;
while (cards.hasMoreElements()) while (cards.hasMoreElements())
{ {
let card = cards.getNext().QueryInterface(Components.interfaces.nsIAbCard); let card = cards.getNext().QueryInterface(Ci.nsIAbCard);
//var mail = card.primaryEmail || ""; //XXX //var mail = card.primaryEmail || ""; //XXX
let displayName = card.displayName; let displayName = card.displayName;
if (!displayName) if (!displayName)

View File

@@ -71,7 +71,7 @@ const config = { //{{{
["checkupdates", "Check for updates", ["checkupdates", "Check for updates",
function () { window.checkForUpdates(); }], function () { window.checkForUpdates(); }],
/*["cleardata", "Clear private data", /*["cleardata", "Clear private data",
function () { Components.classes[GLUE_CID].getService(Components.interfaces.nsIBrowserGlue).sanitize(window || null); }],*/ function () { Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null); }],*/
["console", "JavaScript console", ["console", "JavaScript console",
function () { window.toJavaScriptConsole(); }], function () { window.toJavaScriptConsole(); }],
/*["customizetoolbar", "Customize the Toolbar", /*["customizetoolbar", "Customize the Toolbar",
@@ -217,9 +217,9 @@ const config = { //{{{
{ {
QueryInterface: function (id) QueryInterface: function (id)
{ {
if (id.equals(Components.interfaces.nsIDocumentStateListener)) if (id.equals(Ci.nsIDocumentStateListener))
return this; return this;
throw Components.results.NS_NOINTERFACE; throw Cr.NS_NOINTERFACE;
}, },
// this is (also) fired once the new compose window loaded the message for the first time // this is (also) fired once the new compose window loaded the message for the first time

View File

@@ -55,7 +55,7 @@ function Mail() //{{{
{ {
if (folder) if (folder)
{ {
let msgFolder = folder.QueryInterface(Components.interfaces.nsIMsgFolder); let msgFolder = folder.QueryInterface(Ci.nsIMsgFolder);
autocommands.trigger("FolderLoaded", { url: msgFolder }); autocommands.trigger("FolderLoaded", { url: msgFolder });
// Jump to a message when requested // Jump to a message when requested
@@ -85,9 +85,8 @@ function Mail() //{{{
} }
}; };
var mailSession = Components.classes["@mozilla.org/messenger/services/session;1"] var mailSession = Cc["@mozilla.org/messenger/services/session;1"].getService(Ci.nsIMsgMailSession);
.getService(Components.interfaces.nsIMsgMailSession); var nsIFolderListener = Ci.nsIFolderListener;
var nsIFolderListener = Components.interfaces.nsIFolderListener;
var notifyFlags = nsIFolderListener.intPropertyChanged | nsIFolderListener.event; var notifyFlags = nsIFolderListener.intPropertyChanged | nsIFolderListener.event;
mailSession.AddFolderListener(folderListener, notifyFlags); mailSession.AddFolderListener(folderListener, notifyFlags);
@@ -784,10 +783,8 @@ function Mail() //{{{
composeNewMail: function (args) composeNewMail: function (args)
{ {
let params = Components.classes["@mozilla.org/messengercompose/composeparams;1"] let params = Cc["@mozilla.org/messengercompose/composeparams;1"].createInstance(Ci.nsIMsgComposeParams);
.createInstance(Components.interfaces.nsIMsgComposeParams); params.composeFields = Cc["@mozilla.org/messengercompose/composefields;1"].createInstance(Ci.nsIMsgCompFields);
params.composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"]
.createInstance(Components.interfaces.nsIMsgCompFields);
if (args) if (args)
{ {
@@ -815,18 +812,17 @@ function Mail() //{{{
if (!file.exists()) if (!file.exists())
return void liberator.echoerr("Exxx: Could not attach file `" + url + "'", commandline.FORCE_SINGLELINE); return void liberator.echoerr("Exxx: Could not attach file `" + url + "'", commandline.FORCE_SINGLELINE);
attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"] attachment = Cc["@mozilla.org/messengercompose/attachment;1"].createInstance(Ci.nsIMsgAttachment);
.createInstance(Components.interfaces.nsIMsgAttachment);
attachment.url = "file://" + file.path; attachment.url = "file://" + file.path;
params.composeFields.addAttachment(attachment); params.composeFields.addAttachment(attachment);
} }
} }
} }
params.type = Components.interfaces.nsIMsgCompType.New; params.type = Ci.nsIMsgCompType.New;
const msgComposeService = Components.classes["@mozilla.org/messengercompose;1"].getService(); const msgComposeService = Cc["@mozilla.org/messengercompose;1"].getService();
msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService); msgComposeService = msgComposeService.QueryInterface(Ci.nsIMsgComposeService);
msgComposeService.OpenComposeWindowWithParams(null, params); msgComposeService.OpenComposeWindowWithParams(null, params);
}, },
@@ -1029,7 +1025,7 @@ function Mail() //{{{
while (msgs.hasMoreElements()) while (msgs.hasMoreElements())
{ {
let msg = msgs.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr); let msg = msgs.getNext().QueryInterface(Ci.nsIMsgDBHdr);
if (validatorFunc(msg)) if (validatorFunc(msg))
{ {
count--; count--;

View File

@@ -231,8 +231,7 @@ const config = { //{{{
else else
{ {
let pane = document.getElementById(id); let pane = document.getElementById(id);
let manager = Components.classes['@songbirdnest.com/Songbird/DisplayPane/Manager;1'] let manager = Cc['@songbirdnest.com/Songbird/DisplayPane/Manager;1'].getService(Ci.sbIDisplayPaneManager);
.getService(Components.interfaces.sbIDisplayPaneManager);
let paneinfo = manager.getPaneInfo(pane._lastURL.stringValue); let paneinfo = manager.getPaneInfo(pane._lastURL.stringValue);
if (!paneinfo) if (!paneinfo)