Bug 431454

Summary: Opening files from URLs using the Open dialog has broken
Product: [Applications] okular Reporter: Nate Graham <nate>
Component: generalAssignee: Okular developers <okular-devel>
Status: VERIFIED FIXED    
Severity: normal CC: aacid
Priority: NOR Keywords: regression
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.79
Attachments: attachment-14544-0.html

Description Nate Graham 2021-01-11 18:12:05 UTC
Everything from git master.

1. File > Open
2. Paste "https://apps.dtic.mil/dtic/tr/fulltext/u2/a044796.pdf" into the filename field
3. Click Open

Error message that says: The file "/home/nate/SpiderOak Hive/Manuals/https://apps.dtic.mil/dtic/tr/fulltext/u2/a044796.pdf" could not be found"

"/home/nate/SpiderOak Hive/Manuals/" is the current directory displayed by the dialog, so it appears to be simply appending the URL to it rather than opening it unmodified.

Running `okular https://apps.dtic.mil/dtic/tr/fulltext/u2/a044796.pdf` works.

Opening https://invent.kde.org/plasma/plasma-desktop/-/blob/master/CMakeLists.txt in Kate's open dialog works. Even trying to open the PDF file in Kate's open dialog works (though of course it doesn't load the file properly).
Comment 2 Albert Astals Cid 2021-01-11 23:46:24 UTC
KIO is broken and doesn't support opening full urls if opening directories is allowed.

With the new code we can open directories (for the image plugin to show various images) but we can't open full urls.

With the old code we could open full urls but not directories.

I'll try to propose a patch for KIO but it's always hard to touch KFileWidget
Comment 3 Bug Janitor Service 2021-01-12 00:10:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/303
Comment 4 Nate Graham 2021-01-12 01:14:20 UTC
> With the new code we can open directories (for the image plugin to show various
> images) but we can't open full urls.
> 
> With the old code we could open full urls but not directories.
LOL! Thanks for looking into it, Albert. I'll check out that merge request.
Comment 5 David Faure 2021-01-17 08:43:14 UTC
Git commit dff0aee217abd99ded4bde54954d5917a8a9a28b by David Faure, on behalf of Albert Astals Cid.
Committed on 17/01/2021 at 08:42.
Pushed by dfaure into branch 'master'.

Tweak KFileWidget::slotOk logic when in files+directory mode

I don't see why we wouldn't do the "if this is an absolute path, try
opening that and not what tokenize gave us" when in the files+directory
mode, so changed to not do it when in the onlyDirectoryMode

M  +5    -4    src/filewidgets/kfilewidget.cpp

https://invent.kde.org/frameworks/kio/commit/dff0aee217abd99ded4bde54954d5917a8a9a28b
Comment 6 moonfrees@gmail.com 2021-01-17 09:34:47 UTC
Created attachment 134956 [details]
attachment-14544-0.html

Hye, is it possible to stop mails please thanks.
I don;t speak english so well to understand. Have a good day

Philippe Cayzelle

34 rue Henri Guillaumet

https://www.google.fr/maps/place/34+Rue+Henri+Guillaumet,+86000+Poitiers/@46.590128,0.321032,17z/data=!3m1!4b1!4m5!3m4!1s0x47fdbe06e41d2c5d:0x6d132c97dee94d8!8m2!3d46.5901243!4d0.3232207

86000 Poitiers

Poitou-Charentes / Nouvelle Aquitaine France

033 06 67 10 83 11

033  09 72 89 12 97

moonfrees@gmail.com





*S'il vous plait, lors de vos transferts de mails :1 - Effacez l'adresse de
l'expéditeur ainsi que toute autre adresse qui apparaîtrait dans le corps
du message.2 - Protégez les adresses des destinataires en les plaçant dans
la ligne Cci (Copie conforme invisible).3 - Copiez ces points et ajoutez
les dans la configuration de votre signature pour qu'elle s'ajoute dans les
mails que vous envoyezMerci*




Le dim. 17 janv. 2021 à 09:43, David Faure <bugzilla_noreply@kde.org> a
écrit :

> https://bugs.kde.org/show_bug.cgi?id=431454
>
> David Faure <faure@kde.org> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>       Latest Commit|                            |
> https://invent.kde.org/fram
>                    |
> |eworks/kio/commit/dff0aee21
>                    |
> |7abd99ded4bde54954d5917a8a9
>                    |                            |a28b
>              Status|ASSIGNED                    |RESOLVED
>          Resolution|---                         |FIXED
>
> --- Comment #5 from David Faure <faure@kde.org> ---
> Git commit dff0aee217abd99ded4bde54954d5917a8a9a28b by David Faure, on
> behalf
> of Albert Astals Cid.
> Committed on 17/01/2021 at 08:42.
> Pushed by dfaure into branch 'master'.
>
> Tweak KFileWidget::slotOk logic when in files+directory mode
>
> I don't see why we wouldn't do the "if this is an absolute path, try
> opening that and not what tokenize gave us" when in the files+directory
> mode, so changed to not do it when in the onlyDirectoryMode
>
> M  +5    -4    src/filewidgets/kfilewidget.cpp
>
>
> https://invent.kde.org/frameworks/kio/commit/dff0aee217abd99ded4bde54954d5917a8a9a28b
>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
Comment 7 Christoph Feck 2021-01-17 12:44:27 UTC
You need to unsubscribe from the okular-devel mailing list if you no longer want to follow Okular development.
Comment 8 Nate Graham 2021-01-19 16:20:13 UTC
Verified the fix. Thanks so much Albert!