зеркало из https://github.com/mozilla/pjs.git
Add NotifyFolderLoaded.
This commit is contained in:
Родитель
f9811e89db
Коммит
53297d3499
|
@ -281,6 +281,25 @@ NS_IMETHODIMP nsMsgMailSession::NotifyFolderItemDeleted(nsIFolder *folder, nsISu
|
|||
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgMailSession::NotifyFolderLoaded(nsIFolder *folder)
|
||||
{
|
||||
|
||||
nsresult rv;
|
||||
PRUint32 count;
|
||||
rv = mListeners->Count(&count);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
||||
for(PRUint32 i = 0; i < count; i++)
|
||||
{
|
||||
nsCOMPtr<nsIFolderListener> listener = getter_AddRefs((nsIFolderListener*)mListeners->ElementAt(i));
|
||||
listener->OnFolderLoaded(folder);
|
||||
}
|
||||
return NS_OK;
|
||||
|
||||
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewMsgMailSession(const nsIID& iid, void **result)
|
||||
{
|
||||
|
|
|
@ -303,7 +303,7 @@ NS_IMETHODIMP nsMsgDBFolder::OnKeyChange(nsMsgKey aKeyChanged, PRUint32 aOldFlag
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgDBFolder::OnKeyDeleted(nsMsgKey aKeyChanged, nsMsgKey /* aParentKey */, PRInt32 aFlags,
|
||||
NS_IMETHODIMP nsMsgDBFolder::OnKeyDeleted(nsMsgKey aKeyChanged, nsMsgKey aParentKey, PRInt32 aFlags,
|
||||
nsIDBChangeListener * aInstigator)
|
||||
{
|
||||
nsCOMPtr<nsIMsgDBHdr> pMsgDBHdr;
|
||||
|
@ -326,7 +326,7 @@ NS_IMETHODIMP nsMsgDBFolder::OnKeyDeleted(nsMsgKey aKeyChanged, nsMsgKey /* aPar
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgDBFolder::OnKeyAdded(nsMsgKey aKeyChanged, nsMsgKey /* aParentKey */, PRInt32 aFlags,
|
||||
NS_IMETHODIMP nsMsgDBFolder::OnKeyAdded(nsMsgKey aKeyChanged, nsMsgKey aParentKey , PRInt32 aFlags,
|
||||
nsIDBChangeListener * aInstigator)
|
||||
{
|
||||
nsresult rv;
|
||||
|
@ -509,13 +509,7 @@ nsMsgDBFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode)
|
|||
PRBool updatingFolder = PR_FALSE;
|
||||
if (NS_SUCCEEDED(mailUrl->GetUpdatingFolder(&updatingFolder)) && updatingFolder)
|
||||
{
|
||||
PRInt32 i;
|
||||
for(i = 0; i < mListeners->Count(); i++)
|
||||
{
|
||||
//Folderlistener's aren't refcounted.
|
||||
nsIFolderListener *listener = (nsIFolderListener*)mListeners->ElementAt(i);
|
||||
listener->OnFolderLoaded(this);
|
||||
}
|
||||
NotifyFolderLoaded();
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
|
|
@ -1664,6 +1664,24 @@ nsresult nsMsgFolder::NotifyItemDeleted(nsISupports *item)
|
|||
|
||||
}
|
||||
|
||||
nsresult nsMsgFolder::NotifyFolderLoaded()
|
||||
{
|
||||
PRInt32 i;
|
||||
for(i = 0; i < mListeners->Count(); i++)
|
||||
{
|
||||
//Folderlistener's aren't refcounted.
|
||||
nsIFolderListener *listener = (nsIFolderListener*)mListeners->ElementAt(i);
|
||||
listener->OnFolderLoaded(this);
|
||||
}
|
||||
//Notify listeners who listen to every folder
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIMsgMailSession, mailSession, kMsgMailSessionCID, &rv);
|
||||
if(NS_SUCCEEDED(rv))
|
||||
mailSession->NotifyFolderLoaded(this);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsGetMailFolderSeparator(nsString& result)
|
||||
|
|
|
@ -304,6 +304,7 @@ protected:
|
|||
nsresult NotifyItemAdded(nsISupports *item);
|
||||
nsresult NotifyItemDeleted(nsISupports *item);
|
||||
|
||||
nsresult NotifyFolderLoaded();
|
||||
// this is a little helper function that is not part of the public interface.
|
||||
// we use it to get the IID of the incoming server for the derived folder.
|
||||
// w/out a function like this we would have to implement GetServer in each
|
||||
|
|
Загрузка…
Ссылка в новой задаче