1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-02-12 07:27:15 +00:00

51 lines
1.3 KiB
C
Raw Normal View History

2025-01-20 14:46:47 +01:00
#ifndef RMJOB_H
#define RMJOB_H
#include <QThread>
#include <QDir>
/**
* @class RmJob
2025-02-01 13:45:55 +01:00
* @brief A job to handle the recursive removal of a path in a separate thread.
2025-01-20 14:46:47 +01:00
*
*/
class RmJob : public QThread
{
Q_OBJECT
/**
2025-02-01 13:45:55 +01:00
* @brief Executes the recursive remove operation.
2025-01-20 14:46:47 +01:00
*
2025-02-01 13:45:55 +01:00
* This method performs the recursive removal of the specified target path.
2025-01-20 14:46:47 +01:00
*/
void run() override;
signals:
/**
2025-02-01 13:45:55 +01:00
* @brief Emitted when the remove operation completes.
2025-01-20 14:46:47 +01:00
*
2025-02-01 13:45:55 +01:00
* This signal is emitted once the removal process is complete, indicating
* whether the operation succeeded or failed.
*
* @param err A boolean indicating whether an error occurred during the removal.
* `true` if an error occurred, `false` if the operation was successful.
2025-01-20 14:46:47 +01:00
*/
void resultReady(const bool err);
private:
2025-02-01 13:45:55 +01:00
QString m_path; /**< The path to be removed. */
2025-01-20 14:46:47 +01:00
public:
/**
2025-02-01 13:45:55 +01:00
* @brief Constructs an RmJob object with the specified path.
2025-01-20 14:46:47 +01:00
*
2025-02-01 13:45:55 +01:00
* This constructor initializes the job with the path of the directory or file to be
* removed. The job will be executed in a separate thread when started.
2025-01-20 14:46:47 +01:00
*
2025-02-01 13:45:55 +01:00
* @param path The path to the file or directory that should be removed.
2025-01-20 14:46:47 +01:00
*/
RmJob(QString path);
};
#endif // RMJOB_H