This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

#5657 Fix serial key file path in GUI

  • Loading branch information...
nlyan committed Oct 13, 2016
1 parent 719e64d commit fd8e778b2a86d692248b9fa03f99d9f846836ff7
Showing with 14 additions and 6 deletions.
  1. +11 −3 src/gui/src/CoreInterface.cpp
  2. +1 −1 src/gui/src/CoreInterface.h
  3. +2 −2 src/gui/src/SubscriptionManager.cpp
@@ -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)
@@ -28,7 +28,7 @@ class CoreInterface
QString getProfileDir();
QString getInstalledDir();
QString getArch();
- QString getSubscriptionFilename();
+ QString getSerialKeyFilePath();
QString activateSerial(const QString& serial);
QString checkSubscription();
QString notifyActivation(const QString& identity);
@@ -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)

0 comments on commit fd8e778

Please sign in to comment.