Permalink
|
|
@@ -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