Closed
Bug 236227
Opened 21 years ago
Closed 19 years ago
crash if requesting drive icon with moz-icon:
Categories
(Core :: Graphics: ImageLib, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: philippe.goetz, Assigned: neil)
References
()
Details
Attachments
(1 file)
742 bytes,
patch
|
mscott
:
review+
tor
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent:
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7a) Gecko/20040219
The moz-icon: library crashes when requesting the icon of a drive
moz-icon:file:///C|/. This is true with all drives (at least A: and C:).
Reproducible: Always
Steps to Reproduce:
1. Enter the url moz-icon:file:///C|/
Actual Results:
Crash
Expected Results:
Returning the icon of the drive (amovible, fixed, cd-rom, etc...) - expected to
be found in shell32.dll
Comment 1•21 years ago
|
||
might've been fixed by bug 235537; the crash part at least, although it won't
make the icon show
Depends on: 235537
Assignee | ||
Comment 2•21 years ago
|
||
The icon doesn't show because line 748 (or so) of nsLocalFileWin.cpp strips the
\ from C:\ so that you get C: instead; unfortunately you can't just not strip
the \ because stuff like AppendNative expects it to be stripped.
Reporter | ||
Comment 3•21 years ago
|
||
In order to retrieve the icon related to the drives make the following patch:
in mozilla/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp
Add the following lines in function nsIconChannel::MakeInputStream
if(filePath.Last()==PRUnichar(':')) {
filePath.Append(PRUnichar('\\'));
}
after
if (!fileExists)
infoFlags |= SHGFI_USEFILEATTRIBUTES;
Reporter | ||
Comment 4•21 years ago
|
||
A better patch for the icon of drives (which avoid to be asked to insert the
drive ):
File: mozilla/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp
Function: nsIconChannel::MakeInputStream (line #220)
...
if (localFile)
{
localFile->GetNativePath(filePath);
+ if(filePath.Last()==PRUnichar(':'))
+ filePath.Append(PRUnichar('\\'));
+ else
localFile->Exists(&fileExists);
}
...
Assignee | ||
Comment 5•21 years ago
|
||
Hmm... won't this last patch fail to check if the drive exists?
Reporter | ||
Comment 6•21 years ago
|
||
(In reply to comment #5)
> Hmm... won't this last patch fail to check if the drive exists?
This is not a problem with Windows (at least XP). Because Windows returns a
special icon indicating an indexistant drive (the drive icon with a white
question mark in a red ball). Try it (e.g. moz-icon:file:///Z|/ when Z: doesn't
exist).
This is very useful when you build a file browser in a tree with a template
using rdf:files. The patch avoids to be asked for a disk for removable drives
e.g. A: (or a CD-ROM) when no disk is present. A pitty...
Consider that...
Assignee | ||
Comment 7•21 years ago
|
||
OK, so this works for missing drives, but it doesn't seem to like to generate
icons for missing files, so I added in a few extra lines to handle those.
Assignee: jdunn → neil.parkwaycc.co.uk
Status: UNCONFIRMED → ASSIGNED
Comment 8•21 years ago
|
||
does os/2 need a similar change?
what does nt 3.51 do? :)
Comment 9•21 years ago
|
||
on os/2 I'm asked to download the icon, it doesn't display. I vaguely remember a
difference with the moz-icon protocol on OS/2....
Reporter | ||
Comment 10•21 years ago
|
||
(In reply to comment #8)
> does os/2 need a similar change?
>
> what does nt 3.51 do? :)
Mozilla 1.7b would not install on Windowd NT 3.51 Server SP5!!!!
- missing/innacessible MSVCRT.DLL
+ many other request of the same style
Assignee | ||
Comment 11•21 years ago
|
||
(In reply to comment #10)
>Mozilla 1.7b would not install on Windowd NT 3.51 Server SP5!!!!
That's an installer issue, most of 1.7 runs on NT 3.51
Comment 12•19 years ago
|
||
Neil,
Is this patch still relevant? I don't see this patch added in trunk, so I'm thinking it was never committed.
Assignee | ||
Comment 13•19 years ago
|
||
Comment on attachment 145130 [details] [diff] [review]
Proposed patch
This just fixes the aspect that you can't get icons for drives from moz-icon:
Attachment #145130 -
Flags: review?(mscott)
Updated•19 years ago
|
Attachment #145130 -
Flags: review?(mscott) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #145130 -
Flags: superreview?(tor)
Attachment #145130 -
Flags: superreview?(tor) → superreview+
Assignee | ||
Comment 14•19 years ago
|
||
Drive icon fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•