Bug 421823

Summary: Okular downloads PDF file from samba share to local file system on opening
Product: [Applications] okular Reporter: Patrick Silva <bugseforuns>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: aacid
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: screenshot

Description Patrick Silva 2020-05-20 13:40:22 UTC
Created attachment 128637 [details]
screenshot

STEPS TO REPRODUCE
1. open a samba share containing a pdf file with Dolphin
2. open the pdf file with Okular
3. 

OBSERVED RESULT
Okular downloads the pdf file from samba share to local file system
and Plasma notifies about it. See the attached screenshot please.

EXPECTED RESULT
Okular should open files from samba share without downloading them first

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.71.0
Qt Version: 5.14.2
Comment 1 Albert Astals Cid 2020-05-20 18:24:19 UTC
How are we supposed to open a file without downloading it? Do you view webpages without downloading them?
Comment 2 Christoph Feck 2020-05-20 20:17:45 UTC
The idea is to be able to "see" the (first) page without downloading the complete file. Since the PDF directory is at the end of the file, the I/O protocol must support seeking, and the actual PDF loading must use scattered seek/read. I am not sure if SMB KIO supports seeking (or if you need to use a FUSE mount for it to work).
Comment 3 David Hurka 2020-05-22 09:37:36 UTC
> Okular downloads [...]
> and Plasma notifies about it. See the attached screenshot please.

I interpret this as follows: Plasma makes this popup everytime a download is complete, so the user knows when he/she can use the file. But when Okular downloads the file to use it, the user doesn’t care about downloads, but just wants to see the document in Okular.

So the bug is
a) that Okular doesn’t mark the download transaction as “internal” or similar, so Plasma thinks that the user needs to know when it is complete. 
b) or that Plasma notifies about such internal downloads although that is useless.
Comment 4 Albert Astals Cid 2020-05-22 23:00:03 UTC
But you want download progress info, what if the file is 300MB and takes a while to get? I really want to see that progress bar
Comment 5 Christoph Feck 2020-05-23 07:56:40 UTC
The progress bar is fine, the notification that it is finished is useless, because when it is finished, it will show the document anyway.

This is different from a regular download, where nothing happens when it is finished (unless there was a "download finished" notification).
Comment 6 Albert Astals Cid 2020-05-23 10:25:17 UTC
>  the notification that it is finished is useless

Is it? if it's a very long file i may have switched away to firefox to continue looking at cat pictures and i want to be told when the "download" finishes
Comment 7 Patrick Silva 2020-05-23 12:44:13 UTC
Initially I thought that Evince doesn't download the file to local file system
because it opens the file faster than Okular and plasma shows no notification.
I'm wrong. Evince downloads the file as I scroll throught its pages.
Apparently it's not possible to open all pages of a document without downloading the file before like we can listen to an audio or watch a video entirely without downloading them.
Comment 8 David Hurka 2020-05-23 14:35:03 UTC
(In reply to Albert Astals Cid from comment #6)
> >  the notification that it is finished is useless
> 
> Is it? if it's a very long file i may have switched away to firefox to
> continue looking at cat pictures and i want to be told when the "download"
> finishes

Good point, I think the current behavior is the intended behavior then. It is probably more problematic than good to intelligently decide whether to show the notification or not.

Then the remaining part of this bug is whether Okular could show the first pages of a document while the last pages are still downloading. If Evince can do that, Poppler apparently can do that, and I don’t see a reason why the Generator interface of Okular couldn’t handle that.
Comment 9 Albert Astals Cid 2020-05-23 14:48:04 UTC
(In reply to David Hurka from comment #8)
> I don’t see a reason why
> the Generator interface of Okular couldn’t handle that.

The generators always get passed local files, this means they always need to be complete. If you want to support streaming files, we're going to need to give them a QIODevice, etc. Not totally trivial. Anyhow i'd say we should close this bug and if you want to open one to support Linearized PDF files, there's probably one around somewhere already :D

Also evince is probably just using gvfs which does a local mount of remote files so in a sense it's much easier for them, kio is cool but doesn't really help in this case in which we need to seek back and forth in the file
Comment 10 Bug Janitor Service 2020-06-07 04:33:09 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Bug Janitor Service 2020-06-22 04:33:11 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!