Evaluate to use columnIds instead of sortType for sorting in about3pane.js
Categories
(Thunderbird :: Folder and Message Lists, task)
Tracking
(Not tracked)
People
(Reporter: john, Assigned: john)
References
(Blocks 1 open bug)
Details
Attachments
(5 files)
We are exposing custom column support for WebExtensions and we use existing custom-column code. It looks that old code has been patched in to make it work, but there seems to have been no planing. The mentioned function accepts an integer and a string and passes this on further and every function on the way has to deal with this.
Let us fix that, before exposing that code to the public.
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 1•2 years ago
|
||
The function convertSortTypeToColumnID() uses dbView.curCustomColumn to
convert the "byCustom" sort type to a folderId. This however only works
for the current sort column, and not for any sort column. It is also
only used with the primarySortType as input.
To improve readability of this code, this patch reworks this function to
always return to columnID of the current sort column.
Depends on D200186
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
|
||
In threadPane.js exists similar code as in about3pane.ja, to convert the
sort type of the current sort column into a columnId.
This patch moves these functions as an additional getter into DBViewWrapper.jsm.
To avoid circular dependecies, this patch moves OUTGOING_FOLDER_FLAGS
from DBViewWrapper.jsm to FolderUtils.jsm.
Depends on D200212
| Assignee | ||
Comment 3•2 years ago
|
||
Depends on D200242
| Assignee | ||
Comment 4•2 years ago
|
||
Both maps can be generated from DEFAULT_COLUMNS and do not need to be
maintained manually.
While modifying the maps, I learned that one of their use-cases in
HandleColumnClick() in threadPane.js can be simplified using the new
getter for primarySortColumnId.
Depends on D200242
| Assignee | ||
Comment 5•2 years ago
|
||
This continues the effort to remove redundant code. The relation
between sortType and columnId is defined in DEFAULT_COLUMNS and does not
need to be hard-coded in the DBViewWrapper.primarySortColumnId getter.
Depends on D200276
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/ef7c78ff16d1
Rework sortController.convertSortTypeToColumnID() to sortControler.getCurrentSortColumnId(). r=freaktechnik
https://hg.mozilla.org/comm-central/rev/23311496b022
Reduce code duplication in about3pane.js and threadPane.js. r=aleca
https://hg.mozilla.org/comm-central/rev/5d723e9f3e1c
Generate the BUILTIN_SORT_COLUMNS Map and the BUILTIN_NOSORT_COLUMNS Set, and simplify HandleColumnClick() in threadPane.js. r=aleca
https://hg.mozilla.org/comm-central/rev/592f757bb8a8
Simplify the DBViewWrapper.primarySortColumnId getter and remove redundancy. r=aleca
https://hg.mozilla.org/comm-central/rev/dbea62484f51
Move special custom column sort handling into DBViewWrapper.jsm and primarily use columnIds instead of sortTypes for sorting. r=aleca
Description
•