KIO::OpenFileManagerWindowJob Class

Header: #include <OpenFileManagerWindowJob>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KIOGui)
Inherits: KJob

Public Types

enum Errors { NoValidUrlsError, LaunchFailedError }

Public Functions

OpenFileManagerWindowJob(QObject *parent = nullptr)
virtual ~OpenFileManagerWindowJob() override
QList<QUrl> highlightUrls() const
void setHighlightUrls(const QList<QUrl> &highlightUrls)
void setStartupId(const QByteArray &startupId)
QByteArray startupId() const

Reimplemented Public Functions

virtual void start() override

Detailed Description

@class KIO::OpenFileManagerWindowJob openfilemanagerwindowjob.h <KIO/OpenFileManagerWindowJob>

@brief Open a File Manager Window

Using this job you can open a file manager window and highlight specific files within a folder. This can be useful if you downloaded a file and want to present it to the user without the user having to manually search the file in its parent folder. This can also be used for a "Show in Parent Folder" functionality.

On Linux, this job will use the org.freedesktop.FileManager1 interface to highlight the files and/or folders. If this fails, the parent directory of the first URL will be opened in the default file manager instead.

Note that this job is really only about highlighting certain items which means if you, for example, pass it just a URL to a folder it will not open this particular folder but instead highlight it within its parent folder.

If you just want to open a folder, use OpenUrlJob instead.

@since 5.24

Member Type Documentation

enum OpenFileManagerWindowJob::Errors

Errors the job may emit

Member Function Documentation

[explicit] OpenFileManagerWindowJob::OpenFileManagerWindowJob(QObject *parent = nullptr)

Creates an OpenFileManagerWindowJob

[override virtual noexcept] OpenFileManagerWindowJob::~OpenFileManagerWindowJob()

Destroys the OpenFileManagerWindowJob

QList<QUrl> OpenFileManagerWindowJob::highlightUrls() const

The files and/or folders to highlight

See also setHighlightUrls().

void OpenFileManagerWindowJob::setHighlightUrls(const QList<QUrl> &highlightUrls)

Set the files and/or folders to highlight

See also highlightUrls().

void OpenFileManagerWindowJob::setStartupId(const QByteArray &startupId)

Sets the platform-specific startup id of the file manager launch. @param startupId startup id, if any (otherwise ""). For X11, this would be the id for the Startup Notification protocol. For Wayland, this would be the token for the XDG Activation protocol.

See also startupId().

[override virtual] void OpenFileManagerWindowJob::start()

Reimplements: KJob::start().

Starts the job

QByteArray OpenFileManagerWindowJob::startupId() const

The Startup ID

See also setStartupId().