After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 572543 - Doesn't show correct application for pdf attachments
Doesn't show correct application for pdf attachments
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.26.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Milan Crha
Evolution QA team
evolution[attachments] evolution[kill...
: 574629 586372 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-02-20 10:50 UTC by Akhil Laddha
Modified: 2013-09-13 01:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
test mail (3.98 KB, text/plain)
2009-02-20 12:38 UTC, Milan Crha
  Details
proposed evo patch (2.88 KB, patch)
2009-02-20 13:25 UTC, Milan Crha
needs-work Details | Review
proposed evo patch ][ (2.59 KB, patch)
2009-02-23 11:43 UTC, Milan Crha
committed Details | Review

Description Akhil Laddha 2009-02-20 10:50:58 UTC
It shows me 'gedit' to open a pdf attachment instead of evince or
pdf viewer.


Message source 


--=-AMEP4L5GCFURxYZaBoSK
Content-Disposition: attachment; filename="sample-1 day report.pdf"
Content-Type: application/octet-stream

%PDF-1.3
%
4 0 obj
<< /Type /Info
/Producer (FOP 0.20.5rc) >>
endobj
5 0 obj
<< /Length 4327 /Filter [ /ASCII85Decode /FlateDecode ]
 >>
Comment 1 Milan Crha 2009-02-20 12:38:14 UTC
Created attachment 129144 [details]
test mail

could you try with this mail, please? it works fine to me for all of them, I see a "Document Viewer" with all those attachments.
Comment 2 Milan Crha 2009-02-20 13:25:49 UTC
Created attachment 129149 [details] [review]
proposed evo patch

for evolution;

gedit is registered for application/octet-stream, which prevented to look for alternative apps before this patch. After the patch you'll see both, just those alternative apps will be first.
Comment 3 Matthew Barnes 2009-02-20 15:22:34 UTC
Looks okay except for the g_list_free (apps).

   g_list_concat:

   Adds the second GList onto the end of the first GList. Note that the
   elements of the second GList are not copied. They are used directly.

So you could do away with the 'if' block and just say:

   alt_apps = g_app_info_get_all_for_type (cp ? cp : name_type);
   apps = g_list_concat (alt_apps, apps);

Either argument can be NULL since NULL is still a valid GList.

Adding note to myself to adapt this for kill-bonobo.
Comment 4 Milan Crha 2009-02-23 11:43:22 UTC
Created attachment 129312 [details] [review]
proposed evo patch ][

for evolution;

Err, I read that documentation, but I really wasn't sure, it's quite unclear to me how the g_list_concat works, and I was lazy to open sources for that. Anyway, this patch does the work properly.
Comment 5 Matthew Barnes 2009-02-23 12:03:54 UTC
That looks better.
Comment 6 Milan Crha 2009-02-23 15:16:43 UTC
Committed to trunk. Committed revision 37312.
Committed to gnome-2-24. Committed revision 37313.
Comment 7 Matthew Barnes 2009-03-10 11:50:21 UTC
*** Bug 574629 has been marked as a duplicate of this bug. ***
Comment 8 Milan Crha 2009-06-03 14:40:27 UTC
Akhil, I see the patch is in evo master, thus seems like something new. Could you check whether your content-type of a pdf part is "application/octet-stream" or some different? it compares case sensitively, thus the exact value matters. Thanks.
Comment 9 Matthew Barnes 2009-06-03 16:01:49 UTC
I re-fixed this for 2.27 in
http://git.gnome.org/cgit/evolution/commit/?id=2c3ca95413624723d717cf0f8876b88b5df3c12e

It got dropped in the attachment rewrite.
Comment 10 Milan Crha 2009-06-03 17:27:47 UTC
(In reply to comment #9)
> I re-fixed this for 2.27 in
> http://git.gnome.org/cgit/evolution/commit/?id=2c3ca95413624723d717cf0f8876b88b5df3c12e

Left there one g_debug :)
Comment 11 Matthew Barnes 2009-06-03 19:12:04 UTC
Yeah, I caught that in the followup commit.
Comment 12 Matthew Barnes 2009-06-19 12:39:43 UTC
*** Bug 586372 has been marked as a duplicate of this bug. ***