Filer
Public Member Functions | Static Public Member Functions | List of all members
TrashHandler Class Reference

The TrashHandler class provides functionality to manage a "Trash" (virtual trash) for files and directories. More...

#include <TrashHandler.h>

Inheritance diagram for TrashHandler:
Inheritance graph
[legend]
Collaboration diagram for TrashHandler:
Collaboration graph
[legend]

Public Member Functions

 TrashHandler (QWidget *parent=nullptr)
 Constructs a TrashHandler object. More...
 
void moveToTrash (const QStringList &paths)
 Moves files and directories to the "Trash" (virtual trash). More...
 

Static Public Member Functions

static bool emptyTrash ()
 Empties the "Trash" by deleting all files and directories in the virtual trash. More...
 
static QString getTrashPath ()
 Retrieves the path to the "Trash" directory. More...
 
static bool isEmpty ()
 Checks if the "Trash" is empty. More...
 

Detailed Description

The TrashHandler class provides functionality to manage a "Trash" (virtual trash) for files and directories.

Constructor & Destructor Documentation

◆ TrashHandler()

TrashHandler::TrashHandler ( QWidget *  parent = nullptr)

Constructs a TrashHandler object.

Parameters
parentThe parent QWidget (optional).

Member Function Documentation

◆ emptyTrash()

bool TrashHandler::emptyTrash ( )
static

Empties the "Trash" by deleting all files and directories in the virtual trash.

Returns
True if the trash was emptied successfully, false otherwise.

◆ getTrashPath()

QString TrashHandler::getTrashPath ( )
static

Retrieves the path to the "Trash" directory.

Returns
The path to the trash directory.

◆ isEmpty()

bool TrashHandler::isEmpty ( )
static

Checks if the "Trash" is empty.

Returns
True if the trash is empty, false otherwise.

◆ moveToTrash()

void TrashHandler::moveToTrash ( const QStringList &  paths)

Moves files and directories to the "Trash" (virtual trash).

Parameters
pathsList of paths to files and directories to be moved to the trash.

The documentation for this class was generated from the following files: