Bug 193132 - Misleading error message if .gz file does not exist.
Summary: Misleading error message if .gz file does not exist.
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.8.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-18 18:12 UTC by jarauh
Modified: 2010-07-30 00:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch (919 bytes, patch)
2010-07-29 23:53 UTC, Mathieu Lornac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jarauh 2009-05-18 18:12:50 UTC
Version:           0.8.3 (using KDE 4.2.3)
Compiler:          gcc 4.3.3 
OS:                Linux
Installed from:    Gentoo Packages

If I try to open a .ps.gz file that does not exist, I get the following error message:

"File Error! Could not open the file /home/jarauh/okula/home/jarauh/Documents/manual/ch8.ps.gz for uncompression. The file will not be loaded."

If I click on details, I get:

"This error typically occurs if you do not have enough permissions to read the file. You can check ownership and permissions if you right-click on the file in the Dolphin file manager and then choose the 'Properties' tab."

When I click on `ok´ another error message comes up:
"Could not open file:///home/jarauh/okula/home/jarauh/Documents/manual/ch8.ps.gz"

If the file has any other ending (not .gz) then I only get the second kind of error message.

I am not completely sure what the correct KDE-behaviour in such a situation should look like, but I think that this should be improved (at least, one error message should be enough in any case...).

Maybe okular could check whether the file exists before invoking any backend.
Comment 1 Pino Toscano 2009-05-24 20:08:54 UTC
Yes, can confirm the duplicate message.
In general, there should be better error messages, whenever possible.
Comment 2 Mathieu Lornac 2010-07-29 23:53:00 UTC
Created attachment 49657 [details]
patch

Added a file existence test.
openFile() returns false whether the in-existing file is an archive or not.
Only one message indicating an error is displayed.

Albert, If the patch is ok, can i commit myself?
With your instructions of course ;-)
Comment 3 Albert Astals Cid 2010-07-30 00:57:00 UTC
SVN commit 1156882 by aacid:

backport r1156880 | mathieulornac | 2010-07-29 23:51:49 +0100 (Thu, 29 Jul 2010) | 5 lines

Checks if a file exists before trying to open it.
Prevents from having 2 error messages when the file is an archive
acked by tsdgeos
BUG: 193132
FIXED-IN: KDE 4.5.1


 M  +6 -2      part.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1156882