D29385: Introduce KIO::OpenUrlJob, a rewrite and replacement for KRun
David Faure
noreply at phabricator.kde.org
Sun May 3 15:39:19 BST 2020
dfaure created this revision.
dfaure added reviewers: ahmadsamir, broulik, meven, kossebau, davidedmundson, nicolasfella, svuorela.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
dfaure requested review of this revision.
REVISION 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
REPOSITORY
R241 KIO
BRANCH
2020_05_openurljob
REVISION DETAIL
https://phabricator.kde.org/D29385
AFFECTED FILES
autotests/CMakeLists.txt
autotests/krununittest.cpp
autotests/openurljobtest.cpp
autotests/openurljobtest.h
src/core/kurlauthorized.h
src/gui/CMakeLists.txt
src/gui/applicationlauncherjob.cpp
src/gui/applicationlauncherjob.h
src/gui/openurljob.cpp
src/gui/openurljob.h
src/gui/openurljobhandlerinterface.cpp
src/gui/openurljobhandlerinterface.h
src/widgets/CMakeLists.txt
src/widgets/jobuidelegate.cpp
src/widgets/kdesktopfileactions.cpp
src/widgets/kopenwithdialog.cpp
src/widgets/kopenwithdialog.h
src/widgets/krun.cpp
src/widgets/widgetsopenurljobhandler.cpp
src/widgets/widgetsopenurljobhandler.h
To: dfaure, ahmadsamir, broulik, meven, kossebau, davidedmundson, nicolasfella, svuorela
Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200503/318a31a8/attachment.html>
More information about the Kde-frameworks-devel
mailing list