KIO::OpenWithHandlerInterface Class

The OpenWithHandlerInterface class allows OpenUrlJob to prompt the user about which application to use to open URLs that do not have an associated application (via the "Open With" dialog). More...

Header: #include <KIO/OpenWithHandlerInterface>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KIOGui)
Since: KDE Frameworks 5.71
Inherits: QObject

Public Functions

virtual void promptUserForApplication(KJob *job, const QList<QUrl> &urls, const QString &mimeType)

Signals

void canceled()
void handled()
void serviceSelected(const KService::Ptr &service)

Protected Functions

OpenWithHandlerInterface(QObject *parent = nullptr)

Detailed Description

This extension mechanism for jobs is similar to KIO::JobUiDelegateExtension and UntrustedProgramHandlerInterface.

Member Function Documentation

[explicit protected] OpenWithHandlerInterface::OpenWithHandlerInterface(QObject *parent = nullptr)

Constructor

[signal] void OpenWithHandlerInterface::canceled()

Emitted by promptUserForApplication() if the user canceled the application selection dialog.

[signal] void OpenWithHandlerInterface::handled()

Emitted by promptUserForApplication() if it fully handled it including launching the app. This is a special case for the native Windows open-with dialog.

[virtual] void OpenWithHandlerInterface::promptUserForApplication(KJob *job, const QList<QUrl> &urls, const QString &mimeType)

Show the "Open With" dialog.

job the job calling this. Useful to get all its properties

urls the URLs to open

mimeType the MIME type of the URLs, if known. Can be empty otherwise.

Implementations of this method must emit either serviceSelected or canceled.

The default implementation in this base class simply emits canceled(). Any application using KIO::JobUiDelegate (from KIOWidgets) will benefit from an automatically registered subclass which implements this method using KOpenWithDialog.

[signal] void OpenWithHandlerInterface::serviceSelected(const KService::Ptr &service)

Emitted by promptUserForApplication() once the user chooses an application.

service the application chosen by the user