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 320868 - Doesn't tell user if it can't find gs
Doesn't tell user if it can't find gs
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
0.4.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-11-07 11:39 UTC by Ross Burton
Modified: 2006-02-13 06:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch against cvs head with cvs diff up for #320868 (3.41 KB, text/plain)
2006-02-12 19:36 UTC, Antoine Dopffer
  Details
patch against cvs head with cvs diff up for #320868 (2.24 KB, patch)
2006-02-12 21:04 UTC, Antoine Dopffer
committed Details | Review

Description Ross Burton 2005-11-07 11:39:11 UTC
If I'm foolish enough to try and view a PS file in Evince without installin
Ghostscript, I get a message in the console and blank pages in the window. 
Evince should pop up a dialog telling me what the problem is instead.
Comment 1 Nickolay V. Shmyrev 2005-12-29 17:23:21 UTC
It would be nice to do the check.
Comment 2 Antoine Dopffer 2006-02-12 19:36:56 UTC
Created attachment 59201 [details]
patch against cvs head with cvs diff up for #320868

Hello,
as a gnome lover I have done this patch which should fix #320868.
The postcript file is not opened if the gs file is not found.

By the the gs path is checked at compile time, see #330913

Have a nice day.
Comment 3 Nickolay V. Shmyrev 2006-02-12 19:54:13 UTC
Hey Antoine. First of all you are greatly welcome :)

Really great that you have started to look at the problem. That was my fault that I haven't explained completely what should be done. Actually I was expected something different. It's a purely PS backend problem and it should be solved there. Although I am agree about run-time gs checking I am disagree on proposed way.

Our document_load function can return errors in GError and this is the way you should use. Please look at backend/ev-document.c and in ps/ps-document.c on function ps_document_load. The error is returned there in some cases but not in particular case that is described in this bug. We need to check for gs presense in that function ps_document_load.



If you can join #evince list we'll be happy to help and discuss this problem closer.

P.S. Don't use comments like 

Bug #320868 : tell the user if can't find gs

they don't fit in standard coding practice
Comment 4 Antoine Dopffer 2006-02-12 21:04:51 UTC
Created attachment 59206 [details] [review]
patch against cvs head with cvs diff up for #320868

Hello,

Thank you for your time,  Nickolay.
With your help, this patch should be better.
Comment 5 Antoine Dopffer 2006-02-12 21:07:38 UTC
Hello,

I am sorry I did forget to say in my previous post that I didn't remove the macro for GS_PATH in configure.ac
That macro should be removed.

Goodbye

Comment 6 Nickolay V. Shmyrev 2006-02-13 06:54:57 UTC
Antoine, thanks. Since there was an hour left before the string freeze we had to act quickly and commit patch. Otherwise we'll be managed to postpone it until April. 

But I had to modify your patch a bit. Main issues were:

1. Incorrect formatting, please follow the coding style of package you are working on

2. Memory leaks (you should free the string you get from g_find_program_in_path)

You can checkout latest HEAD if you wanna look at this changes.