mirror of
https://github.com/QRouland/UTPass.git
synced 2025-07-04 03:02:28 +00:00
Harmonize naming
This commit is contained in:
@ -137,6 +137,7 @@ QPair<Error, QString> Gpg::decrypt(QByteArray cipherText)
|
||||
auto decResult = job->exec(cipherText, plain_text);
|
||||
|
||||
delete job;
|
||||
delete provider;
|
||||
|
||||
if (decResult.error()) {
|
||||
qWarning() << "something gone wrong on decrypt";
|
||||
@ -245,9 +246,6 @@ Error Gpg::importKeysFromFile(QString path)
|
||||
auto job = openpgp()->importJob();
|
||||
auto ctx = ImportJob::context(job);
|
||||
|
||||
auto provider = new UTPassphraseProvider;
|
||||
ctx->setPassphraseProvider(provider);
|
||||
ctx->setPinentryMode(Context::PinentryLoopback);
|
||||
auto result = job->exec(file.readAll());
|
||||
|
||||
qDebug() << "numImported" << result.numImported();
|
||||
@ -258,7 +256,6 @@ Error Gpg::importKeysFromFile(QString path)
|
||||
|
||||
file.close();
|
||||
delete job;
|
||||
delete provider;
|
||||
|
||||
if (result.error()) {
|
||||
qWarning() << "Import go wrong";
|
||||
|
@ -12,7 +12,7 @@ Pass::Pass(): m_password_store (QStandardPaths::writableLocation(
|
||||
QStandardPaths::AppDataLocation).append("/.password-store"))
|
||||
{}
|
||||
|
||||
void Pass::init(QObject *window)
|
||||
void Pass::initialize(QObject *window)
|
||||
{
|
||||
if (!window) {
|
||||
qFatal("window is invalid. Abording.");
|
||||
@ -27,7 +27,7 @@ void Pass::init(QObject *window)
|
||||
qInfo() << "Password Store is :" << m_password_store;
|
||||
}
|
||||
|
||||
void Pass::decrypt(QUrl url)
|
||||
void Pass::show(QUrl url)
|
||||
{
|
||||
qInfo() << "Decrypting";
|
||||
auto decrypt_ret = Gpg::instance()->decryptFromFile(url.toLocalFile());
|
||||
@ -43,19 +43,19 @@ void Pass::decrypt(QUrl url)
|
||||
}
|
||||
}
|
||||
|
||||
bool Pass::gpgDeleteKeyId(QString id)
|
||||
bool Pass::deleteGPGKey(QString id)
|
||||
{
|
||||
qInfo() << "Deleting Key id " << id;
|
||||
return !Gpg::instance()->deleteKeyId(id);
|
||||
}
|
||||
|
||||
bool Pass::gpgImportKeyFromFile(QUrl url)
|
||||
bool Pass::importGPGKey(QUrl url)
|
||||
{
|
||||
qInfo() << "Importing Key from " << url;
|
||||
return !Gpg::instance()->importKeysFromFile(url.toLocalFile());
|
||||
}
|
||||
|
||||
QVariant Pass::gpgGetAllKeysModel()
|
||||
QVariant Pass::getAllGPGKeys()
|
||||
{
|
||||
qInfo() << "Getting all key form gpg ";
|
||||
return QVariant::fromValue(PassKeyModel::keysToPassKeyQObjectList(
|
||||
|
@ -28,11 +28,11 @@ public:
|
||||
return m_password_store;
|
||||
}
|
||||
|
||||
Q_INVOKABLE void init(QObject *window);
|
||||
Q_INVOKABLE void decrypt(QUrl url);
|
||||
Q_INVOKABLE bool gpgDeleteKeyId(QString id);
|
||||
Q_INVOKABLE bool gpgImportKeyFromFile(QUrl url);
|
||||
Q_INVOKABLE QVariant gpgGetAllKeysModel();
|
||||
Q_INVOKABLE void initialize(QObject *window);
|
||||
Q_INVOKABLE void show(QUrl url);
|
||||
Q_INVOKABLE bool deleteGPGKey(QString id);
|
||||
Q_INVOKABLE bool importGPGKey(QUrl url);
|
||||
Q_INVOKABLE QVariant getAllGPGKeys();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user