Closed Bug 1937399 Opened 8 months ago Closed 5 months ago

Ensure futils getPicker is always passed a typeList which is an array of arrays in cZ

Categories

(SeaMonkey :: Chat, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: iannbugzilla, Assigned: iannbugzilla)

Details

Attachments

(1 file, 2 obsolete files)

At the moment typeList can be a string or an array containing arrays and strings, we should make it always be an array of arrays to simplify the code.

[Approval Request Comment]
Regression caused by (bug #): n/a
User impact if declined: none
Testing completed (on m-c, etc.): 2.53.21pre
Risk to taking this patch (and alternatives if risky): low
String changes made by this patch: none

The new logic means:

  • An empty array adds just an "All Files" filter
  • An array entry containing ["$all", ""] adds "All Files" file at the start of the list of filters
  • An array with neither ["$all", ""] nor ["$noAll", ""] adds "All Files" filter at the end of the list of filters
Attachment #9443716 - Flags: review?(frgrahl)
Attachment #9443716 - Flags: approval-comm-release?

Comment on attachment 9443716 [details] [diff] [review]
1937399-irc-file-utils-getPicker-25321.patch

The case "$all": is missing a break. Intentional? Even with the break shouldn't "includeAll = false" be set there too so that at the end all is not added again twice? Or the appendFilters not called in the case and only a break used?

In the default case two types are used but there is no check if type[1] exists: picker.appendFilter(type[0], type[1]). The existing calls seem to be ok but feels a bit unsafe.

I didn't actually test but otherwise seems fine to me r/a+ with the first item fixed/explained.

Flags: needinfo?(iannbugzilla)
Attachment #9443716 - Flags: review?(frgrahl)
Attachment #9443716 - Flags: review+
Attachment #9443716 - Flags: approval-comm-release?
Attachment #9443716 - Flags: approval-comm-release+

[Triage Comment]
Carrying forward r/a

Attachment #9443716 - Attachment is obsolete: true
Flags: needinfo?(iannbugzilla)
Attachment #9470649 - Flags: review+
Attachment #9470649 - Flags: approval-comm-release+

Fix comment

Attachment #9470649 - Attachment is obsolete: true
Attachment #9470911 - Flags: review?(frgrahl)
Attachment #9470911 - Flags: approval-comm-release?

Pushed by frgrahl@gmx.net:
https://hg.mozilla.org/comm-central/rev/553e4554f26a
Ensure futils getPicker is always passed a typeList which is an array of arrays in cZ. r=frg DONTBUILD

Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED

Comment on attachment 9470911 [details] [diff] [review]
1937399-irc-file-utils-getPicker-v1_2-25321.patch

[Triage Comment]

Attachment #9470911 - Flags: review?(frgrahl)
Attachment #9470911 - Flags: review+
Attachment #9470911 - Flags: approval-comm-release?
Attachment #9470911 - Flags: approval-comm-release+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: