Ticket #50 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] PDF filter in open file dialog not working

Reported by: LoneFox Owned by: jordi
Priority: trivial Version: 0.1.5
Keywords: Cc:

Description

I guess mime type support requires some package that I don't have installed in my system. Why not use .pdf extension in addition to the mime type?

diff -Nur epdfview-0.1.5-orig/src/gtk/MainView.cxx epdfview-0.1.5/src/gtk/MainView.cxx
--- epdfview-0.1.5-orig/src/gtk/MainView.cxx	2006-06-12 23:11:34.000000000 +0300
+++ epdfview-0.1.5/src/gtk/MainView.cxx	2006-06-18 09:57:30.000000000 +0300
@@ -288,7 +288,9 @@
         gtk_file_filter_set_name (pdfFilter, 
                                   _("Portable Document Format (PDF) Files"));
         gtk_file_filter_add_mime_type (pdfFilter, "application/pdf");
-
+        gtk_file_filter_add_pattern(pdfFilter, "*.pdf");
+        gtk_file_filter_add_pattern(pdfFilter, "*.PDF");
+        
         gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (openDialog), pdfFilter);
         // Set this filter as the default.
         gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (openDialog), pdfFilter);
@@ -393,7 +395,9 @@
         GtkFileFilter *pdfFilter = gtk_file_filter_new ();
         gtk_file_filter_set_name (pdfFilter, 
                                   _("Portable Document Format (PDF) Files"));
         gtk_file_filter_add_mime_type (pdfFilter, "application/pdf");
+        gtk_file_filter_add_pattern(pdfFilter, "*.pdf");
+        gtk_file_filter_add_pattern(pdfFilter, "*.PDF");
 
         gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (saveDialog), pdfFilter);
         // Set this filter as the default.

Change History

Changed 2 years ago by jordi

  • status changed from new to closed
  • resolution set to fixed

I received an e-mail with the same issue which was caused by a "very minimal" Gtk+ installation. I don't have the details, though.

I applied the patch you supplied in commit [249] and when I tested it worked with both the pattern matching and mime type matching.

Thank you.

Note: See TracTickets for help on using tickets.