KIO::ClipboardUpdater Class

Header: #include <ClipboardUpdater>
CMake: find_package(Qt6 REQUIRED COMPONENTS KIOWidgets)
target_link_libraries(mytarget PRIVATE Qt6::KIOWidgets)

Public Functions

void setMode(KIO::JobUiDelegateExtension::ClipboardUpdaterMode m)

Static Public Members

void update(const QUrl &srcUrl, const QUrl &destUrl)

Detailed Description

Updates the clipboard when it is affected by KIO operations.

UpdateContent updates clipboard urls that were modified. This mode should be the one preferred by default because it will not change the contents of the clipboard if the urls modified by the job are not found in the clipboard.

OverwriteContent blindly replaces all urls in the clipboard with the ones from the job. This mode should not be used unless you are 100% certain that the urls in the clipboard are actually there for the purposes of carrying out the specified job. This mode for example is used by the KIO::pasteClipboard job when a user performs a cut+paste operation.

This class also sets @ref job as its parent object. As such, when @ref job is deleted the instance of ClipboardUpdater you create will also be deleted as well.

Member Function Documentation

void ClipboardUpdater::setMode(KIO::JobUiDelegateExtension::ClipboardUpdaterMode m)

Sets the mode.

[static] void ClipboardUpdater::update(const QUrl &srcUrl, const QUrl &destUrl)

Convenience function that allows renaming of a single url in the clipboard.