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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user