Bug 1883506 - Remove out-param from nsIMsgDBView.open and .openWithHdrs. r=leftmostcat
Differential Revision: https://phabricator.services.mozilla.com/D204307 --HG-- extra : amend_source : 3c651e60a656322c4b54336ba7334319ea0af130
This commit is contained in:
Родитель
256c3798f5
Коммит
d62c2bf3a4
|
@ -1133,7 +1133,6 @@ DBViewWrapper.prototype = {
|
||||||
? 0
|
? 0
|
||||||
: this._sort.length - 1;
|
: this._sort.length - 1;
|
||||||
let [sortType, sortOrder, sortCustomCol] = this._getSortDetails(index);
|
let [sortType, sortOrder, sortCustomCol] = this._getSortDetails(index);
|
||||||
const outCount = {};
|
|
||||||
// when the underlying folder is a single real folder (virtual or no), we
|
// when the underlying folder is a single real folder (virtual or no), we
|
||||||
// tell the view about the underlying folder.
|
// tell the view about the underlying folder.
|
||||||
if (this.isSingleFolder) {
|
if (this.isSingleFolder) {
|
||||||
|
@ -1147,13 +1146,7 @@ DBViewWrapper.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open the folder.
|
// Open the folder.
|
||||||
dbView.open(
|
dbView.open(this._underlyingFolders[0], sortType, sortOrder, viewFlags);
|
||||||
this._underlyingFolders[0],
|
|
||||||
sortType,
|
|
||||||
sortOrder,
|
|
||||||
viewFlags,
|
|
||||||
outCount
|
|
||||||
);
|
|
||||||
|
|
||||||
// If there are any search terms, we need to tell the db view about the
|
// If there are any search terms, we need to tell the db view about the
|
||||||
// the display (/virtual) folder so it can store all the view-specific
|
// the display (/virtual) folder so it can store all the view-specific
|
||||||
|
@ -1172,13 +1165,7 @@ DBViewWrapper.prototype = {
|
||||||
// db view about the display folder. (It gets its own XFVF view, so it
|
// db view about the display folder. (It gets its own XFVF view, so it
|
||||||
// knows what to do.)
|
// knows what to do.)
|
||||||
// and for a synthetic folder, displayedFolder is null anyways
|
// and for a synthetic folder, displayedFolder is null anyways
|
||||||
dbView.open(
|
dbView.open(this.displayedFolder, sortType, sortOrder, viewFlags);
|
||||||
this.displayedFolder,
|
|
||||||
sortType,
|
|
||||||
sortOrder,
|
|
||||||
viewFlags,
|
|
||||||
outCount
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (sortCustomCol) {
|
if (sortCustomCol) {
|
||||||
dbView.curCustomColumn = sortCustomCol;
|
dbView.curCustomColumn = sortCustomCol;
|
||||||
|
|
|
@ -218,11 +218,10 @@ interface nsIMsgDBView : nsISupports
|
||||||
void open(in nsIMsgFolder folder,
|
void open(in nsIMsgFolder folder,
|
||||||
in nsMsgViewSortTypeValue sortType,
|
in nsMsgViewSortTypeValue sortType,
|
||||||
in nsMsgViewSortOrderValue sortOrder,
|
in nsMsgViewSortOrderValue sortOrder,
|
||||||
in nsMsgViewFlagsTypeValue viewFlags,
|
in nsMsgViewFlagsTypeValue viewFlags);
|
||||||
out long count);
|
|
||||||
void openWithHdrs(in nsIMsgEnumerator aHeaders, in nsMsgViewSortTypeValue aSortType,
|
void openWithHdrs(in nsIMsgEnumerator aHeaders, in nsMsgViewSortTypeValue aSortType,
|
||||||
in nsMsgViewSortOrderValue aSortOrder,
|
in nsMsgViewSortOrderValue aSortOrder,
|
||||||
in nsMsgViewFlagsTypeValue aViewFlags, out long aCount);
|
in nsMsgViewFlagsTypeValue aViewFlags);
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
void init(in nsIMessenger aMessengerInstance, in nsIMsgWindow aMsgWindow, in nsIMsgDBViewCommandUpdater aCommandUpdater);
|
void init(in nsIMessenger aMessengerInstance, in nsIMsgWindow aMsgWindow, in nsIMsgDBViewCommandUpdater aCommandUpdater);
|
||||||
|
|
|
@ -2115,7 +2115,7 @@ nsMsgDBView::CycleCell(int32_t row, nsTreeColumn* col) {
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsMsgDBView::Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
nsMsgDBView::Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
nsMsgViewSortOrderValue sortOrder,
|
nsMsgViewSortOrderValue sortOrder,
|
||||||
nsMsgViewFlagsTypeValue viewFlags, int32_t* pCount) {
|
nsMsgViewFlagsTypeValue viewFlags) {
|
||||||
m_viewFlags = viewFlags;
|
m_viewFlags = viewFlags;
|
||||||
m_sortOrder = sortOrder;
|
m_sortOrder = sortOrder;
|
||||||
m_sortType = sortType;
|
m_sortType = sortType;
|
||||||
|
@ -2254,7 +2254,7 @@ NS_IMETHODIMP
|
||||||
nsMsgDBView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
nsMsgDBView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
||||||
nsMsgViewSortTypeValue aSortType,
|
nsMsgViewSortTypeValue aSortType,
|
||||||
nsMsgViewSortOrderValue aSortOrder,
|
nsMsgViewSortOrderValue aSortOrder,
|
||||||
nsMsgViewFlagsTypeValue aViewFlags, int32_t* aCount) {
|
nsMsgViewFlagsTypeValue aViewFlags) {
|
||||||
NS_ASSERTION(false, "not implemented");
|
NS_ASSERTION(false, "not implemented");
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,9 +29,8 @@ nsMsgGroupView::~nsMsgGroupView() {}
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsMsgGroupView::Open(nsIMsgFolder* aFolder, nsMsgViewSortTypeValue aSortType,
|
nsMsgGroupView::Open(nsIMsgFolder* aFolder, nsMsgViewSortTypeValue aSortType,
|
||||||
nsMsgViewSortOrderValue aSortOrder,
|
nsMsgViewSortOrderValue aSortOrder,
|
||||||
nsMsgViewFlagsTypeValue aViewFlags, int32_t* aCount) {
|
nsMsgViewFlagsTypeValue aViewFlags) {
|
||||||
nsresult rv =
|
nsresult rv = nsMsgDBView::Open(aFolder, aSortType, aSortOrder, aViewFlags);
|
||||||
nsMsgDBView::Open(aFolder, aSortType, aSortOrder, aViewFlags, aCount);
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCOMPtr<nsIDBFolderInfo> dbFolderInfo;
|
nsCOMPtr<nsIDBFolderInfo> dbFolderInfo;
|
||||||
|
@ -41,7 +40,7 @@ nsMsgGroupView::Open(nsIMsgFolder* aFolder, nsMsgViewSortTypeValue aSortType,
|
||||||
rv = m_db->EnumerateMessages(getter_AddRefs(headers));
|
rv = m_db->EnumerateMessages(getter_AddRefs(headers));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return OpenWithHdrs(headers, aSortType, aSortOrder, aViewFlags, aCount);
|
return OpenWithHdrs(headers, aSortType, aSortOrder, aViewFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsMsgGroupView::InternalClose() {
|
void nsMsgGroupView::InternalClose() {
|
||||||
|
@ -370,8 +369,7 @@ NS_IMETHODIMP
|
||||||
nsMsgGroupView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
nsMsgGroupView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
||||||
nsMsgViewSortTypeValue aSortType,
|
nsMsgViewSortTypeValue aSortType,
|
||||||
nsMsgViewSortOrderValue aSortOrder,
|
nsMsgViewSortOrderValue aSortOrder,
|
||||||
nsMsgViewFlagsTypeValue aViewFlags,
|
nsMsgViewFlagsTypeValue aViewFlags) {
|
||||||
int32_t* aCount) {
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
m_groupsTable.Clear();
|
m_groupsTable.Clear();
|
||||||
|
@ -440,7 +438,6 @@ nsMsgGroupView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*aCount = m_keys.Length();
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,7 +488,6 @@ nsMsgGroupView::CopyDBView(nsMsgDBView* aNewMsgDBView,
|
||||||
nsresult nsMsgGroupView::RebuildView(nsMsgViewFlagsTypeValue newFlags) {
|
nsresult nsMsgGroupView::RebuildView(nsMsgViewFlagsTypeValue newFlags) {
|
||||||
nsCOMPtr<nsIMsgEnumerator> headers;
|
nsCOMPtr<nsIMsgEnumerator> headers;
|
||||||
if (NS_SUCCEEDED(GetMessageEnumerator(getter_AddRefs(headers)))) {
|
if (NS_SUCCEEDED(GetMessageEnumerator(getter_AddRefs(headers)))) {
|
||||||
int32_t count;
|
|
||||||
m_dayChanged = false;
|
m_dayChanged = false;
|
||||||
AutoTArray<nsMsgKey, 1> preservedSelection;
|
AutoTArray<nsMsgKey, 1> preservedSelection;
|
||||||
nsMsgKey curSelectedKey;
|
nsMsgKey curSelectedKey;
|
||||||
|
@ -511,8 +507,7 @@ nsresult nsMsgGroupView::RebuildView(nsMsgViewFlagsTypeValue newFlags) {
|
||||||
if (mJSTree) mJSTree->RowCountChanged(0, -oldSize);
|
if (mJSTree) mJSTree->RowCountChanged(0, -oldSize);
|
||||||
|
|
||||||
SetSuppressChangeNotifications(true);
|
SetSuppressChangeNotifications(true);
|
||||||
nsresult rv =
|
nsresult rv = OpenWithHdrs(headers, m_sortType, m_sortOrder, newFlags);
|
||||||
OpenWithHdrs(headers, m_sortType, m_sortOrder, newFlags, &count);
|
|
||||||
SetSuppressChangeNotifications(false);
|
SetSuppressChangeNotifications(false);
|
||||||
if (mTree) mTree->RowCountChanged(0, GetSize());
|
if (mTree) mTree->RowCountChanged(0, GetSize());
|
||||||
if (mJSTree) mJSTree->RowCountChanged(0, GetSize());
|
if (mJSTree) mJSTree->RowCountChanged(0, GetSize());
|
||||||
|
|
|
@ -23,12 +23,11 @@ class nsMsgGroupView : public nsMsgDBView {
|
||||||
|
|
||||||
NS_IMETHOD Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
NS_IMETHOD Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
nsMsgViewSortOrderValue sortOrder,
|
nsMsgViewSortOrderValue sortOrder,
|
||||||
nsMsgViewFlagsTypeValue viewFlags, int32_t* pCount) override;
|
nsMsgViewFlagsTypeValue viewFlags) override;
|
||||||
NS_IMETHOD OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
NS_IMETHOD OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
||||||
nsMsgViewSortTypeValue aSortType,
|
nsMsgViewSortTypeValue aSortType,
|
||||||
nsMsgViewSortOrderValue aSortOrder,
|
nsMsgViewSortOrderValue aSortOrder,
|
||||||
nsMsgViewFlagsTypeValue aViewFlags,
|
nsMsgViewFlagsTypeValue aViewFlags) override;
|
||||||
int32_t* aCount) override;
|
|
||||||
NS_IMETHOD GetViewType(nsMsgViewTypeValue* aViewType) override;
|
NS_IMETHOD GetViewType(nsMsgViewTypeValue* aViewType) override;
|
||||||
NS_IMETHOD CopyDBView(nsMsgDBView* aNewMsgDBView,
|
NS_IMETHOD CopyDBView(nsMsgDBView* aNewMsgDBView,
|
||||||
nsIMessenger* aMessengerInstance,
|
nsIMessenger* aMessengerInstance,
|
||||||
|
|
|
@ -27,10 +27,8 @@ NS_IMPL_ISUPPORTS_INHERITED(nsMsgQuickSearchDBView, nsMsgDBView, nsIMsgDBView,
|
||||||
NS_IMETHODIMP nsMsgQuickSearchDBView::Open(nsIMsgFolder* folder,
|
NS_IMETHODIMP nsMsgQuickSearchDBView::Open(nsIMsgFolder* folder,
|
||||||
nsMsgViewSortTypeValue sortType,
|
nsMsgViewSortTypeValue sortType,
|
||||||
nsMsgViewSortOrderValue sortOrder,
|
nsMsgViewSortOrderValue sortOrder,
|
||||||
nsMsgViewFlagsTypeValue viewFlags,
|
nsMsgViewFlagsTypeValue viewFlags) {
|
||||||
int32_t* pCount) {
|
nsresult rv = nsMsgDBView::Open(folder, sortType, sortOrder, viewFlags);
|
||||||
nsresult rv =
|
|
||||||
nsMsgDBView::Open(folder, sortType, sortOrder, viewFlags, pCount);
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
if (!m_db) return NS_ERROR_NULL_POINTER;
|
if (!m_db) return NS_ERROR_NULL_POINTER;
|
||||||
|
@ -38,7 +36,6 @@ NS_IMETHODIMP nsMsgQuickSearchDBView::Open(nsIMsgFolder* folder,
|
||||||
|
|
||||||
int32_t count;
|
int32_t count;
|
||||||
rv = InitThreadedView(count);
|
rv = InitThreadedView(count);
|
||||||
if (pCount) *pCount = count;
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -743,11 +740,10 @@ NS_IMETHODIMP
|
||||||
nsMsgQuickSearchDBView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
nsMsgQuickSearchDBView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
||||||
nsMsgViewSortTypeValue aSortType,
|
nsMsgViewSortTypeValue aSortType,
|
||||||
nsMsgViewSortOrderValue aSortOrder,
|
nsMsgViewSortOrderValue aSortOrder,
|
||||||
nsMsgViewFlagsTypeValue aViewFlags,
|
nsMsgViewFlagsTypeValue aViewFlags) {
|
||||||
int32_t* aCount) {
|
|
||||||
if (aViewFlags & nsMsgViewFlagsType::kGroupBySort)
|
if (aViewFlags & nsMsgViewFlagsType::kGroupBySort)
|
||||||
return nsMsgGroupView::OpenWithHdrs(aHeaders, aSortType, aSortOrder,
|
return nsMsgGroupView::OpenWithHdrs(aHeaders, aSortType, aSortOrder,
|
||||||
aViewFlags, aCount);
|
aViewFlags);
|
||||||
|
|
||||||
m_sortType = aSortType;
|
m_sortType = aSortType;
|
||||||
m_sortOrder = aSortOrder;
|
m_sortOrder = aSortOrder;
|
||||||
|
@ -765,7 +761,6 @@ nsMsgQuickSearchDBView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*aCount = m_keys.Length();
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,11 @@ class nsMsgQuickSearchDBView : public nsMsgThreadedDBView,
|
||||||
virtual const char* GetViewName(void) override { return "QuickSearchView"; }
|
virtual const char* GetViewName(void) override { return "QuickSearchView"; }
|
||||||
NS_IMETHOD Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
NS_IMETHOD Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
nsMsgViewSortOrderValue sortOrder,
|
nsMsgViewSortOrderValue sortOrder,
|
||||||
nsMsgViewFlagsTypeValue viewFlags, int32_t* pCount) override;
|
nsMsgViewFlagsTypeValue viewFlags) override;
|
||||||
NS_IMETHOD OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
NS_IMETHOD OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
||||||
nsMsgViewSortTypeValue aSortType,
|
nsMsgViewSortTypeValue aSortType,
|
||||||
nsMsgViewSortOrderValue aSortOrder,
|
nsMsgViewSortOrderValue aSortOrder,
|
||||||
nsMsgViewFlagsTypeValue aViewFlags,
|
nsMsgViewFlagsTypeValue aViewFlags) override;
|
||||||
int32_t* aCount) override;
|
|
||||||
NS_IMETHOD CloneDBView(nsIMessenger* aMessengerInstance,
|
NS_IMETHOD CloneDBView(nsIMessenger* aMessengerInstance,
|
||||||
nsIMsgWindow* aMsgWindow,
|
nsIMsgWindow* aMsgWindow,
|
||||||
nsIMsgDBViewCommandUpdater* aCommandUpdater,
|
nsIMsgDBViewCommandUpdater* aCommandUpdater,
|
||||||
|
|
|
@ -41,7 +41,7 @@ NS_IMPL_ISUPPORTS_INHERITED(nsMsgSearchDBView, nsMsgDBView, nsIMsgDBView,
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsMsgSearchDBView::Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
nsMsgSearchDBView::Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
nsMsgViewSortOrderValue sortOrder,
|
nsMsgViewSortOrderValue sortOrder,
|
||||||
nsMsgViewFlagsTypeValue viewFlags, int32_t* pCount) {
|
nsMsgViewFlagsTypeValue viewFlags) {
|
||||||
// DBViewWrapper.jsm likes to create search views with a sort order
|
// DBViewWrapper.jsm likes to create search views with a sort order
|
||||||
// of byNone, in order to have the order be the order the search results
|
// of byNone, in order to have the order be the order the search results
|
||||||
// are returned. But this doesn't work with threaded view, so make the
|
// are returned. But this doesn't work with threaded view, so make the
|
||||||
|
@ -51,8 +51,7 @@ nsMsgSearchDBView::Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
sortType == nsMsgViewSortType::byNone)
|
sortType == nsMsgViewSortType::byNone)
|
||||||
sortType = nsMsgViewSortType::byDate;
|
sortType = nsMsgViewSortType::byDate;
|
||||||
|
|
||||||
nsresult rv =
|
nsresult rv = nsMsgDBView::Open(folder, sortType, sortOrder, viewFlags);
|
||||||
nsMsgDBView::Open(folder, sortType, sortOrder, viewFlags, pCount);
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCOMPtr<nsIPrefBranch> prefBranch(
|
nsCOMPtr<nsIPrefBranch> prefBranch(
|
||||||
|
@ -62,9 +61,6 @@ nsMsgSearchDBView::Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
|
|
||||||
// Our sort is automatically valid because we have no contents at this point!
|
// Our sort is automatically valid because we have no contents at this point!
|
||||||
m_sortValid = true;
|
m_sortValid = true;
|
||||||
|
|
||||||
if (pCount) *pCount = 0;
|
|
||||||
|
|
||||||
m_folder = nullptr;
|
m_folder = nullptr;
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
@ -1092,11 +1088,10 @@ NS_IMETHODIMP
|
||||||
nsMsgSearchDBView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
nsMsgSearchDBView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
||||||
nsMsgViewSortTypeValue aSortType,
|
nsMsgViewSortTypeValue aSortType,
|
||||||
nsMsgViewSortOrderValue aSortOrder,
|
nsMsgViewSortOrderValue aSortOrder,
|
||||||
nsMsgViewFlagsTypeValue aViewFlags,
|
nsMsgViewFlagsTypeValue aViewFlags) {
|
||||||
int32_t* aCount) {
|
|
||||||
if (aViewFlags & nsMsgViewFlagsType::kGroupBySort)
|
if (aViewFlags & nsMsgViewFlagsType::kGroupBySort)
|
||||||
return nsMsgGroupView::OpenWithHdrs(aHeaders, aSortType, aSortOrder,
|
return nsMsgGroupView::OpenWithHdrs(aHeaders, aSortType, aSortOrder,
|
||||||
aViewFlags, aCount);
|
aViewFlags);
|
||||||
|
|
||||||
m_sortType = aSortType;
|
m_sortType = aSortType;
|
||||||
m_sortOrder = aSortOrder;
|
m_sortOrder = aSortOrder;
|
||||||
|
@ -1116,7 +1111,6 @@ nsMsgSearchDBView::OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*aCount = m_keys.Length();
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ class nsMsgSearchDBView : public nsMsgGroupView,
|
||||||
virtual const char* GetViewName(void) override { return "SearchView"; }
|
virtual const char* GetViewName(void) override { return "SearchView"; }
|
||||||
NS_IMETHOD Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
NS_IMETHOD Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
nsMsgViewSortOrderValue sortOrder,
|
nsMsgViewSortOrderValue sortOrder,
|
||||||
nsMsgViewFlagsTypeValue viewFlags, int32_t* pCount) override;
|
nsMsgViewFlagsTypeValue viewFlags) override;
|
||||||
NS_IMETHOD CloneDBView(nsIMessenger* aMessengerInstance,
|
NS_IMETHOD CloneDBView(nsIMessenger* aMessengerInstance,
|
||||||
nsIMsgWindow* aMsgWindow,
|
nsIMsgWindow* aMsgWindow,
|
||||||
nsIMsgDBViewCommandUpdater* aCmdUpdater,
|
nsIMsgDBViewCommandUpdater* aCmdUpdater,
|
||||||
|
@ -56,8 +56,7 @@ class nsMsgSearchDBView : public nsMsgGroupView,
|
||||||
NS_IMETHOD OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
NS_IMETHOD OpenWithHdrs(nsIMsgEnumerator* aHeaders,
|
||||||
nsMsgViewSortTypeValue aSortType,
|
nsMsgViewSortTypeValue aSortType,
|
||||||
nsMsgViewSortOrderValue aSortOrder,
|
nsMsgViewSortOrderValue aSortOrder,
|
||||||
nsMsgViewFlagsTypeValue aViewFlags,
|
nsMsgViewFlagsTypeValue aViewFlags) override;
|
||||||
int32_t* aCount) override;
|
|
||||||
NS_IMETHOD OnHdrDeleted(nsIMsgDBHdr* aHdrDeleted, nsMsgKey aParentKey,
|
NS_IMETHOD OnHdrDeleted(nsIMsgDBHdr* aHdrDeleted, nsMsgKey aParentKey,
|
||||||
int32_t aFlags,
|
int32_t aFlags,
|
||||||
nsIDBChangeListener* aInstigator) override;
|
nsIDBChangeListener* aInstigator) override;
|
||||||
|
|
|
@ -27,9 +27,8 @@ nsMsgThreadedDBView::~nsMsgThreadedDBView() {} /* destructor code */
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsMsgThreadedDBView::Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
nsMsgThreadedDBView::Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
nsMsgViewSortOrderValue sortOrder,
|
nsMsgViewSortOrderValue sortOrder,
|
||||||
nsMsgViewFlagsTypeValue viewFlags, int32_t* pCount) {
|
nsMsgViewFlagsTypeValue viewFlags) {
|
||||||
nsresult rv =
|
nsresult rv = nsMsgDBView::Open(folder, sortType, sortOrder, viewFlags);
|
||||||
nsMsgDBView::Open(folder, sortType, sortOrder, viewFlags, pCount);
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
if (!m_db) return NS_ERROR_NULL_POINTER;
|
if (!m_db) return NS_ERROR_NULL_POINTER;
|
||||||
|
@ -61,7 +60,6 @@ nsMsgThreadedDBView::Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
|
|
||||||
int32_t count;
|
int32_t count;
|
||||||
rv = InitThreadedView(count);
|
rv = InitThreadedView(count);
|
||||||
if (pCount) *pCount = count;
|
|
||||||
|
|
||||||
// This is a hack, but we're trying to find a way to correct
|
// This is a hack, but we're trying to find a way to correct
|
||||||
// incorrect total and unread msg counts w/o paying a big
|
// incorrect total and unread msg counts w/o paying a big
|
||||||
|
|
|
@ -16,7 +16,7 @@ class nsMsgThreadedDBView : public nsMsgGroupView {
|
||||||
|
|
||||||
NS_IMETHOD Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
NS_IMETHOD Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
nsMsgViewSortOrderValue sortOrder,
|
nsMsgViewSortOrderValue sortOrder,
|
||||||
nsMsgViewFlagsTypeValue viewFlags, int32_t* pCount) override;
|
nsMsgViewFlagsTypeValue viewFlags) override;
|
||||||
NS_IMETHOD CloneDBView(nsIMessenger* aMessengerInstance,
|
NS_IMETHOD CloneDBView(nsIMessenger* aMessengerInstance,
|
||||||
nsIMsgWindow* aMsgWindow,
|
nsIMsgWindow* aMsgWindow,
|
||||||
nsIMsgDBViewCommandUpdater* aCommandUpdater,
|
nsIMsgDBViewCommandUpdater* aCommandUpdater,
|
||||||
|
|
|
@ -30,11 +30,9 @@ NS_IMETHODIMP
|
||||||
nsMsgXFVirtualFolderDBView::Open(nsIMsgFolder* folder,
|
nsMsgXFVirtualFolderDBView::Open(nsIMsgFolder* folder,
|
||||||
nsMsgViewSortTypeValue sortType,
|
nsMsgViewSortTypeValue sortType,
|
||||||
nsMsgViewSortOrderValue sortOrder,
|
nsMsgViewSortOrderValue sortOrder,
|
||||||
nsMsgViewFlagsTypeValue viewFlags,
|
nsMsgViewFlagsTypeValue viewFlags) {
|
||||||
int32_t* pCount) {
|
|
||||||
m_viewFolder = folder;
|
m_viewFolder = folder;
|
||||||
return nsMsgSearchDBView::Open(folder, sortType, sortOrder, viewFlags,
|
return nsMsgSearchDBView::Open(folder, sortType, sortOrder, viewFlags);
|
||||||
pCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsMsgXFVirtualFolderDBView::RemovePendingDBListeners() {
|
void nsMsgXFVirtualFolderDBView::RemovePendingDBListeners() {
|
||||||
|
|
|
@ -27,7 +27,7 @@ class nsMsgXFVirtualFolderDBView : public nsMsgSearchDBView {
|
||||||
}
|
}
|
||||||
NS_IMETHOD Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
NS_IMETHOD Open(nsIMsgFolder* folder, nsMsgViewSortTypeValue sortType,
|
||||||
nsMsgViewSortOrderValue sortOrder,
|
nsMsgViewSortOrderValue sortOrder,
|
||||||
nsMsgViewFlagsTypeValue viewFlags, int32_t* pCount) override;
|
nsMsgViewFlagsTypeValue viewFlags) override;
|
||||||
NS_IMETHOD CloneDBView(nsIMessenger* aMessengerInstance,
|
NS_IMETHOD CloneDBView(nsIMessenger* aMessengerInstance,
|
||||||
nsIMsgWindow* aMsgWindow,
|
nsIMsgWindow* aMsgWindow,
|
||||||
nsIMsgDBViewCommandUpdater* aCmdUpdater,
|
nsIMsgDBViewCommandUpdater* aCmdUpdater,
|
||||||
|
|
|
@ -131,13 +131,11 @@ add_setup(async function () {
|
||||||
|
|
||||||
gDBView = Cc[dbviewContractId].createInstance(Ci.nsIMsgDBView);
|
gDBView = Cc[dbviewContractId].createInstance(Ci.nsIMsgDBView);
|
||||||
gDBView.init(null, null, null);
|
gDBView.init(null, null, null);
|
||||||
var outCount = {};
|
|
||||||
gDBView.open(
|
gDBView.open(
|
||||||
gLocalInboxFolder,
|
gLocalInboxFolder,
|
||||||
Ci.nsMsgViewSortType.byDate,
|
Ci.nsMsgViewSortType.byDate,
|
||||||
Ci.nsMsgViewSortOrder.ascending,
|
Ci.nsMsgViewSortOrder.ascending,
|
||||||
view_flag,
|
view_flag
|
||||||
outCount
|
|
||||||
);
|
);
|
||||||
|
|
||||||
gTreeView = gDBView.QueryInterface(Ci.nsITreeView);
|
gTreeView = gDBView.QueryInterface(Ci.nsITreeView);
|
||||||
|
|
|
@ -254,18 +254,14 @@ function setup_view(aViewType, aViewFlags, aTestFolder) {
|
||||||
|
|
||||||
gDBView = Cc[dbviewContractId].createInstance(Ci.nsIMsgDBView);
|
gDBView = Cc[dbviewContractId].createInstance(Ci.nsIMsgDBView);
|
||||||
gDBView.init(null, null, null);
|
gDBView.init(null, null, null);
|
||||||
var outCount = {};
|
|
||||||
gDBView.open(
|
gDBView.open(
|
||||||
aViewType != "search" ? aTestFolder : null,
|
aViewType != "search" ? aTestFolder : null,
|
||||||
Ci.nsMsgViewSortType.byDate,
|
Ci.nsMsgViewSortType.byDate,
|
||||||
aViewType != "search"
|
aViewType != "search"
|
||||||
? Ci.nsMsgViewSortOrder.ascending
|
? Ci.nsMsgViewSortOrder.ascending
|
||||||
: Ci.nsMsgViewSortOrder.descending,
|
: Ci.nsMsgViewSortOrder.descending,
|
||||||
aViewFlags,
|
aViewFlags
|
||||||
outCount
|
|
||||||
);
|
);
|
||||||
// outCount is 0 if byCustom; view is built by addColumnHandler()
|
|
||||||
dump(" View Out Count: " + outCount.value + "\n");
|
|
||||||
|
|
||||||
// we need to cram messages into the search via nsIMsgSearchNotify interface
|
// we need to cram messages into the search via nsIMsgSearchNotify interface
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -86,13 +86,11 @@ add_task(async function test_nsMsgDBView_headValues() {
|
||||||
const dbviewContractId = "@mozilla.org/messenger/msgdbview;1?type=threaded";
|
const dbviewContractId = "@mozilla.org/messenger/msgdbview;1?type=threaded";
|
||||||
const dbView = Cc[dbviewContractId].createInstance(Ci.nsIMsgDBView);
|
const dbView = Cc[dbviewContractId].createInstance(Ci.nsIMsgDBView);
|
||||||
dbView.init(null, null, null);
|
dbView.init(null, null, null);
|
||||||
const outCount = {};
|
|
||||||
dbView.open(
|
dbView.open(
|
||||||
folder,
|
folder,
|
||||||
Ci.nsMsgViewSortType.byDate,
|
Ci.nsMsgViewSortType.byDate,
|
||||||
Ci.nsMsgViewSortOrder.ascending,
|
Ci.nsMsgViewSortOrder.ascending,
|
||||||
0,
|
0
|
||||||
outCount
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Did we add all the messages properly?
|
// Did we add all the messages properly?
|
||||||
|
|
|
@ -454,7 +454,7 @@ function makeView(viewType, folder, sortType, flags, virtualFolder) {
|
||||||
if (virtualFolder) {
|
if (virtualFolder) {
|
||||||
dbView.viewFolder = virtualFolder;
|
dbView.viewFolder = virtualFolder;
|
||||||
}
|
}
|
||||||
dbView.open(folder, sortType, Ci.nsMsgViewSortOrder.ascending, flags, {});
|
dbView.open(folder, sortType, Ci.nsMsgViewSortOrder.ascending, flags);
|
||||||
|
|
||||||
return dbView.QueryInterface(Ci.nsITreeView);
|
return dbView.QueryInterface(Ci.nsITreeView);
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,17 +129,14 @@ function setup_view(aViewType, aViewFlags, aTestFolder) {
|
||||||
|
|
||||||
gDBView = Cc[dbviewContractId].createInstance(Ci.nsIMsgDBView);
|
gDBView = Cc[dbviewContractId].createInstance(Ci.nsIMsgDBView);
|
||||||
gDBView.init(null, null, null);
|
gDBView.init(null, null, null);
|
||||||
var outCount = {};
|
|
||||||
gDBView.open(
|
gDBView.open(
|
||||||
aViewType != "search" ? aTestFolder : null,
|
aViewType != "search" ? aTestFolder : null,
|
||||||
Ci.nsMsgViewSortType.byDate,
|
Ci.nsMsgViewSortType.byDate,
|
||||||
aViewType != "search"
|
aViewType != "search"
|
||||||
? Ci.nsMsgViewSortOrder.ascending
|
? Ci.nsMsgViewSortOrder.ascending
|
||||||
: Ci.nsMsgViewSortOrder.descending,
|
: Ci.nsMsgViewSortOrder.descending,
|
||||||
aViewFlags,
|
aViewFlags
|
||||||
outCount
|
|
||||||
);
|
);
|
||||||
dump(" View Out Count: " + outCount.value + "\n");
|
|
||||||
|
|
||||||
gTreeView = gDBView.QueryInterface(Ci.nsITreeView);
|
gTreeView = gDBView.QueryInterface(Ci.nsITreeView);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче