mirror of
https://github.com/QRouland/UTPass.git
synced 2025-07-04 03:02:28 +00:00
Refactor cloning feature and ui
This commit is contained in:
@ -170,6 +170,7 @@ void Gpg::decryptResultSlot(const GpgME::DecryptionResult &result, const QByteAr
|
||||
qDebug() << "Code Error : " << result.error().code();
|
||||
qDebug() << "Error str : " << result.error().asString();
|
||||
}
|
||||
qDebug() << "Cancelled : " << result.error().isCanceled();
|
||||
emit decryptResult(result.error(), QString::fromUtf8(plainText));
|
||||
}
|
||||
|
||||
|
@ -28,8 +28,7 @@ using namespace QGpgME;
|
||||
*
|
||||
* This class integrates with the GPGME (GnuPG Made Easy) library to provide functionalities
|
||||
* for interacting with GPG keys, including decrypting messages, importing keys from files,
|
||||
* listing keys, and deleting keys. The class also provides slots for handling results
|
||||
* of asynchronous GPG operations and communicates with the user via signals.
|
||||
* listing keys, and deleting keys.
|
||||
*/
|
||||
class Gpg: public QObject
|
||||
{
|
||||
|
@ -55,6 +55,10 @@ void Pass::showResult(Error err, QString plain_text)
|
||||
if (err) {
|
||||
qInfo() << "Decrypt Failed";
|
||||
emit showFailed(err.asString());
|
||||
|
||||
} else if (err.isCanceled()){
|
||||
qInfo() << "Decrypt Cancelled";
|
||||
emit showCancelled();
|
||||
} else {
|
||||
qInfo() << "Decrypt OK";
|
||||
emit showSucceed(this->m_show_filename, plain_text);
|
||||
|
@ -16,9 +16,6 @@ using namespace GpgME;
|
||||
*
|
||||
* This class provides functionalities for interacting with password storage, including
|
||||
* storing, showing, importing, and deleting passwords securely using GPG encryption.
|
||||
* It communicates asynchronously with GPG operations, using signals and slots to propagate results.
|
||||
* The class interacts with the `Gpg` class to perform GPG key operations and provides an interface
|
||||
* for the user to manage the passwords.
|
||||
*/
|
||||
class Pass : public QObject
|
||||
{
|
||||
@ -82,6 +79,8 @@ signals:
|
||||
*/
|
||||
void getAllGPGKeysSucceed(QVariant keys_info);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Emitted when retrieving GPG keys fails.
|
||||
* @param message The error message describing the failure.
|
||||
@ -109,6 +108,11 @@ signals:
|
||||
*/
|
||||
void showFailed(QString message);
|
||||
|
||||
/**
|
||||
* @brief Emitted hen showing a password cancelled.
|
||||
*/
|
||||
void showCancelled();
|
||||
|
||||
private:
|
||||
QString m_password_store; /**< The path to the password store. */
|
||||
std::unique_ptr<Gpg> m_gpg; /**< The GPG instance used for encryption/decryption. */
|
||||
@ -121,11 +125,6 @@ public:
|
||||
*/
|
||||
Pass();
|
||||
|
||||
/**
|
||||
* @brief Destructor for cleaning up resources used by the Pass object.
|
||||
*/
|
||||
~Pass() override = default;
|
||||
|
||||
/**
|
||||
* @brief Gets the path to the password store.
|
||||
* @return The path to the password store.
|
||||
|
@ -11,8 +11,7 @@ using namespace GpgME;
|
||||
* @brief A model representing a user ID associated with a GPG key.
|
||||
*
|
||||
* This class encapsulates the user ID information (UID) for a GPG key, providing access
|
||||
* to the UID's identifier, name, and email. It is used as a model for user IDs in the
|
||||
* `PassKeyModel` class.
|
||||
* to the UID's identifier, name, and email.
|
||||
*/
|
||||
class UserIdModel : public QObject
|
||||
{
|
||||
|
@ -15,9 +15,7 @@
|
||||
* @brief A passphrase provider for GPG operations that interacts with a QML dialog.
|
||||
*
|
||||
* This class implements the `PassphraseProvider` interface from GPGME and is responsible for
|
||||
* obtaining passphrases for GPG operations. It does so by triggering a QML dialog to prompt the user
|
||||
* for their passphrase. The response is then handled asynchronously, and the passphrase is returned to
|
||||
* the calling GPGME function.
|
||||
* obtaining passphrases for GPG operations.
|
||||
*/
|
||||
class UTPassphraseProvider : public QObject, public PassphraseProvider
|
||||
{
|
||||
|
Reference in New Issue
Block a user