Closed Bug 305314 Opened 19 years ago Closed 19 years ago

Save as plain text sometimes fails to use correct extension

Categories

(Camino Graveyard :: Downloading, defect)

1.8 Branch
PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: alqahira, Assigned: nick.kreeger)

References

()

Details

(Keywords: fixed1.8)

Attachments

(1 file)

A leftover bit of bug 259903 I just discovered.

STR:
1. Save a page, selecting "Plain Text" as format.
2. Load another page; go to save it, too.
3. Camino remembers the choice of "Plain Text" but still provides .html as
extension (essentially, bug 259903 all over again)

Actual results: File is saved as plain text with .html extension
Expected: File is saved as plain text with .txt extension (as in step 1)

This happens whether "Hide Extension" is checked or not, but is easier to see
with it unchecked (i.e., extensions shown).

If you click the drop-down and "select" Plain Text again, .html changes to .txt;
is the extension only being changed when a format is being selected?

I assume it's the same on the trunk, but I haven't verified.
Hi,

Confirmed. I see the problem as well, a pointer to the pop up button in the
accessory view gets created and the sniffer code modifies the selection of that
button well before the accesorry view actually gets added to the NSSavePanel. So
the changes dont get registered in the FilterViewController.

On that note, I'll fix...
Assignee: pinkerton → nick.kreeger
Fixes the problem, since stringWith_nsAString returns a string that the
download diaglog doesn't like, replace the extension and add .txt if we are
saving as plain text..
Comment on attachment 194218 [details] [diff] [review]
Fixes this bug, appends correct extension

r=pink

are there any other cases we have to consider or is this it?
Attachment #194218 - Flags: review+
I dont believe so, the only problem with HTML is getting that .txt extension to
click over the first time and the user selects an HTML option the extension gets
replaced into a .html extension. After that is done, the default is left on
which ever HTML option the user selected. So when we go back through and check
to see if we need to replace the extension to a .txt, the filterIndex isn't |==|
to |eSaveFormatPlainText|
Checking in 1.8/mozilla/camino/src/download/SaveHeaderSniffer.mm;
/cvsroot/mozilla/camino/src/download/SaveHeaderSniffer.mm,v  <-- 
SaveHeaderSniffer.mm
new revision: 1.19.2.2; previous revision: 1.19.2.1
done
Checking in trunk/mozilla/camino/src/download/SaveHeaderSniffer.mm;
/cvsroot/mozilla/camino/src/download/SaveHeaderSniffer.mm,v  <-- 
SaveHeaderSniffer.mm
new revision: 1.21; previous revision: 1.20
done
Status: NEW → RESOLVED
Closed: 19 years ago
Keywords: fixed1.8
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: