зеркало из https://github.com/mozilla/pjs.git
94660 r/sr=bienvenu. Update the imapHostSession object when the imap delete model is changed during a
session.
This commit is contained in:
Родитель
475036e9ed
Коммит
f1212c22b9
|
@ -1404,7 +1404,6 @@ nsMsgDBView::CopyMessages(nsIMsgWindow *window, nsMsgViewIndex *indices, PRInt32
|
|||
if (msgHdr)
|
||||
messageArray->AppendElement(msgHdr);
|
||||
}
|
||||
|
||||
m_deletingMsgs = isMove;
|
||||
rv = destFolder->CopyMessages(m_folder /* source folder */, messageArray, isMove, window, this /* listener */, PR_FALSE /* isFolder */, PR_TRUE /*allowUndo*/);
|
||||
|
||||
|
@ -4260,6 +4259,10 @@ nsMsgDBView::GetMsgToSelectAfterDelete(nsMsgViewIndex *msgToSelectAfterDelete)
|
|||
rv = mOutlinerSelection->GetRangeAt(i, &startRange, &endRange);
|
||||
*msgToSelectAfterDelete = PR_MIN(*msgToSelectAfterDelete, startRange);
|
||||
}
|
||||
nsCOMPtr <nsIMsgImapMailFolder> imapFolder = do_QueryInterface(m_folder);
|
||||
PRBool thisIsImapFolder = (imapFolder != nsnull);
|
||||
if (thisIsImapFolder) //need to update the imap-delete model, can change more than once in a session.
|
||||
GetImapDeleteModel(nsnull);
|
||||
if (mDeleteModel == nsMsgImapDeleteModels::IMAPDelete)
|
||||
if (selectionCount > 1 || (endRange-startRange) > 0) //multiple selection either using Ctrl or Shift keys
|
||||
*msgToSelectAfterDelete = nsMsgViewIndex_None;
|
||||
|
|
|
@ -116,7 +116,7 @@ nsMsgIncomingServer::SetKey(const char * serverKey)
|
|||
NS_GET_IID(nsIPref),
|
||||
(nsISupports**)&m_prefs);
|
||||
|
||||
m_serverKey = serverKey;
|
||||
m_serverKey.Assign(serverKey);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -999,8 +999,8 @@ nsMsgIncomingServer::GetFilterList(nsIMsgFilterList **aResult)
|
|||
NS_IF_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// if the user has a : appended, then
|
||||
nsresult
|
||||
nsMsgIncomingServer::SetHostName(const char *aHostname)
|
||||
|
@ -1297,7 +1297,6 @@ nsMsgIncomingServer::SetOfflineSupportLevel(PRInt32 aSupportLevel)
|
|||
SetIntValue("offline_support_level", aSupportLevel);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#define BASE_MSGS_URL "chrome://messenger/locale/messenger.properties"
|
||||
|
||||
NS_IMETHODIMP nsMsgIncomingServer::DisplayOfflineMsg(nsIMsgWindow *aMsgWindow)
|
||||
|
|
|
@ -55,11 +55,11 @@ class NS_MSG_BASE nsMsgIncomingServer : public nsIMsgIncomingServer,
|
|||
|
||||
private:
|
||||
nsIPref *m_prefs;
|
||||
nsCString m_serverKey;
|
||||
nsCString m_password;
|
||||
PRBool m_serverBusy;
|
||||
|
||||
protected:
|
||||
nsCString m_serverKey;
|
||||
void getPrefName(const char *serverKey, const char *pref, nsCString& fullPrefName);
|
||||
void getDefaultPrefName(const char *pref, nsCString& fullPrefName);
|
||||
|
||||
|
|
|
@ -359,7 +359,16 @@ nsImapIncomingServer::GetDeleteModel(PRInt32 *retval)
|
|||
NS_IMETHODIMP \
|
||||
nsImapIncomingServer::SetDeleteModel(PRInt32 ivalue)
|
||||
{ \
|
||||
return SetIntValue("delete_model", ivalue);
|
||||
nsresult rv = SetIntValue("delete_model", ivalue);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
nsCOMPtr<nsIImapHostSessionList> hostSession =
|
||||
do_GetService(kCImapHostSessionList, &rv);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
hostSession->SetDeleteIsMoveToTrashForHost(m_serverKey, ivalue == nsMsgImapDeleteModels::MoveToTrash);
|
||||
hostSession->SetShowDeletedMessagesForHost(m_serverKey, ivalue == nsMsgImapDeleteModels::IMAPDelete);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMPL_SERVERPREF_INT(nsImapIncomingServer, TimeOutLimits,
|
||||
|
|
Загрузка…
Ссылка в новой задаче