[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#991127: unblock: kio/5.78.0-5



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: debian-qt-kde@lists.debian.org

Please unblock package kio

Backport of fix for upstream bug https://bugs.kde.org/show_bug.cgi?id=439477
from merge request https://invent.kde.org/frameworks/kio/-/merge_requests/498

What happens is that:
- if you select a browser not by .desktop file but via binary
- then click on a link 
- the file is downloaded and cached, and the cached version is shown

Example:
run `kcmshell5 componentchooser`
click web browser -> other -> type in /usr/bin/firefox
Apply
Then runJ `kde-open5 http://kde.org`
This opens the content of kde.org web page from a local cache file
file:///home/norbert/.cache/kioexec/krun/98133_0/unnamed

This is rather unfortunate.

[ Reason ]
Users will have:
- strange location in the URL bar, instead of the correct URL
- accumulate files in .cache


[ Impact ]
See above

[ Tests ]
Testing that before the patch, the above procedure opened the cached
url, and after the proper web page (if the generated .desktop file 
is removed and regenerated - this is something we cannot fix now).


[ Risks ]
Very low to zero. Trivial code.

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing
      the new debian/patch file is attached, besides
      debian/changelog this is the only change.

unblock kio/5.78.0-5


Best

Norbert

--
PREINING Norbert                              https://www.preining.info
Fujitsu Research  +  IFMGA Guide  +  TU Wien  +  TeX Live  + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
>From 8ad6921524c92a0cf1b58336b3ce29e159e83b7d Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Wed, 14 Jul 2021 17:06:59 +0100
Subject: [PATCH] Fix selecting binaries from component chooser KCM

In the kcmshell for a component chooser we use the open with dialog to
select services for various scheme handlers.

If you select a binary instead of a .desktop file a temporary .desktop
file is created in ~/.local/share/applications

This is in the format
Exec=someBinary
MimeType=x-scheme-handler/http

When we then use this application for launching KIO::DesktopExecParser
then (sort of correctly) determines that that the chosen service cannot
handle the http scheme because even though it is a scheme handler it
does not have a "%u" in the exec line.

This leads to us potentially loading websites via kioclient or kio-fuse.

Testing done:
 - kcmshell5 component chooser
 - web browser -> other -> type "/usr/bin/firefox"
 - kde-open5 http://kde.org
 - Previously this gave a local URL, now it is correct
---
 src/widgets/kopenwithdialog.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/widgets/kopenwithdialog.cpp b/src/widgets/kopenwithdialog.cpp
index 1831878ca..31295044d 100644
--- a/src/widgets/kopenwithdialog.cpp
+++ b/src/widgets/kopenwithdialog.cpp
@@ -1088,6 +1088,14 @@ bool KOpenWithDialogPrivate::checkAccept()
             KConfigGroup cg = desktopFile.desktopGroup();
             cg.writeEntry("Type", "Application");
             cg.writeEntry("Name", initialServiceName);
+
+            // if we select a binary for a scheme handler, then it's safe to assume it can handle URLs
+            if (qMimeType.startsWith(QLatin1String("x-scheme-handler/"))) {
+                if (!typedExec.contains(QLatin1String("%u"), Qt::CaseInsensitive) && !typedExec.contains(QLatin1String("%f"), Qt::CaseInsensitive)) {
+                    fullExec += QStringLiteral(" %u");
+                }
+            }
+
             cg.writeEntry("Exec", fullExec);
             cg.writeEntry("NoDisplay", true); // don't make it appear in the K menu
             if (terminal->isChecked()) {
-- 
GitLab


Reply to: