KIO::DeleteOrTrashJob Class

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. More...

Header: #include <KIO/DeleteOrTrashJob>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KF6::KIOWidgets)
Since: 5.100
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

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().

Member Function Documentation

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

Creates a DeleteOrTrashJob.

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)

deletionType one of AskUserActionInterface::DeletionType

confirm one of AskUserActionInterface::ConfirmationType

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.