зеркало из https://github.com/mozilla/gecko-dev.git
Bug 337943 Remove nsIAbCard::cardType and nsIAbCard::defaultEmail. r/sr=bienvenu
This commit is contained in:
Родитель
771cf57d5d
Коммит
58f15d71a9
|
@ -408,7 +408,7 @@ function AbEditCard(card)
|
|||
{
|
||||
// Need a card,
|
||||
// but not allowing AOL special groups to be edited.
|
||||
if (!card || card.isASpecialGroup)
|
||||
if (!card)
|
||||
return;
|
||||
|
||||
if (card.isMailList) {
|
||||
|
|
|
@ -37,21 +37,6 @@
|
|||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
%{C++
|
||||
// Constants used for default email.
|
||||
// "0": screen name, "1": other email #1, "2": other email #2
|
||||
#define AB_DEFAULT_EMAIL_IS_SCREEN_NAME "0"
|
||||
#define AB_DEFAULT_EMAIL_IS_EMAIL_1 "1"
|
||||
#define AB_DEFAULT_EMAIL_IS_EMAIL_2 "2"
|
||||
|
||||
// Constants used for card types.
|
||||
// "" or "0": normal, "1": AOL groups, "2": AOL additional email address
|
||||
#define AB_CARD_IS_NORMAL_CARD "0"
|
||||
#define AB_CARD_IS_AOL_GROUPS "1"
|
||||
#define AB_CARD_IS_AOL_ADDITIONAL_EMAIL "2"
|
||||
|
||||
%}
|
||||
|
||||
[scriptable, uuid(97448252-F189-11d4-A422-001083003D0C)]
|
||||
interface nsIAbPreferMailFormat {
|
||||
const unsigned long unknown = 0;
|
||||
|
@ -59,7 +44,7 @@ interface nsIAbPreferMailFormat {
|
|||
const unsigned long html = 2;
|
||||
};
|
||||
|
||||
[scriptable, uuid(182071F5-63E2-4456-A095-DEBC0380BC86)]
|
||||
[scriptable, uuid(f1c34c6e-a211-4aa6-bdb6-e200c58db1d0)]
|
||||
interface nsIAbCard : nsISupports {
|
||||
// Card properties
|
||||
attribute wstring firstName;
|
||||
|
@ -70,8 +55,6 @@ interface nsIAbCard : nsISupports {
|
|||
attribute wstring nickName;
|
||||
attribute wstring primaryEmail;
|
||||
attribute wstring secondEmail;
|
||||
attribute wstring defaultEmail;
|
||||
attribute wstring cardType;
|
||||
attribute wstring workPhone;
|
||||
attribute wstring homePhone;
|
||||
attribute wstring faxNumber;
|
||||
|
@ -132,13 +115,6 @@ interface nsIAbCard : nsISupports {
|
|||
*/
|
||||
attribute string mailListURI;
|
||||
|
||||
/**
|
||||
* Card type helper attributes
|
||||
*/
|
||||
readonly attribute boolean isANormalCard;
|
||||
readonly attribute boolean isASpecialGroup;
|
||||
readonly attribute boolean isAnEmailAddress;
|
||||
|
||||
wstring getCardValue(in string name);
|
||||
|
||||
void setCardValue(in string attrname, in wstring value);
|
||||
|
|
|
@ -65,8 +65,6 @@ interface nsIMdbRow;
|
|||
#define kNicknameColumn "NickName"
|
||||
#define kPriEmailColumn "PrimaryEmail"
|
||||
#define k2ndEmailColumn "SecondEmail"
|
||||
#define kDefaultEmailColumn "DefaultEmail"
|
||||
#define kCardTypeColumn "CardType"
|
||||
#define kPreferMailFormatColumn "PreferMailFormat"
|
||||
#define kPopularityIndexColumn "PopularityIndex"
|
||||
#define kWorkPhoneColumn "WorkPhone"
|
||||
|
@ -138,7 +136,7 @@ interface nsAddrDBCommitType
|
|||
const long kCompressCommit = 3;
|
||||
};
|
||||
|
||||
[scriptable, uuid(10d20c23-4e1d-4f72-9d1b-06e09e88eb4f)]
|
||||
[scriptable, uuid(b979cae8-8ad4-46b7-8ccc-0a1193df15fd)]
|
||||
interface nsIAddrDatabase : nsIAddrDBAnnouncer {
|
||||
|
||||
/**
|
||||
|
@ -223,8 +221,6 @@ interface nsIAddrDatabase : nsIAddrDBAnnouncer {
|
|||
[noscript] void addNickName(in nsIMdbRow row, in string value);
|
||||
[noscript] void addPrimaryEmail(in nsIMdbRow row, in string value);
|
||||
[noscript] void add2ndEmail(in nsIMdbRow row, in string value);
|
||||
[noscript] void addDefaultEmail(in nsIMdbRow row, in string value);
|
||||
[noscript] void addCardType(in nsIMdbRow row, in string value);
|
||||
[noscript] void addWorkPhone(in nsIMdbRow row, in string value);
|
||||
[noscript] void addHomePhone(in nsIMdbRow row, in string value);
|
||||
[noscript] void addFaxNumber(in nsIMdbRow row, in string value);
|
||||
|
|
|
@ -385,8 +385,7 @@ function AbEditSelectedCard()
|
|||
function AbEditCard(card)
|
||||
{
|
||||
// Need a card,
|
||||
// but not allowing AOL special groups to be edited.
|
||||
if (!card || card.isASpecialGroup)
|
||||
if (!card)
|
||||
return;
|
||||
|
||||
if (card.isMailList) {
|
||||
|
|
|
@ -355,12 +355,6 @@ nsresult nsAbAutoCompleteSession::SearchCards(nsIAbDirectory* directory, nsAbAut
|
|||
card = do_QueryInterface(item, &rv);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
// Skip if it's not a normal card (ie, they can't be added as members).
|
||||
PRBool isNormal;
|
||||
rv = card->GetIsANormalCard(&isNormal);
|
||||
if (NS_FAILED(rv) || !isNormal)
|
||||
continue;
|
||||
|
||||
nsXPIDLString pEmailStr[MAX_NUMBER_OF_EMAIL_ADDRESSES]; //[0]=primary email, [1]=secondary email (no available with mailing list)
|
||||
nsXPIDLString pDisplayNameStr;
|
||||
nsXPIDLString pFirstNameStr;
|
||||
|
|
|
@ -138,35 +138,6 @@ NS_IMPL_ISUPPORTS1(nsAbCardProperty, nsIAbCard)
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsresult nsAbCardProperty::GetCardTypeFromString(const char *aCardTypeStr, PRBool aEmptyIsTrue, PRBool *aValue)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCardTypeStr);
|
||||
NS_ENSURE_ARG_POINTER(aValue);
|
||||
|
||||
*aValue = PR_FALSE;
|
||||
nsXPIDLString cardType;
|
||||
nsresult rv = GetCardType(getter_Copies(cardType));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
*aValue = ((aEmptyIsTrue && cardType.IsEmpty()) || cardType.Equals(NS_ConvertASCIItoUTF16(aCardTypeStr)));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAbCardProperty::GetIsANormalCard(PRBool *aIsNormal)
|
||||
{
|
||||
return GetCardTypeFromString(AB_CARD_IS_NORMAL_CARD, PR_TRUE, aIsNormal);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAbCardProperty::GetIsASpecialGroup(PRBool *aIsSpecailGroup)
|
||||
{
|
||||
return GetCardTypeFromString(AB_CARD_IS_AOL_GROUPS, PR_FALSE, aIsSpecailGroup);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAbCardProperty::GetIsAnEmailAddress(PRBool *aIsEmailAddress)
|
||||
{
|
||||
return GetCardTypeFromString(AB_CARD_IS_AOL_ADDITIONAL_EMAIL, PR_FALSE, aIsEmailAddress);
|
||||
}
|
||||
|
||||
nsresult nsAbCardProperty::GetAttributeName(PRUnichar **aName, nsString& value)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aName);
|
||||
|
@ -289,11 +260,8 @@ NS_IMETHODIMP nsAbCardProperty::GetCardValue(const char *attrname, PRUnichar **v
|
|||
case 'o':
|
||||
rv = GetCompany(value);
|
||||
break;
|
||||
case 'a': // CardType, Category
|
||||
if (attrname[2] == 't')
|
||||
rv = GetCategory(value);
|
||||
else
|
||||
rv = GetCardType(value);
|
||||
case 'a': // Category
|
||||
rv = GetCategory(value);
|
||||
break;
|
||||
case 'e':
|
||||
if (strlen(attrname) <= 14)
|
||||
|
@ -329,12 +297,7 @@ NS_IMETHODIMP nsAbCardProperty::GetCardValue(const char *attrname, PRUnichar **v
|
|||
if (attrname[1] == 'i')
|
||||
rv = GetDisplayName(value);
|
||||
else if (attrname[2] == 'f')
|
||||
{
|
||||
if ((attrname[7] == 'E'))
|
||||
rv = GetDefaultEmail(value);
|
||||
else
|
||||
rv = GetDefaultAddress(value);
|
||||
}
|
||||
rv = GetDefaultAddress(value);
|
||||
else
|
||||
rv = GetDepartment(value);
|
||||
break;
|
||||
|
@ -559,11 +522,8 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich
|
|||
case 'o':
|
||||
rv = SetCompany(value);
|
||||
break;
|
||||
case 'a': // CardType, Category
|
||||
if (attrname[2] == 't')
|
||||
rv = SetCategory(value);
|
||||
else
|
||||
rv = SetCardType(value);
|
||||
case 'a': // Category
|
||||
rv = SetCategory(value);
|
||||
break;
|
||||
case 'e':
|
||||
if (strlen(attrname) <= 14)
|
||||
|
@ -599,12 +559,7 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich
|
|||
if (attrname[1] == 'i')
|
||||
rv = SetDisplayName(value);
|
||||
else if (attrname[2] == 'f')
|
||||
{
|
||||
if ((attrname[7] == 'E'))
|
||||
rv = SetDefaultEmail(value);
|
||||
else
|
||||
rv = SetDefaultAddress(value);
|
||||
}
|
||||
rv = SetDefaultAddress(value);
|
||||
else
|
||||
rv = SetDepartment(value);
|
||||
break;
|
||||
|
@ -803,14 +758,6 @@ NS_IMETHODIMP
|
|||
nsAbCardProperty::GetSecondEmail(PRUnichar * *aSecondEmail)
|
||||
{ return GetAttributeName(aSecondEmail, m_SecondEmail); }
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAbCardProperty::GetDefaultEmail(PRUnichar * *aDefaultEmail)
|
||||
{ return GetAttributeName(aDefaultEmail, m_DefaultEmail); }
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAbCardProperty::GetCardType(PRUnichar * *aCardType)
|
||||
{ return GetAttributeName(aCardType, m_CardType); }
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAbCardProperty::GetWorkPhone(PRUnichar * *aWorkPhone)
|
||||
{ return GetAttributeName(aWorkPhone, m_WorkPhone); }
|
||||
|
@ -1019,14 +966,6 @@ NS_IMETHODIMP
|
|||
nsAbCardProperty::SetSecondEmail(const PRUnichar * aSecondEmail)
|
||||
{ return SetAttributeName(aSecondEmail, m_SecondEmail); }
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAbCardProperty::SetDefaultEmail(const PRUnichar * aDefaultEmail)
|
||||
{ return SetAttributeName(aDefaultEmail, m_DefaultEmail); }
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAbCardProperty::SetCardType(const PRUnichar * aCardType)
|
||||
{ return SetAttributeName(aCardType, m_CardType); }
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAbCardProperty::SetWorkPhone(const PRUnichar * aWorkPhone)
|
||||
{ return SetAttributeName(aWorkPhone, m_WorkPhone); }
|
||||
|
@ -1223,10 +1162,6 @@ NS_IMETHODIMP nsAbCardProperty::Copy(nsIAbCard* srcCard)
|
|||
SetPrimaryEmail(str);
|
||||
srcCard->GetSecondEmail(getter_Copies(str));
|
||||
SetSecondEmail(str);
|
||||
srcCard->GetDefaultEmail(getter_Copies(str));
|
||||
SetDefaultEmail(str);
|
||||
srcCard->GetCardType(getter_Copies(str));
|
||||
SetCardType(str);
|
||||
|
||||
PRUint32 format;
|
||||
srcCard->GetPreferMailFormat(&format);
|
||||
|
|
|
@ -80,8 +80,6 @@ protected:
|
|||
nsString m_NickName;
|
||||
nsString m_PrimaryEmail;
|
||||
nsString m_SecondEmail;
|
||||
nsString m_DefaultEmail;
|
||||
nsString m_CardType; // "", "0": normal, "1": AOL groups, "2": AOL additional email address
|
||||
nsString m_WorkPhone;
|
||||
nsString m_HomePhone;
|
||||
nsString m_FaxNumber;
|
||||
|
@ -138,7 +136,6 @@ private:
|
|||
nsresult AppendLine(const AppendItem &aItem, mozITXTToHTMLConv *aConv, nsString &aResult);
|
||||
nsresult AppendLabel(const AppendItem &aItem, nsIStringBundle *aBundle, mozITXTToHTMLConv *aConv, nsString &aResult);
|
||||
nsresult AppendCityStateZip(const AppendItem &aItem, nsIStringBundle *aBundle, mozITXTToHTMLConv *aConv, nsString &aResult);
|
||||
nsresult GetCardTypeFromString(const char *aCardTypeStr, PRBool aEmptyIsTrue, PRBool *aValue);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -553,9 +553,6 @@ void nsAbLDIFService::AddLdifColToDatabase(nsIMdbRow* newRow, char* typeSlot, ch
|
|||
else if (colType.EqualsLiteral("mozillacustom4"))
|
||||
mDatabase->AddCustom4(newRow, column.get());
|
||||
|
||||
else if (colType.EqualsLiteral("mozilladefaultemail"))
|
||||
mDatabase->AddDefaultEmail(newRow, column.get());
|
||||
|
||||
else if (colType.EqualsLiteral("mozillahomecountryname"))
|
||||
mDatabase->AddHomeCountry(newRow, column.get());
|
||||
|
||||
|
|
|
@ -153,10 +153,6 @@ NS_IMETHODIMP nsAbMDBCardProperty::CopyCard(nsIAbMDBCard* srcCardDB)
|
|||
SetPrimaryEmail(str);
|
||||
srcCard->GetSecondEmail(getter_Copies(str));
|
||||
SetSecondEmail(str);
|
||||
srcCard->GetDefaultEmail(getter_Copies(str));
|
||||
SetDefaultEmail(str);
|
||||
srcCard->GetCardType(getter_Copies(str));
|
||||
SetCardType(str);
|
||||
|
||||
PRUint32 format = nsIAbPreferMailFormat::unknown;
|
||||
srcCard->GetPreferMailFormat(&format);
|
||||
|
|
|
@ -705,12 +705,6 @@ NS_IMETHODIMP nsAbMDBDirectory::DropCard(nsIAbCard* aCard, PRBool needToCopyCard
|
|||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// Don't add the card if it's not a normal one (ie, they can't be added as members).
|
||||
PRBool isNormal;
|
||||
rv = aCard->GetIsANormalCard(&isNormal);
|
||||
if (!isNormal)
|
||||
return NS_OK;
|
||||
|
||||
NS_ASSERTION(!mURI.IsEmpty(), "Not initialized?");
|
||||
if (mIsMailingList == -1)
|
||||
{
|
||||
|
|
|
@ -121,8 +121,6 @@ nsAddrDatabase::nsAddrDatabase()
|
|||
m_NickNameColumnToken(0),
|
||||
m_PriEmailColumnToken(0),
|
||||
m_2ndEmailColumnToken(0),
|
||||
m_DefaultEmailColumnToken(0),
|
||||
m_CardTypeColumnToken(0),
|
||||
m_WorkPhoneColumnToken(0),
|
||||
m_HomePhoneColumnToken(0),
|
||||
m_FaxColumnToken(0),
|
||||
|
@ -1218,8 +1216,6 @@ nsresult nsAddrDatabase::InitMDBInfo()
|
|||
m_mdbStore->StringToToken(m_mdbEnv, kPriEmailColumn, &m_PriEmailColumnToken);
|
||||
m_mdbStore->StringToToken(m_mdbEnv, kLowerPriEmailColumn, &m_LowerPriEmailColumnToken);
|
||||
m_mdbStore->StringToToken(m_mdbEnv, k2ndEmailColumn, &m_2ndEmailColumnToken);
|
||||
m_mdbStore->StringToToken(m_mdbEnv, kDefaultEmailColumn, &m_DefaultEmailColumnToken);
|
||||
m_mdbStore->StringToToken(m_mdbEnv, kCardTypeColumn, &m_CardTypeColumnToken);
|
||||
m_mdbStore->StringToToken(m_mdbEnv, kPreferMailFormatColumn, &m_MailFormatColumnToken);
|
||||
m_mdbStore->StringToToken(m_mdbEnv, kPopularityIndexColumn, &m_PopularityIndexColumnToken);
|
||||
m_mdbStore->StringToToken(m_mdbEnv, kWorkPhoneColumn, &m_WorkPhoneColumnToken);
|
||||
|
@ -1346,12 +1342,6 @@ nsresult nsAddrDatabase::AddAttributeColumnsToRow(nsIAbCard *card, nsIMdbRow *ca
|
|||
card->GetSecondEmail(getter_Copies(unicodeStr));
|
||||
Add2ndEmail(cardRow, NS_ConvertUTF16toUTF8(unicodeStr).get());
|
||||
|
||||
card->GetDefaultEmail(getter_Copies(unicodeStr));
|
||||
AddDefaultEmail(cardRow, NS_ConvertUTF16toUTF8(unicodeStr).get());
|
||||
|
||||
card->GetCardType(getter_Copies(unicodeStr));
|
||||
AddCardType(cardRow, NS_ConvertUTF16toUTF8(unicodeStr).get());
|
||||
|
||||
PRUint32 format = nsIAbPreferMailFormat::unknown;
|
||||
card->GetPreferMailFormat(&format);
|
||||
AddPreferMailFormat(cardRow, format);
|
||||
|
@ -2676,18 +2666,6 @@ NS_IMETHODIMP nsAddrDatabase::InitCardFromRow(nsIAbCard *newCard, nsIMdbRow* car
|
|||
newCard->SetSecondEmail(tempString.get());
|
||||
}
|
||||
|
||||
err = GetStringColumn(cardRow, m_DefaultEmailColumnToken, tempString);
|
||||
if (NS_SUCCEEDED(err) && !tempString.IsEmpty())
|
||||
{
|
||||
newCard->SetDefaultEmail(tempString.get());
|
||||
}
|
||||
|
||||
err = GetStringColumn(cardRow, m_CardTypeColumnToken, tempString);
|
||||
if (NS_SUCCEEDED(err) && !tempString.IsEmpty())
|
||||
{
|
||||
newCard->SetCardType(tempString.get());
|
||||
}
|
||||
|
||||
PRUint32 format = nsIAbPreferMailFormat::unknown;
|
||||
err = GetIntColumn(cardRow, m_MailFormatColumnToken, &format, 0);
|
||||
if (NS_SUCCEEDED(err))
|
||||
|
|
|
@ -129,12 +129,6 @@ public:
|
|||
NS_IMETHOD Add2ndEmail(nsIMdbRow * row, const char * value)
|
||||
{ return AddCharStringColumn(row, m_2ndEmailColumnToken, value); }
|
||||
|
||||
NS_IMETHOD AddDefaultEmail(nsIMdbRow * row, const char * value)
|
||||
{ return AddCharStringColumn(row, m_DefaultEmailColumnToken, value); }
|
||||
|
||||
NS_IMETHOD AddCardType(nsIMdbRow * row, const char * value)
|
||||
{ return AddCharStringColumn(row, m_CardTypeColumnToken, value); }
|
||||
|
||||
NS_IMETHOD AddPreferMailFormat(nsIMdbRow * row, PRUint32 value)
|
||||
{ return AddIntColumn(row, m_MailFormatColumnToken, value); }
|
||||
|
||||
|
|
|
@ -119,8 +119,6 @@ const ExportAttributesTableStruct EXPORT_ATTRIBUTES_TABLE[EXPORT_ATTRIBUTES_TABL
|
|||
{kNicknameColumn, MOZ_AB_LDIF_PREFIX "Nickname", 2103},
|
||||
{kPriEmailColumn, "mail", 2104},
|
||||
{k2ndEmailColumn, MOZ_AB_LDIF_PREFIX "SecondEmail", 2105},
|
||||
{kDefaultEmailColumn, MOZ_AB_LDIF_PREFIX "DefaultEmail"},
|
||||
{kCardTypeColumn, MOZ_AB_LDIF_PREFIX "CardType"},
|
||||
{kAimScreenNameColumn, "nsAIMid"},
|
||||
{kPreferMailFormatColumn, MOZ_AB_LDIF_PREFIX "UseHtmlMail"},
|
||||
{kLastModifiedDateColumn, "modifytimestamp"},
|
||||
|
|
|
@ -64,7 +64,7 @@ class nsIAbDirectory;
|
|||
#define NC_RDF_DELETECARD NC_NAMESPACE_URI "DeleteCards"
|
||||
#define NC_RDF_NEWDIRECTORY NC_NAMESPACE_URI "NewDirectory"
|
||||
|
||||
#define EXPORT_ATTRIBUTES_TABLE_COUNT 53
|
||||
#define EXPORT_ATTRIBUTES_TABLE_COUNT 51
|
||||
|
||||
struct ExportAttributesTableStruct
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче