mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 02:30:52 +00:00
Fix storage location of config files
This commit is contained in:
@@ -6,14 +6,21 @@
|
|||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QSslCertificate>
|
#include <QSslCertificate>
|
||||||
#include <QSslKey>
|
#include <QSslKey>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/rsa.h>
|
#include <openssl/rsa.h>
|
||||||
#include <openssl/pkcs12.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))
|
if (uniqueIdFile.open(QIODevice::ReadOnly))
|
||||||
{
|
{
|
||||||
m_CachedUniqueId = QTextStream(&uniqueIdFile).readAll();
|
m_CachedUniqueId = QTextStream(&uniqueIdFile).readAll();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
class IdentityManager
|
class IdentityManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IdentityManager(QDir directory);
|
IdentityManager();
|
||||||
|
|
||||||
QString
|
QString
|
||||||
getUniqueId();
|
getUniqueId();
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void MainWindow::on_newHostBtn_clicked()
|
|||||||
QString hostname = popupmanager::getHostnameDialog(this);
|
QString hostname = popupmanager::getHostnameDialog(this);
|
||||||
if (!hostname.isEmpty()) {
|
if (!hostname.isEmpty()) {
|
||||||
|
|
||||||
IdentityManager im = IdentityManager(QDir(QDir::current()));
|
IdentityManager im = IdentityManager();
|
||||||
NvPairingManager pm(hostname, im);
|
NvPairingManager pm(hostname, im);
|
||||||
|
|
||||||
QString pin = pm.generatePinString();
|
QString pin = pm.generatePinString();
|
||||||
|
|||||||
Reference in New Issue
Block a user