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

48 lines
1.2 KiB
C
Raw Normal View History

2025-01-29 16:42:37 +01:00
#ifndef IMPORTKEYJOB_H
#define IMPORTKEYJOB_H
#include "rnpjob.h"
2025-02-01 13:45:55 +01:00
2025-01-29 16:42:37 +01:00
/**
* @class ImportKeyJob
2025-02-01 13:45:55 +01:00
* @brief A job to handle the import of a key file in a separate thread.
2025-01-29 16:42:37 +01:00
*
*/
class ImportKeyJob : public RnpJob
{
Q_OBJECT
/**
2025-02-01 13:45:55 +01:00
* @brief Executes the key import operation.
2025-01-29 16:42:37 +01:00
*
2025-02-01 13:45:55 +01:00
* This function handles the actual process of importing the GPG key file into the
2025-02-03 21:46:21 +01:00
* keyring.
2025-01-29 16:42:37 +01:00
*/
void run() override;
signals:
2025-02-01 13:45:55 +01:00
/**
* @brief Emitted when the key import operation is successful.
*
* This signal is emitted when the key file is successfully imported into the keyring.
*/
void resultSuccess();
2025-01-29 16:42:37 +01:00
private:
2025-02-01 13:45:55 +01:00
QString m_key_file_path; /**< The path of the key file to import. */
2025-01-29 16:42:37 +01:00
public:
/**
2025-02-01 13:45:55 +01:00
* @brief Constructs an ImportKeyJob object with the specified key file and keyring directory.
2025-01-29 16:42:37 +01:00
*
2025-02-01 13:45:55 +01:00
* This constructor initializes the ImportKeyJob instance with the directory containing
* the keyrings and the file path of the GPG key to import.
2025-01-29 16:42:37 +01:00
*
2025-02-01 13:45:55 +01:00
* @param rnp_homedir The directory containing the keyrings.
* @param path The path to the key file to import.
2025-01-29 16:42:37 +01:00
*/
ImportKeyJob(QDir rnp_homedir, QString path);
2025-01-29 16:42:37 +01:00
};
#endif // IMPORTKEYJOB_H