Closed Bug 373967 Opened 17 years ago Closed 16 years ago

Custom column added by extension is not displayed properly while in "grouped by sort"

Categories

(MailNews Core :: Backend, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.1

People

(Reporter: messerma, Assigned: rkent)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
Build Identifier: 2 beta 2 (20070116)

A custom column added by extension is is not handled properly in "grouped by sort" mode. Apparently CreateDBView is not called, so the extension is not notified about view change (bug 359357) 

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Should be assigned to David Bienvenu
taking - no promises, though. I don't know how hard this will be. It definitely won't be in 2.0, I'm afraid.
Assignee: mscott → bienvenu
Status: UNCONFIRMED → NEW
Ever confirmed: true
Custom columns also do not work in cross folder virtual folders mode.
(In reply to comment #3)
> Custom columns also do not work in cross folder virtual folders mode.
> 

Sorry, my comment not valid. Following examples (including my own!), I was accessing data in the custom column extension as:

getCellText:         function(row, col) {
      var key = gDBView.getKeyAt(row);
      var hdr = gDBView.db.GetMsgHdrForKey(key);
      return hdr.getStringProperty("junkscore");

To make this work with all types of folders, change the next to last line to:

      var hdr = gDBView.getFolderForViewIndex(row).GetMessageHeader(key);

Still doesn't work for group sort, which was the original point of this bug.
This is a pretty simple fix. I'll do a patch for it.
Assignee: bienvenu → kent
I just needed to add the observer call in threadpane.js. One little quirk is that I needed a viewtype, which the observer service sends, though as far as I know nobody is really using. Anyway, the switch to grouped sort claims to be nsMsgViewType.eShowAllThreads. This perpetuates the existing bug that grouped by sort does not work in single-folder virtual folders, but instead returns the entire folder.
Attachment #329105 - Flags: superreview?(bienvenu)
Attachment #329105 - Flags: review?(bienvenu)
Comment on attachment 329105 [details] [diff] [review]
Added observer call in threadpane.js

looks right, except there's no need for the local var viewType, or observerService - it can all be one statement (on several lines :-))
Attachment #329105 - Flags: superreview?(bienvenu)
Attachment #329105 - Flags: superreview+
Attachment #329105 - Flags: review?(bienvenu)
Attachment #329105 - Flags: review+
This does not just affect TB or Windows.
Severity: normal → minor
Status: NEW → ASSIGNED
Component: Mail Window Front End → MailNews: Backend
OS: Windows XP → All
Product: Thunderbird → Core
Hardware: PC → All
Target Milestone: --- → mozilla1.9.1
Version: unspecified → Trunk
Here's the revisision without local variables. Have to wait until the tree opens to checkin-needed though.
Attachment #329105 - Attachment is obsolete: true
QA Contact: front-end → backend
Keywords: checkin-needed
Checking in mailnews/base/resources/content/threadPane.js;
/cvsroot/mozilla/mailnews/base/resources/content/threadPane.js,v  <--  threadPane.js
new revision: 1.98; previous revision: 1.97
done
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: