From cab8a992334c390b7d421a4b20ad514ee01b3b81 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Wed, 18 Nov 2015 16:03:32 -0800 Subject: [PATCH] Persist Profile folder #4715 --- src/gui/src/SubscriptionManager.cpp | 15 ++++++++++++++- src/gui/src/SubscriptionManager.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gui/src/SubscriptionManager.cpp b/src/gui/src/SubscriptionManager.cpp index 9794c3e1..6606cdf4 100644 --- a/src/gui/src/SubscriptionManager.cpp +++ b/src/gui/src/SubscriptionManager.cpp @@ -23,6 +23,7 @@ #include "AppConfig.h" #include +#include #include #include #include @@ -34,12 +35,12 @@ SubscriptionManager::SubscriptionManager(QWidget* parent, AppConfig& appConfig, m_AppConfig(appConfig), m_Edition(edition) { - } bool SubscriptionManager::activateSerial(const QString& serial) { m_Edition = Unknown; + persistDirectory(); CoreInterface coreInterface; QString output; @@ -62,6 +63,7 @@ bool SubscriptionManager::activateSerial(const QString& serial) bool SubscriptionManager::checkSubscription() { m_Edition = Unknown; + persistDirectory(); CoreInterface coreInterface; QString output; try @@ -152,3 +154,14 @@ bool SubscriptionManager::shouldWarnExpiring() return result; } + +void SubscriptionManager::persistDirectory() +{ + CoreInterface coreInterface; + QString profileDir = coreInterface.getProfileDir(); + + QDir dir(profileDir); + if (!dir.exists()) { + dir.mkpath("."); + } +} diff --git a/src/gui/src/SubscriptionManager.h b/src/gui/src/SubscriptionManager.h index 54e7da34..646ff81a 100644 --- a/src/gui/src/SubscriptionManager.h +++ b/src/gui/src/SubscriptionManager.h @@ -37,6 +37,7 @@ private: void getEditionType(QString& output); void checkExpiring(QString& output); bool shouldWarnExpiring(); + void persistDirectory(); private: QString m_ErrorMessage;