Closed
Bug 715129
Opened 14 years ago
Closed 14 years ago
fp.appendFilters(nsIFilePicker.filterApps) does not show ".exe" file in the file picker
Categories
(Core :: Widget: Win32, defect)
Tracking
()
VERIFIED
FIXED
Tracking | Status | |
---|---|---|
firefox11 | --- | verified |
People
(Reporter: alice0775, Assigned: neil)
References
Details
(Keywords: regression, Whiteboard: [qa!])
Attachments
(1 file)
2.67 KB,
patch
|
jimm
:
review+
akeybl
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Build Identifier:
http://hg.mozilla.org/releases/mozilla-aurora/rev/e2fe885dce01
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0a2) Gecko/20120102 Firefox/11.0a2 ID:20120102042006
fp.appendFilters(nsIFilePicker.filterApps) does not show ".exe" file in the file picker
Reproducible: Always
Steps to Reproduce:
1. Start Firefox with clean profile
2. Open Error Console (Ctrl+Shift+J)
3. Paste the following code
const nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
fp.init(window, "Dialog Title", nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterApps);
var rv = fp.show();
4. Click Evaluate
5. Go to folder which contain ".exe" file (Ex. "C:\Program Files (x86)\Mozilla Firefox")
and Try to select any ".exe" file
Actual Results:
No ".exe" file is listed in the file picker
Expected Results:
".exe" file should be listed in the file picker
Regression window
Works:
http://hg.mozilla.org/mozilla-central/rev/d508455660d3
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0a1) Gecko/20111214 Firefox/11.0a1 ID:20111214125611
Fails:
http://hg.mozilla.org/mozilla-central/rev/5131c0b1982f
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0a1) Gecko/20111214 Firefox/11.0a1 ID:20111214132414
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=d508455660d3&tochange=5131c0b1982f
Suspected : Bug 661991
![]() |
||
Updated•14 years ago
|
Assignee: nobody → jmathies
![]() |
||
Updated•14 years ago
|
Assignee: jmathies → neil
Assignee | ||
Comment 1•14 years ago
|
||
Attachment #585758 -
Flags: review?(jmathies)
![]() |
||
Comment 2•14 years ago
|
||
Comment on attachment 585758 [details] [diff] [review]
Proposed patch
Review of attachment 585758 [details] [diff] [review]:
-----------------------------------------------------------------
::: widget/src/windows/nsFilePicker.cpp
@@ +1356,5 @@
> + else {
> + pStr->StripWhitespace();
> + if (pStr->EqualsLiteral("*"))
> + pStr->AppendLiteral(".*");
> + }
In the second part you're missing the initial assignment -
pStr->Assign(aFilter);
pStr->StripWhitespace();
..
r+ with this addressed.
Attachment #585758 -
Flags: review?(jmathies) → review+
Assignee | ||
Comment 3•14 years ago
|
||
Comment on attachment 585758 [details] [diff] [review]
Proposed patch
>- pStr = mStrings.AppendElement(aFilter);
>+ pStr = mStrings.AppendElement();
Or I could alternatively revert this change. Which would you prefer?
![]() |
||
Comment 4•14 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #3)
> Comment on attachment 585758 [details] [diff] [review]
> Proposed patch
>
> >- pStr = mStrings.AppendElement(aFilter);
> >+ pStr = mStrings.AppendElement();
> Or I could alternatively revert this change. Which would you prefer?
Thought we might still get the '..apps' in the drop down here, but we over write the value, so yeah this is fine by me.
![]() |
||
Comment 5•14 years ago
|
||
Comment on attachment 585758 [details] [diff] [review]
Proposed patch
https://hg.mozilla.org/mozilla-central/rev/3ec9d6539335
Attachment #585758 -
Flags: approval-mozilla-aurora?
![]() |
||
Updated•14 years ago
|
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 6•14 years ago
|
||
Comment on attachment 585758 [details] [diff] [review]
Proposed patch
> nsFilePicker::ComDlgFilterSpec::Append(const nsAString& aTitle, const nsAString& aFilter)
> {
>- PRUint32 size = sizeof(COMDLG_FILTERSPEC);
>- PRUint32 hdrLen = size * (mLength + 1);
>- mSpecList = (COMDLG_FILTERSPEC*)realloc(mSpecList, hdrLen);
>- if (!mSpecList) {
>+ COMDLG_FILTERSPEC* pSpecForward = mSpecList.AppendElement();
>+ if (!pSpecForward) {
> NS_WARNING("mSpecList realloc failed.");
> return;
> }
This is infallible; if it shouldn't be, the declaration should use an explicitly fallible nsAutoTArray
Assignee | ||
Comment 7•14 years ago
|
||
(In reply to Ms2ger from comment #6)
> This is infallible
Sorry, I was copying the style of the rest of the function, which also checks.
Comment 8•14 years ago
|
||
Comment on attachment 585758 [details] [diff] [review]
Proposed patch
[Triage Comment]
Approving for Aurora along with bug 712571. As noted there, it would be higher risk to back out all or part of 661991.
Attachment #585758 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
![]() |
||
Comment 9•13 years ago
|
||
Neil, would you like me to land 3ec9d6539335 on Aurora?
Assignee | ||
Comment 10•13 years ago
|
||
Yes please, I don't have an aurora tree.
![]() |
||
Comment 11•13 years ago
|
||
status-firefox11:
--- → fixed
Comment 12•13 years ago
|
||
Verified as fixed on:
Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0
The .exe files are displayed in the file picker.
You need to log in
before you can comment on or make changes to this bug.
Description
•