1
0
mirror of https://github.com/QRouland/UTPass.git synced 2026-01-11 03:46:58 +00:00

Rewrite import key with rnp

This commit is contained in:
2025-01-29 16:42:37 +01:00
parent c01fae0c58
commit 2c9d82e0b1
30 changed files with 654 additions and 719 deletions

View File

@@ -3,17 +3,21 @@
#include <QUrl>
#include <QUuid>
#include <QtCore/QStandardPaths>
#include <memory>
#include <quazip5/JlCompress.h>
#include "passphraseprovider.h"
#include "utils.h"
TestsUtils::TestsUtils():
m_passphrase_povider(std::unique_ptr<TesTPassphraseProvider>(new TesTPassphraseProvider()))
{}
QString TestsUtils::getTempPath()
{
qFatal("yp");
// Get the system's temporary directory
QString tempDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
qDebug() << "TempDir : " << tempDir;
QString tempDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
// Generate a unique UUID
QString uuid = QUuid::createUuid().toString(QUuid::WithoutBraces);
@@ -22,17 +26,16 @@ QString TestsUtils::getTempPath()
QString newTempDir = tempDir + "/" + uuid;
QDir dir;
if (!dir.exists(newTempDir)) {
// Create the directory
if (dir.mkpath(newTempDir)) {
return newTempDir; // Return the path if successful
} else {
return "Failed to create directory"; // Return an error message
}
} else {
return newTempDir; // If the directory already exists, return its path
}
dir.mkpath(newTempDir);
qDebug() << "TempDir : " << newTempDir;
return newTempDir;
}
QObject* TestsUtils::getTestPassphraseProvider()
{
return this->m_passphrase_povider.get();
}