1
0
mirror of https://github.com/QRouland/UTPass.git synced 2026-01-10 03:26:57 +00:00

Update build : use prebuild binaries + Add libgit2

This commit is contained in:
2025-01-07 14:41:48 +01:00
parent c6d7a025ff
commit 37c481ece1
50 changed files with 294 additions and 408 deletions

View File

@@ -3,8 +3,8 @@
#include <QtCore/QDir>
#include "pass.h"
#include "git.h"
#include "gpg.h"
#include "passphraseprovider.h"
#include "passkeymodel.h"
@@ -18,44 +18,46 @@ void Pass::init(QObject *window)
if (!window) {
qFatal("window is invalid. Abording.");
}
Gpg::instance()->setWindow(window);
QDir dir(m_password_store);
if (!dir.exists())
dir.mkpath(".");
qDebug() << "Password Store is :" << m_password_store;
qInfo() << "Password Store is :" << m_password_store;
}
void Pass::decrypt(QUrl url)
{
qDebug() << "Start decrypting";
qInfo() << "Decrypting";
auto decrypt_ret = Gpg::instance()->decryptFromFile(url.toLocalFile());
if (decrypt_ret.first) {
qDebug() << "Decrypt Failed";
qInfo() << "Decrypt Failed";
emit decryptFailed();
} else if (decrypt_ret.second.isNull()) {
qDebug() << "Decrypt Canceled";
qInfo() << "Decrypt Canceled";
emit decryptCanceled();
} else {
qDebug() << "Decrypt OK";
qInfo() << "Decrypt OK";
emit decrypted(decrypt_ret.second);
}
}
bool Pass::gpgDeleteKeyId(QString id)
{
qDebug() << "Start deleting Key id " << id;
qInfo() << "Deleting Key id " << id;
return !Gpg::instance()->deleteKeyId(id);
}
bool Pass::gpgImportKeyFromFile(QUrl url)
{
qDebug() << "Start importing Key from " << url;
qInfo() << "Importing Key from " << url;
return !Gpg::instance()->importKeysFromFile(url.toLocalFile());
}
QVariant Pass::gpgGetAllKeysModel()
{
qInfo() << "Getting all key form gpg ";
return QVariant::fromValue(PassKeyModel::keysToPassKeyQObjectList(
Gpg::instance()->getAllKeys().second));
}
@@ -64,3 +66,9 @@ QString Pass::getPasswordStore()
{
return m_password_store;
}
bool Pass::gitClone(QString url)
{
qInfo() << "Cloning . password_store from " << url;
return Git::instance()->clone(url);
}