forked from cryptonotefoundation/cryptonotewallet
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
oshelper.cpp
36 lines (30 loc) · 862 Bytes
/
oshelper.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "oshelper.h"
#include <QTemporaryFile>
#include <QDir>
#include <QDebug>
#include <QString>
OSHelper::OSHelper(QObject *parent) : QObject(parent)
{
}
QString OSHelper::temporaryFilename() const
{
QString tempFileName;
{
QTemporaryFile f;
f.open();
tempFileName = f.fileName();
}
return tempFileName;
}
bool OSHelper::removeTemporaryWallet(const QString &fileName) const
{
// Temporary files should be deleted automatically by default, in case they wouldn't, we delete them manually as well
bool cache_deleted = QFile::remove(fileName);
bool address_deleted = QFile::remove(fileName + ".address.txt");
bool keys_deleted = QFile::remove(fileName +".keys");
return cache_deleted && address_deleted && keys_deleted;
}
QString OSHelper::temporaryPath() const
{
return QDir::tempPath();
}