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 766531 - evince-previewer cannot open from URI
evince-previewer cannot open from URI
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-16 19:22 UTC by Tom 'spot' Callaway
Modified: 2016-05-24 11:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
./test-uri file:///path/to/file.pdf (512 bytes, text/plain)
2016-05-16 19:22 UTC, Tom 'spot' Callaway
  Details
previewer: handle opening files from URI (1.22 KB, patch)
2016-05-23 12:07 UTC, Felipe Borges
committed Details | Review

Description Tom 'spot' Callaway 2016-05-16 19:22:37 UTC
Created attachment 328007 [details]
./test-uri file:///path/to/file.pdf

Backstory here:
http://entrenchant.blogspot.com/2016/03/xdg-open-arcanery.html
https://bugzilla.redhat.com/show_bug.cgi?id=1329804
https://phab.enlightenment.org/T3555

At a minimum, evince-previewer should be fixed to not choke on a URI argv[0].
The problem is here (line 197) in previewer/ev-previewer.c:

      if (!g_file_test (argv[1], G_FILE_TEST_IS_REGULAR)) {
               g_printerr ("Filename \"%s\" does not exist or is not a regular file\n", argv[1]);
              return 1;
      }

g_file_test returns failure when being passed a raw URI. I've attached simple test code which illustrates this fact. 

I tried quite a few different things to fix this, but none of them worked. :/
Comment 1 Felipe Borges 2016-05-23 12:07:36 UTC
Created attachment 328380 [details] [review]
previewer: handle opening files from URI
Comment 2 Carlos Garcia Campos 2016-05-24 11:23:44 UTC
Comment on attachment 328380 [details] [review]
previewer: handle opening files from URI

Thanks
Comment 3 Felipe Borges 2016-05-24 11:52:37 UTC
Attachment 328380 [details] pushed as 71767db - previewer: handle opening files from URI