зеркало из https://github.com/mozilla/gecko-dev.git
Do status flag notifications based on flags changed.
This commit is contained in:
Родитель
b4451c062e
Коммит
9febadf761
|
@ -152,6 +152,20 @@ nsresult nsMsgDBFolder::ReadDBFolderInfo(PRBool force)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsresult nsMsgDBFolder::SendFlagNotifications(nsISupports *item, PRUint32 oldFlags, PRUint32 newFlags)
|
||||||
|
{
|
||||||
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
|
PRUint32 changedFlags = oldFlags ^ newFlags;
|
||||||
|
if((changedFlags & MSG_FLAG_READ) || (changedFlags & MSG_FLAG_REPLIED)
|
||||||
|
|| (changedFlags & MSG_FLAG_MARKED) || (changedFlags & MSG_FLAG_FORWARDED)
|
||||||
|
|| (changedFlags & MSG_FLAG_NEW))
|
||||||
|
{
|
||||||
|
rv = NotifyPropertyFlagChanged(item, "Status", oldFlags, newFlags);
|
||||||
|
}
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsMsgDBFolder::OnKeyChange(nsMsgKey aKeyChanged, PRUint32 aOldFlags, PRUint32 aNewFlags,
|
NS_IMETHODIMP nsMsgDBFolder::OnKeyChange(nsMsgKey aKeyChanged, PRUint32 aOldFlags, PRUint32 aNewFlags,
|
||||||
nsIDBChangeListener * aInstigator)
|
nsIDBChangeListener * aInstigator)
|
||||||
{
|
{
|
||||||
|
@ -166,7 +180,7 @@ NS_IMETHODIMP nsMsgDBFolder::OnKeyChange(nsMsgKey aKeyChanged, PRUint32 aOldFlag
|
||||||
nsCOMPtr<nsISupports> msgSupports(do_QueryInterface(message, &rv));
|
nsCOMPtr<nsISupports> msgSupports(do_QueryInterface(message, &rv));
|
||||||
if(NS_SUCCEEDED(rv))
|
if(NS_SUCCEEDED(rv))
|
||||||
{
|
{
|
||||||
NotifyPropertyFlagChanged(msgSupports, "Status", aOldFlags, aNewFlags);
|
SendFlagNotifications(msgSupports, aOldFlags, aNewFlags);
|
||||||
}
|
}
|
||||||
UpdateSummaryTotals();
|
UpdateSummaryTotals();
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
virtual nsresult ReadDBFolderInfo(PRBool force);
|
virtual nsresult ReadDBFolderInfo(PRBool force);
|
||||||
virtual nsresult GetDatabase() = 0;
|
virtual nsresult GetDatabase() = 0;
|
||||||
|
virtual nsresult SendFlagNotifications(nsISupports *item, PRUint32 oldFlags, PRUint32 newFlags);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsCOMPtr<nsIMsgDatabase> mDatabase;
|
nsCOMPtr<nsIMsgDatabase> mDatabase;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче