mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
#115324, remove unused search/filters code. sr=jst, r=naving
This commit is contained in:
parent
5edfcc1ec0
commit
918caa7bf7
@ -41,7 +41,6 @@
|
||||
#include "nsIMsgSearchScopeTerm.idl"
|
||||
|
||||
[ptr] native nsMsgSearchTermArray(nsMsgResultElement);
|
||||
//[ptr] native nsMsgResultElement(nsMsgResultElement);
|
||||
|
||||
%{C++
|
||||
class nsMsgResultElement;
|
||||
@ -49,8 +48,6 @@ class nsMsgResultElement;
|
||||
|
||||
[scriptable, uuid(66f4b80c-0fb5-11d3-a515-0060b0fc04b7)]
|
||||
interface nsIMsgSearchAdapter : nsISupports {
|
||||
// [noscript] void Init(in nsMsgSearchScopeTerm scope,
|
||||
// in nsMsgSearchTermArray terms);
|
||||
void ValidateTerms();
|
||||
void Search(out boolean done);
|
||||
void SendUrl();
|
||||
|
@ -133,8 +133,6 @@ function currentFilter()
|
||||
filter = gFilterTree.builderView.getResourceAtIndex(gFilterTree.currentIndex);
|
||||
filter = filter.GetDelegate("filter", Components.interfaces.nsIMsgFilter);
|
||||
} catch (ex) {
|
||||
dump(ex);
|
||||
dump("no filter selected!\n");
|
||||
}
|
||||
return filter;
|
||||
}
|
||||
@ -268,8 +266,6 @@ function getSelectedServerForFilters()
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
//dump("**** exception: "+ex+"\n");
|
||||
//dump("**** !!!!!!! NOT A VALID msgfolder\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,33 @@ nsMsgSearchValueImpl::~nsMsgSearchValueImpl()
|
||||
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsMsgSearchValueImpl, nsIMsgSearchValue)
|
||||
NS_IMPL_ISUPPORTS1(nsMsgSearchValueImpl, nsIMsgSearchValue)
|
||||
|
||||
NS_IMPL_GETSET(nsMsgSearchValueImpl, Priority, nsMsgPriorityValue, mValue.u.priority);
|
||||
NS_IMPL_GETSET(nsMsgSearchValueImpl, Status, PRUint32, mValue.u.msgStatus);
|
||||
NS_IMPL_GETSET(nsMsgSearchValueImpl, Size, PRUint32, mValue.u.size);
|
||||
NS_IMPL_GETSET(nsMsgSearchValueImpl, MsgKey, nsMsgKey, mValue.u.key);
|
||||
NS_IMPL_GETSET(nsMsgSearchValueImpl, Age, PRUint32, mValue.u.age);
|
||||
NS_IMPL_GETSET(nsMsgSearchValueImpl, Date, PRTime, mValue.u.date);
|
||||
NS_IMPL_GETSET(nsMsgSearchValueImpl, Attrib, nsMsgSearchAttribValue, mValue.attribute);
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetFolder(nsIMsgFolder* *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::FolderInfo, NS_ERROR_ILLEGAL_VALUE);
|
||||
*aResult = mValue.u.folder;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetFolder(nsIMsgFolder* aValue)
|
||||
{
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::FolderInfo, NS_ERROR_ILLEGAL_VALUE);
|
||||
mValue.u.folder = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetStr(PRUnichar** aResult)
|
||||
@ -76,173 +102,39 @@ nsMsgSearchValueImpl::SetStr(const PRUnichar* aValue)
|
||||
nsCRT::free(mValue.string);
|
||||
mValue.string = ToNewUTF8String(nsDependentString(aValue));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetPriority(nsMsgPriorityValue *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::Priority, NS_ERROR_ILLEGAL_VALUE);
|
||||
*aResult = mValue.u.priority;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetPriority(nsMsgPriorityValue aValue)
|
||||
{
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::Priority, NS_ERROR_ILLEGAL_VALUE);
|
||||
mValue.u.priority = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetStatus(PRUint32 *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::MsgStatus, NS_ERROR_ILLEGAL_VALUE);
|
||||
*aResult = mValue.u.msgStatus;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetStatus(PRUint32 aValue)
|
||||
{
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::MsgStatus, NS_ERROR_ILLEGAL_VALUE);
|
||||
mValue.u.msgStatus = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetSize(PRUint32 *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::Size, NS_ERROR_ILLEGAL_VALUE);
|
||||
*aResult = mValue.u.size;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetSize(PRUint32 aValue)
|
||||
{
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::Size, NS_ERROR_ILLEGAL_VALUE);
|
||||
mValue.u.size = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetMsgKey(nsMsgKey *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::MessageKey, NS_ERROR_ILLEGAL_VALUE);
|
||||
*aResult = mValue.u.key;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetMsgKey(nsMsgKey aValue)
|
||||
{
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::MessageKey, NS_ERROR_ILLEGAL_VALUE);
|
||||
mValue.u.key = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetAge(PRUint32 *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::AgeInDays, NS_ERROR_ILLEGAL_VALUE);
|
||||
*aResult = mValue.u.age;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetAge(PRUint32 aValue)
|
||||
{
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::AgeInDays, NS_ERROR_ILLEGAL_VALUE);
|
||||
mValue.u.age = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetFolder(nsIMsgFolder* *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::FolderInfo, NS_ERROR_ILLEGAL_VALUE);
|
||||
*aResult = mValue.u.folder;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetFolder(nsIMsgFolder* aValue)
|
||||
{
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::FolderInfo, NS_ERROR_ILLEGAL_VALUE);
|
||||
mValue.u.folder = aValue;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetDate(PRTime *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::Date, NS_ERROR_ILLEGAL_VALUE);
|
||||
*aResult = mValue.u.date;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetDate(PRTime aValue)
|
||||
{
|
||||
NS_ENSURE_TRUE(mValue.attribute == nsMsgSearchAttrib::Date, NS_ERROR_ILLEGAL_VALUE);
|
||||
mValue.u.date = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetAttrib(nsMsgSearchAttribValue *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
*aResult = mValue.attribute;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetAttrib(nsMsgSearchAttribValue aValue)
|
||||
{
|
||||
mValue.attribute = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::ToString(PRUnichar **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
nsAutoString resultStr;
|
||||
resultStr.Assign(NS_LITERAL_STRING("[nsIMsgSearchValue: "));
|
||||
if (IS_STRING_ATTRIBUTE(mValue.attribute)) {
|
||||
resultStr.Append(NS_ConvertUTF8toUCS2(mValue.string));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
switch (mValue.attribute) {
|
||||
|
||||
case nsMsgSearchAttrib::Priority:
|
||||
case nsMsgSearchAttrib::Date:
|
||||
case nsMsgSearchAttrib::MsgStatus:
|
||||
case nsMsgSearchAttrib::MessageKey:
|
||||
case nsMsgSearchAttrib::Size:
|
||||
case nsMsgSearchAttrib::AgeInDays:
|
||||
case nsMsgSearchAttrib::FolderInfo:
|
||||
resultStr.Append(NS_LITERAL_STRING("type="));
|
||||
resultStr.AppendInt(mValue.attribute);
|
||||
break;
|
||||
default:
|
||||
NS_ASSERTION(0, "Unknown search value type");
|
||||
}
|
||||
|
||||
resultStr.Append(NS_LITERAL_STRING("]"));
|
||||
|
||||
*aResult = ToNewUnicode(resultStr);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::ToString(PRUnichar **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
nsAutoString resultStr;
|
||||
resultStr.Assign(NS_LITERAL_STRING("[nsIMsgSearchValue: "));
|
||||
if (IS_STRING_ATTRIBUTE(mValue.attribute)) {
|
||||
resultStr.Append(NS_ConvertUTF8toUCS2(mValue.string));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
switch (mValue.attribute) {
|
||||
|
||||
case nsMsgSearchAttrib::Priority:
|
||||
case nsMsgSearchAttrib::Date:
|
||||
case nsMsgSearchAttrib::MsgStatus:
|
||||
case nsMsgSearchAttrib::MessageKey:
|
||||
case nsMsgSearchAttrib::Size:
|
||||
case nsMsgSearchAttrib::AgeInDays:
|
||||
case nsMsgSearchAttrib::FolderInfo:
|
||||
resultStr.Append(NS_LITERAL_STRING("type="));
|
||||
resultStr.AppendInt(mValue.attribute);
|
||||
break;
|
||||
default:
|
||||
NS_ASSERTION(0, "Unknown search value type");
|
||||
}
|
||||
|
||||
resultStr.Append(NS_LITERAL_STRING("]"));
|
||||
|
||||
*aResult = ToNewUnicode(resultStr);
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user