KIO::DeleteOrTrashJob Class

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

Public Functions

DeleteOrTrashJob(const QList<QUrl> &urls, KIO::AskUserActionInterface::DeletionType deletionType, KIO::AskUserActionInterface::ConfirmationType confirm, QObject *parent)
virtual ~DeleteOrTrashJob() override

Reimplemented Public Functions

virtual void start() override

Detailed Description

@class DeleteOrTrashJob deleteortrashjob.h <KIO/DeleteOrTrashJob>

This job asks the user for confirmation to delete or move to Trash a list of URLs; or if the job is constructed with AskUserActionInterface::EmptyTrash, to empty the Trash.

A KIO::WidgetAskUserActionHandler will be used by default, unless a KJobUiDelegate that implements KIO::AskUserActionInterface is set with setUiDelegate().

In the case of moving items to Trash, this job records the operation using KIO::FileUndoManager.

To start the job after constructing it, you must call start().

@since 5.100

Member Function Documentation

[explicit] DeleteOrTrashJob::DeleteOrTrashJob(const QList<QUrl> &urls, KIO::AskUserActionInterface::DeletionType deletionType, KIO::AskUserActionInterface::ConfirmationType confirm, QObject *parent)

Creates a DeleteOrTrashJob. @param urls the list of urls to delete, move to Trash, or an empty list in the case of AskUserActionInterface::EmptyTrash (in the latter case, the list of urls is ignored) @param deletionType one of AskUserActionInterface::DeletionType @param confirm one of AskUserActionInterface::ConfirmationType @param parent parent object, e.g. a QWidget for widget-based applications

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

Destructor

Note that jobs auto-delete themselves after emitting result

[override virtual] void DeleteOrTrashJob::start()

Reimplements: KJob::start().

You must call this to actually start the job.