Diffusion KIO b2b10ee69cce

Introduce KIO::OpenUrlJob, a rewrite and replacement for KRun

Authored by dfaure on May 3 2020, 10:48 PM.

Description

Introduce KIO::OpenUrlJob, a rewrite and replacement for KRun

Summary:

  • KRun::runUrl() is now new OpenUrlJob(url, mimeType).
  • new KRun() is now OpenUrlJob(url), which will first determine the mimeType.
  • the "open with" dialog is provided by KIOWidgets via JobUiDelegate and an interface defined in kiogui. When not using JobUiDelegate, we'll fall back to QDesktopServices::openUrl, which will call xdg-open, which will call kde-open5, which will prompt an open with dialog :-)
  • Running of scripts and executables is off by default, unlike in KRun, since this created a few security bugs in unsuspecting applications in the past. File managers should enable it, apps that can open attachments or similar things should leave it disabled.
  • Instead of BrowserRun/KonqRun deriving from KRun, they can use an OpenUrlJob as is, connect to mimeTypeFound and kill the job if they want to take over (to embed the document instead of launching an app)

I tried to unittest OpenUrlJob as much as possible. The parts that are
least unittests are those related to remote protocols though, since they
require test servers.

Test Plan: Mostly via unittests, for now

Reviewers: ahmadsamir, broulik, meven, kossebau, davidedmundson, nicolasfella, svuorela

Reviewed By: broulik

Subscribers: feverfew, kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D29385

Details

Committed
dfaureMay 8 2020, 8:31 AM
Reviewer
broulik
Differential Revision
D29385: Introduce KIO::OpenUrlJob, a rewrite and replacement for KRun
Parents
R241:692d9bc81f00: [LauncherJobs] Emit description
Branches
Unknown
Tags
Unknown