Bug 514976 - Inline mailSessionContractID string/value.

r=neil sr=Standard8.
This commit is contained in:
Saint Wesonga 2010-01-20 06:24:36 +01:00
Родитель 74c43c47db
Коммит ef8631ea2f
8 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -449,9 +449,9 @@ function ViewPageSource(messages)
try {
// First, get the mail session
const mailSessionContractID = "@mozilla.org/messenger/services/session;1";
const nsIMsgMailSession = Components.interfaces.nsIMsgMailSession;
var mailSession = Components.classes[mailSessionContractID].getService(nsIMsgMailSession);
var mailSession = Components.classes["@mozilla.org/messenger/services/session;1"]
.getService(nsIMsgMailSession);
var mailCharacterSet = "charset=" + msgWindow.mailCharacterSet;
for (var i = 0; i < numMessages; i++)

Просмотреть файл

@ -513,11 +513,11 @@ function SearchNewFolderOkCallback(name, uri)
imapFolder = msgFolder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
}
catch(ex) {}
var mailSessionContractID = "@mozilla.org/messenger/services/session;1";
if (imapFolder) //imapFolder creation is asynchronous.
{
if (!gMailSession)
gMailSession = Components.classes[mailSessionContractID].getService(Components.interfaces.nsIMsgMailSession);
gMailSession = Components.classes["@mozilla.org/messenger/services/session;1"]
.getService(Components.interfaces.nsIMsgMailSession);
try
{
var nsIFolderListener = Components.interfaces.nsIFolderListener;

Просмотреть файл

@ -3,12 +3,11 @@
* Test suite for nsMsgMailSession functions relating to listeners.
*/
const mailSessionContractID = "@mozilla.org/messenger/services/session;1";
const nsIMsgMailSession = Components.interfaces.nsIMsgMailSession;
const nsIFolderListener = Components.interfaces.nsIFolderListener;
const numListenerFunctions = 8;
var gMailSession = Components.classes[mailSessionContractID]
var gMailSession = Components.classes["@mozilla.org/messenger/services/session;1"]
.getService(nsIMsgMailSession);
var gMailSessionNotifier = gMailSession.QueryInterface(nsIFolderListener);

Просмотреть файл

@ -1007,7 +1007,8 @@ function setupXFVirtualFolderSearch(folderUrisToSearch, searchTerms, searchOnlin
gSearchSession = Components.classes[searchSessionContractID].createInstance(Components.interfaces.nsIMsgSearchSession);
gMailSession = Components.classes[mailSessionContractID].getService(Components.interfaces.nsIMsgMailSession);
gMailSession = Components.classes["@mozilla.org/messenger/services/session;1"]
.getService(Components.interfaces.nsIMsgMailSession);
for (i in folderUrisToSearch)
{

Просмотреть файл

@ -450,9 +450,9 @@ function ViewPageSource(messages)
try {
// First, get the mail session
const mailSessionContractID = "@mozilla.org/messenger/services/session;1";
const nsIMsgMailSession = Components.interfaces.nsIMsgMailSession;
var mailSession = Components.classes[mailSessionContractID].getService(nsIMsgMailSession);
var mailSession = Components.classes["@mozilla.org/messenger/services/session;1"]
.getService(nsIMsgMailSession);
var mailCharacterSet = "charset=" + msgWindow.mailCharacterSet;

Просмотреть файл

@ -658,7 +658,7 @@ function CheckForMessageIdInFolder(folder, messageId)
if (!gMailSession)
{
gMailSession = Components.classes[mailSessionContractID]
gMailSession = Components.classes["@mozilla.org/messenger/services/session;1"]
.getService(Components.interfaces.nsIMsgMailSession);
}

Просмотреть файл

@ -42,7 +42,6 @@
//This file stores variables common to mail windows
var messengerContractID = "@mozilla.org/messenger;1";
var statusFeedbackContractID = "@mozilla.org/messenger/statusfeedback;1";
var mailSessionContractID = "@mozilla.org/messenger/services/session;1";
var secureUIContractID = "@mozilla.org/secure_browser_ui;1";
var msgWindowContractID = "@mozilla.org/messenger/msgwindow;1";
@ -96,7 +95,8 @@ function OnMailWindowUnload()
dbview.close();
}
var mailSession = Components.classes[mailSessionContractID].getService();
var mailSession = Components.classes["@mozilla.org/messenger/services/session;1"]
.getService();
if (mailSession instanceof Components.interfaces.nsIMsgMailSession)
mailSession.RemoveFolderListener(folderListener);
mailSession.RemoveMsgWindow(msgWindow);

Просмотреть файл

@ -958,7 +958,7 @@ function loadStartFolder(initialUri)
function AddToSession()
{
try {
var mailSession = Components.classes[mailSessionContractID]
var mailSession = Components.classes["@mozilla.org/messenger/services/session;1"]
.getService(Components.interfaces.nsIMsgMailSession);
var nsIFolderListener = Components.interfaces.nsIFolderListener;
var notifyFlags = nsIFolderListener.intPropertyChanged | nsIFolderListener.event;