mirror of
https://github.com/tnodir/fort
synced 2024-11-14 21:55:37 +00:00
UI: DbErrorManager: Check profile's dir for portable only
This commit is contained in:
parent
82b96a05e9
commit
1b0ed39a08
@ -49,3 +49,6 @@
|
||||
|
||||
;Try to start a Service on startup.
|
||||
;canStartService=false
|
||||
|
||||
;Periodically check that Profile's directory is online.
|
||||
;checkProfileOnline=false
|
||||
|
@ -121,6 +121,7 @@ void FortSettings::setupGlobal()
|
||||
m_forceDebug = settings.value("global/forceDebug").toBool();
|
||||
m_canInstallDriver = settings.value("global/canInstallDriver").toBool();
|
||||
m_canStartService = settings.value("global/canStartService").toBool();
|
||||
m_checkProfileOnline = settings.value("global/checkProfileOnline").toBool();
|
||||
m_defaultLanguage = settings.value("global/defaultLanguage").toString();
|
||||
|
||||
m_profilePath = settings.value("global/profileDir").toString();
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
bool forceDebug() const { return m_forceDebug; }
|
||||
bool canInstallDriver() const { return m_canInstallDriver; }
|
||||
bool canStartService() const { return m_canStartService; }
|
||||
bool checkProfileOnline() const { return m_checkProfileOnline; }
|
||||
|
||||
bool isLaunch() const { return m_isLaunch; }
|
||||
|
||||
@ -137,6 +138,7 @@ private:
|
||||
uint m_forceDebug : 1 = false;
|
||||
uint m_canInstallDriver : 1 = false;
|
||||
uint m_canStartService : 1 = false;
|
||||
uint m_checkProfileOnline : 1 = false;
|
||||
uint m_isLaunch : 1 = false;
|
||||
uint m_isService : 1 = false;
|
||||
uint m_hasService : 1 = false;
|
||||
|
@ -52,19 +52,23 @@ void DbErrorManager::checkConfDir()
|
||||
|
||||
void DbErrorManager::setupTimer()
|
||||
{
|
||||
auto settings = IoC<FortSettings>();
|
||||
|
||||
const bool checkProfileOnline = (settings->checkProfileOnline() || settings->isPortable());
|
||||
if (!checkProfileOnline)
|
||||
return;
|
||||
|
||||
setupDirInfo(settings->confFilePath());
|
||||
|
||||
auto timer = new QTimer(this);
|
||||
timer->setInterval(1500);
|
||||
timer->start();
|
||||
|
||||
connect(timer, &QTimer::timeout, this, &DbErrorManager::checkConfDir);
|
||||
|
||||
setupDirInfo();
|
||||
}
|
||||
|
||||
void DbErrorManager::setupDirInfo()
|
||||
void DbErrorManager::setupDirInfo(const QString &path)
|
||||
{
|
||||
auto settings = IoC<FortSettings>();
|
||||
|
||||
m_confDir.setPath(settings->confFilePath());
|
||||
m_confDir.setPath(path);
|
||||
m_confDir.open();
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ private slots:
|
||||
protected:
|
||||
virtual void setupTimer();
|
||||
|
||||
void setupDirInfo();
|
||||
void setupDirInfo(const QString &path);
|
||||
|
||||
private:
|
||||
DirInfo m_confDir;
|
||||
|
Loading…
Reference in New Issue
Block a user