зеркало из https://github.com/mozilla/gecko-dev.git
Bug #97486 --> be sure to clear out the server prefs when deleting an smtp server
r=bhuvan sr=sspitzer a=asa
This commit is contained in:
Родитель
7e32fb8c0d
Коммит
a4f0e8a2b1
|
@ -43,4 +43,6 @@ interface nsISmtpServer : nsISupports {
|
|||
void getUsernamePasswordWithUI(in wstring promptString, in wstring promptTitle,
|
||||
in nsIAuthPrompt netPrompt, out string userid, out string password);
|
||||
void forgetPassword();
|
||||
|
||||
void clearAllValues();
|
||||
};
|
||||
|
|
|
@ -415,3 +415,25 @@ nsSmtpServer::GetRedirectorType(char **aResult)
|
|||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSmtpServer::ClearAllValues()
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCAutoString rootPref("mail.smtpserver.");
|
||||
rootPref += mKey;
|
||||
|
||||
rv = prefs->EnumerateChildren(rootPref, clearPrefEnum, (void *)prefs.get());
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsSmtpServer::clearPrefEnum(const char *aPref, void *aClosure)
|
||||
{
|
||||
nsIPref *prefs = (nsIPref *)aClosure;
|
||||
prefs->ClearUserPref(aPref);
|
||||
}
|
||||
|
|
|
@ -44,8 +44,7 @@ private:
|
|||
nsresult getPrefString(const char *pref, nsCAutoString& result);
|
||||
nsresult getDefaultIntPref(nsIPref *prefs, PRInt32 defVal, const char *prefName, PRInt32 *val);
|
||||
nsCString m_password;
|
||||
static void clearPrefEnum(const char *aPref, void *aClosure);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -814,6 +814,9 @@ nsSmtpService::DeleteSmtpServer(nsISmtpServer *aServer)
|
|||
token = nsCRT::strtok(newStr, ",", &newStr);
|
||||
}
|
||||
|
||||
// make sure the server clears out it's values....
|
||||
aServer->ClearAllValues();
|
||||
|
||||
mServerKeyList = newServerList;
|
||||
saveKeyList();
|
||||
return rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче