Fix storage location of config files
This commit is contained in:
parent
351c5c7849
commit
b4947f1f81
3 changed files with 11 additions and 4 deletions
|
|
@ -6,14 +6,21 @@
|
|||
#include <QTextStream>
|
||||
#include <QSslCertificate>
|
||||
#include <QSslKey>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
|
||||
IdentityManager::IdentityManager(QDir directory)
|
||||
IdentityManager::IdentityManager()
|
||||
{
|
||||
QFile uniqueIdFile(directory.filePath("uniqueid"));
|
||||
m_RootDirectory = QDir(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation));
|
||||
if (!m_RootDirectory.exists())
|
||||
{
|
||||
m_RootDirectory.mkpath(".");
|
||||
}
|
||||
|
||||
QFile uniqueIdFile(m_RootDirectory.filePath("uniqueid"));
|
||||
if (uniqueIdFile.open(QIODevice::ReadOnly))
|
||||
{
|
||||
m_CachedUniqueId = QTextStream(&uniqueIdFile).readAll();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
class IdentityManager
|
||||
{
|
||||
public:
|
||||
IdentityManager(QDir directory);
|
||||
IdentityManager();
|
||||
|
||||
QString
|
||||
getUniqueId();
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ void MainWindow::on_newHostBtn_clicked()
|
|||
QString hostname = popupmanager::getHostnameDialog(this);
|
||||
if (!hostname.isEmpty()) {
|
||||
|
||||
IdentityManager im = IdentityManager(QDir(QDir::current()));
|
||||
IdentityManager im = IdentityManager();
|
||||
NvPairingManager pm(hostname, im);
|
||||
|
||||
QString pin = pm.generatePinString();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue