2021-06-19 18:47:11 +03:00
|
|
|
#include "settings.h"
|
|
|
|
#include <QMutex>
|
|
|
|
|
|
|
|
|
2022-01-19 22:03:19 +03:00
|
|
|
Settings::Settings() : _ignoreSslErrorsSetting("/apps/harbour-seaprint/settings/ignore-ssl-errors", this),
|
2022-05-15 22:21:32 +03:00
|
|
|
_debugLogSetting("/apps/harbour-seaprint/settings/debug-log", this),
|
|
|
|
_allowExternalConnectionsSetting("/apps/harbour-seaprint/settings/allow-external-connections", this)
|
2021-06-19 18:47:11 +03:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings::~Settings() {
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings* Settings::m_Instance = nullptr;
|
|
|
|
|
|
|
|
Settings* Settings::instance()
|
|
|
|
{
|
|
|
|
static QMutex mutex;
|
|
|
|
if (!m_Instance)
|
|
|
|
{
|
|
|
|
mutex.lock();
|
|
|
|
|
|
|
|
if (!m_Instance)
|
|
|
|
m_Instance = new Settings;
|
|
|
|
|
|
|
|
mutex.unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
return m_Instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Settings::ignoreSslErrors()
|
|
|
|
{
|
|
|
|
return _ignoreSslErrorsSetting.value(_ignoreSslErrorsDefault).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Settings::ignoreSslErrorsPath()
|
|
|
|
{
|
|
|
|
return _ignoreSslErrorsSetting.key();
|
|
|
|
}
|
2022-01-19 22:03:19 +03:00
|
|
|
|
|
|
|
bool Settings::debugLog()
|
|
|
|
{
|
|
|
|
return _debugLogSetting.value(_debugLogDefault).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Settings::debugLogPath()
|
|
|
|
{
|
|
|
|
return _debugLogSetting.key();
|
|
|
|
}
|
2022-05-15 22:21:32 +03:00
|
|
|
|
|
|
|
bool Settings::allowExternalConnections()
|
|
|
|
{
|
|
|
|
return _allowExternalConnectionsSetting.value(_allowExternalConnectionsDefault).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Settings::allowExternalConnectionsPath()
|
|
|
|
{
|
|
|
|
return _allowExternalConnectionsSetting.key();
|
|
|
|
}
|