#5657 Fix serial key file path in GUI

This commit is contained in:
Andrew Nelless 2016-10-13 14:49:53 +01:00
parent 719e64dc8f
commit fd8e778b2a
3 changed files with 14 additions and 6 deletions

View File

@ -22,10 +22,18 @@
#include <QCoreApplication>
#include <QProcess>
#include <QtGlobal>
#include <QDir>
#include <stdexcept>
static const char kCoreBinary[] = "syntool";
#ifdef Q_WS_WIN
static const char kSerialKeyFilename[] = "Synergy.subkey";
#else
static const char kSerialKeyFilename[] = ".synergy.subkey";
#endif
CoreInterface::CoreInterface()
{
}
@ -54,10 +62,10 @@ QString CoreInterface::getArch()
return run(args);
}
QString CoreInterface::getSubscriptionFilename()
QString CoreInterface::getSerialKeyFilePath()
{
QStringList args("--get-subscription-filename");
return run(args);
QString filename = getProfileDir() + QDir::separator() + kSerialKeyFilename;
return filename;
}
QString CoreInterface::activateSerial(const QString& serial)

View File

@ -28,7 +28,7 @@ public:
QString getProfileDir();
QString getInstalledDir();
QString getArch();
QString getSubscriptionFilename();
QString getSerialKeyFilePath();
QString activateSerial(const QString& serial);
QString checkSubscription();
QString notifyActivation(const QString& identity);

View File

@ -85,9 +85,9 @@ bool SubscriptionManager::checkSubscription()
bool SubscriptionManager::fileExists()
{
CoreInterface coreInterface;
QString subscriptionFilename = coreInterface.getSubscriptionFilename();
QString serialKeyFilePath = coreInterface.getSerialKeyFilePath();
return QFile::exists(subscriptionFilename);
return QFile::exists(serialKeyFilePath);
}
void SubscriptionManager::checkError(QString& error)