Closed Bug 260872 Opened 20 years ago Closed 20 years ago

more gtk2 file chooser fun cleanup

Categories

(Core Graveyard :: GFX: Gtk, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: caillon, Assigned: caillon)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch Patch (obsolete) (deleted) — Splinter Review
Comment on attachment 159639 [details] [diff] [review]
Patch

Er, ignore the get_type stuff.	That was stuff I tried to get rid of the 64 bit
crasher with.

Anyway, this fixes the warning about the GdkWIndow invalid cast (and properly
parents the file chooser!), does some cleanup on the code to parse the filters,
and also tries to make sure that the Gtk2 module factory gets to decide which
file picker implementation to use when called with the contractid by removing
the xul contractid.
Attached patch Better patch (obsolete) (deleted) — Splinter Review
The code to cast here is a little better and should be more failsafe.
Attachment #159639 - Attachment is obsolete: true
Attachment #160265 - Flags: superreview?(bryner)
Attachment #160265 - Flags: review?(bryner)
Before I file yet another duplicate bug, does anyone know about the issue where
GTK2 builds of Mozilla don't ask for confirmation when saving a download over an
existing file?
(In reply to comment #4)
> GTK2 builds of Mozilla don't ask for confirmation when saving a download over an
> existing file?

bug 259220
Blocks: 262450
Comment on attachment 160265 [details] [diff] [review]
Better patch

>@@ -455,45 +477,20 @@ nsFilePicker::Show(PRInt16 *aReturn)
>                                          directory.get());
>   }
> 
>-  PRInt32 count = mFilters.Count();
>-  for (PRInt32 i = 0; i < count; ++i) {
>-    GtkFileFilter *filter = _gtk_file_filter_new ();
>-
>+  int count = mFilters.Count();

This should be PRInt32, that's what the nsVoidArray method returns.

>+  for (int i = 0; i < count; ++i) {

Same.

>+    char **patterns = g_strsplit(mFilters[i]->get(), ";", -1);
>+    if (!patterns) {
>+      return NS_ERROR_UNEXPECTED;
>     }

NS_ERROR_OUT_OF_MEMORY, perhaps?  Also, you need to free |patterns| with
g_strfreev().

r+sr=bryner with those fixed.
Attachment #160265 - Flags: superreview?(bryner)
Attachment #160265 - Flags: superreview+
Attachment #160265 - Flags: review?(bryner)
Attachment #160265 - Flags: review+
Attached patch Addressing bryner's comments (deleted) — Splinter Review
This just got checked in
Attachment #160265 - Attachment is obsolete: true
This got checked in ages ago.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: