Formats minimally release source files based on former clang-format
This commit is contained in:
387 files changed
+37323
-38074
No files matched your search
Executable → Regular
+154
-154
@@ -12,164 +12,164 @@
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
namespace Connections
|
||||
{
|
||||
enum class eHostConfig
|
||||
{
|
||||
public_local,
|
||||
localhost,
|
||||
server,
|
||||
server_avs
|
||||
};
|
||||
struct configStruct
|
||||
{
|
||||
eHostConfig host;
|
||||
unsigned short port;
|
||||
QString name;
|
||||
};
|
||||
|
||||
static QMap<eConnection, configStruct> *s_config = nullptr;
|
||||
static QSettings *s_settings = nullptr;
|
||||
static unsigned short s_portOffset = 9000;
|
||||
static QString *s_serverHostname = nullptr;
|
||||
|
||||
static void cleanupSettings()
|
||||
{
|
||||
delete s_settings;
|
||||
s_settings = nullptr;
|
||||
delete s_serverHostname;
|
||||
s_serverHostname = nullptr;
|
||||
delete s_config;
|
||||
s_config = nullptr;
|
||||
}
|
||||
|
||||
static void insertConfig(eConnection conn, eHostConfig host, unsigned short port, const char *name)
|
||||
{
|
||||
if (!s_config)
|
||||
s_config = new QMap<eConnection, configStruct>();
|
||||
configStruct s;
|
||||
s.host = host;
|
||||
s.port = port;
|
||||
s.name = QString::fromLatin1(name);
|
||||
s_config->insert(conn, s);
|
||||
}
|
||||
|
||||
static void initConfig()
|
||||
{
|
||||
if (s_config && !s_config->isEmpty())
|
||||
return;
|
||||
|
||||
insertConfig(eConnection::AVS_WORKSTATION, eHostConfig::localhost, 6370, "AVS_WORKSTATION");
|
||||
insertConfig(eConnection::AVS_WORKSTATION_VD, eHostConfig::localhost, 6380, "AVS_WORKSTATION_VD");
|
||||
insertConfig(eConnection::AVS_ROOT, eHostConfig::server_avs, 6350, "AVS_ROOT");
|
||||
insertConfig(eConnection::AVS_FM, eHostConfig::server_avs, 6360, "AVS_FM");
|
||||
insertConfig(eConnection::AVS_MOTION_RECORDER, eHostConfig::server_avs, 6390, "AVS_MOTION_RECORDER");
|
||||
insertConfig(eConnection::AVS_AVA, eHostConfig::server_avs, 6391, "AVS_AVA");
|
||||
|
||||
insertConfig(eConnection::PWS_WEBSOCKET, eHostConfig::server, 5701, "PWS_WEBSOCKET");
|
||||
insertConfig(eConnection::SCM_WEBSOCKET, eHostConfig::server, 7300, "SCM_WEBSOCKET");
|
||||
insertConfig(eConnection::ISM_WEBSOCKET, eHostConfig::server, 2080, "ISM_WEBSOCKET");
|
||||
insertConfig(eConnection::FLM_THP_SERVER, eHostConfig::server, 2090, "FLM_THP_SERVER");
|
||||
insertConfig(eConnection::FLM_PDF_SERVER, eHostConfig::server, 3000, "FLM_PDF_SERVER");
|
||||
|
||||
insertConfig(eConnection::LVS, eHostConfig::server, 94, "LVS");
|
||||
insertConfig(eConnection::ZWLVSV, eHostConfig::server, 95, "ZWLVSV");
|
||||
insertConfig(eConnection::ZWLVWCS, eHostConfig::server, 97, "ZWLVWCS");
|
||||
insertConfig(eConnection::ZWLVWMS, eHostConfig::server, 98, "ZWLVWMS");
|
||||
insertConfig(eConnection::ZSLV, eHostConfig::server, 99, "ZSLV");
|
||||
}
|
||||
|
||||
void setIniFile(const QString &iniFileName)
|
||||
{
|
||||
if (!s_settings)
|
||||
qAddPostRoutine(cleanupSettings);
|
||||
delete s_settings;
|
||||
s_settings = new QSettings(iniFileName, QSettings::IniFormat);
|
||||
}
|
||||
|
||||
QString iniFile()
|
||||
{
|
||||
return s_settings ? s_settings->fileName() : QString();
|
||||
}
|
||||
|
||||
unsigned short portOffset()
|
||||
{
|
||||
return s_portOffset;
|
||||
}
|
||||
|
||||
void setPortOffset(unsigned short portOffset)
|
||||
{
|
||||
s_portOffset = portOffset;
|
||||
}
|
||||
|
||||
unsigned short port(eConnection connection)
|
||||
{
|
||||
initConfig();
|
||||
unsigned short port = s_config->value(connection).port;
|
||||
|
||||
if (s_settings)
|
||||
namespace Connections
|
||||
{
|
||||
bool bOk;
|
||||
QString key = s_config->value(connection).name + QLatin1String("/port");
|
||||
unsigned short port2 = s_settings->value(key, port).toString().toUShort(&bOk);
|
||||
if (bOk)
|
||||
port = port2;
|
||||
}
|
||||
if (port < 100)
|
||||
return portOffset() + port;
|
||||
return port;
|
||||
}
|
||||
enum class eHostConfig
|
||||
{
|
||||
public_local,
|
||||
localhost,
|
||||
server,
|
||||
server_avs
|
||||
};
|
||||
struct configStruct
|
||||
{
|
||||
eHostConfig host;
|
||||
unsigned short port;
|
||||
QString name;
|
||||
};
|
||||
|
||||
QString hostName(eConnection connection)
|
||||
{
|
||||
initConfig();
|
||||
static QMap<eConnection, configStruct> *s_config = nullptr;
|
||||
static QSettings *s_settings = nullptr;
|
||||
static unsigned short s_portOffset = 9000;
|
||||
static QString *s_serverHostname = nullptr;
|
||||
|
||||
QString host;
|
||||
switch (s_config->value(connection).host)
|
||||
{
|
||||
case eHostConfig::public_local:
|
||||
host = QString::fromLocal8Bit(qgetenv("HOST"));
|
||||
break;
|
||||
case eHostConfig::localhost:
|
||||
host = QLatin1String("127.0.0.1");
|
||||
break;
|
||||
case eHostConfig::server:
|
||||
if (s_serverHostname)
|
||||
host = *s_serverHostname;
|
||||
if (host.isEmpty())
|
||||
host = QLatin1String("EXCTDS01");
|
||||
break;
|
||||
case eHostConfig::server_avs:
|
||||
host = QStringLiteral("EXCAVS01");
|
||||
break;
|
||||
}
|
||||
if (s_settings)
|
||||
{
|
||||
QString key = s_config->value(connection).name + QLatin1String("/host");
|
||||
QString host2 = s_settings->value(key, host).toString();
|
||||
if (!host2.isEmpty())
|
||||
host = host2;
|
||||
}
|
||||
return host;
|
||||
}
|
||||
static void cleanupSettings()
|
||||
{
|
||||
delete s_settings;
|
||||
s_settings = nullptr;
|
||||
delete s_serverHostname;
|
||||
s_serverHostname = nullptr;
|
||||
delete s_config;
|
||||
s_config = nullptr;
|
||||
}
|
||||
|
||||
void setServerHostname(const QString &serverHostName)
|
||||
{
|
||||
if (!s_serverHostname)
|
||||
s_serverHostname = new QString(serverHostName);
|
||||
else
|
||||
*s_serverHostname = serverHostName;
|
||||
}
|
||||
static void insertConfig(eConnection conn, eHostConfig host, unsigned short port, const char *name)
|
||||
{
|
||||
if (!s_config)
|
||||
s_config = new QMap<eConnection, configStruct>();
|
||||
configStruct s;
|
||||
s.host = host;
|
||||
s.port = port;
|
||||
s.name = QString::fromLatin1(name);
|
||||
s_config->insert(conn, s);
|
||||
}
|
||||
|
||||
QString connectionName(eConnection connection)
|
||||
{
|
||||
if (s_config)
|
||||
{
|
||||
auto it = s_config->constFind(connection);
|
||||
if (it != s_config->constEnd())
|
||||
return it.value().name;
|
||||
static void initConfig()
|
||||
{
|
||||
if (s_config && !s_config->isEmpty())
|
||||
return;
|
||||
|
||||
insertConfig(eConnection::AVS_WORKSTATION, eHostConfig::localhost, 6370, "AVS_WORKSTATION");
|
||||
insertConfig(eConnection::AVS_WORKSTATION_VD, eHostConfig::localhost, 6380, "AVS_WORKSTATION_VD");
|
||||
insertConfig(eConnection::AVS_ROOT, eHostConfig::server_avs, 6350, "AVS_ROOT");
|
||||
insertConfig(eConnection::AVS_FM, eHostConfig::server_avs, 6360, "AVS_FM");
|
||||
insertConfig(eConnection::AVS_MOTION_RECORDER, eHostConfig::server_avs, 6390, "AVS_MOTION_RECORDER");
|
||||
insertConfig(eConnection::AVS_AVA, eHostConfig::server_avs, 6391, "AVS_AVA");
|
||||
|
||||
insertConfig(eConnection::PWS_WEBSOCKET, eHostConfig::server, 5701, "PWS_WEBSOCKET");
|
||||
insertConfig(eConnection::SCM_WEBSOCKET, eHostConfig::server, 7300, "SCM_WEBSOCKET");
|
||||
insertConfig(eConnection::ISM_WEBSOCKET, eHostConfig::server, 2080, "ISM_WEBSOCKET");
|
||||
insertConfig(eConnection::FLM_THP_SERVER, eHostConfig::server, 2090, "FLM_THP_SERVER");
|
||||
insertConfig(eConnection::FLM_PDF_SERVER, eHostConfig::server, 3000, "FLM_PDF_SERVER");
|
||||
|
||||
insertConfig(eConnection::LVS, eHostConfig::server, 94, "LVS");
|
||||
insertConfig(eConnection::ZWLVSV, eHostConfig::server, 95, "ZWLVSV");
|
||||
insertConfig(eConnection::ZWLVWCS, eHostConfig::server, 97, "ZWLVWCS");
|
||||
insertConfig(eConnection::ZWLVWMS, eHostConfig::server, 98, "ZWLVWMS");
|
||||
insertConfig(eConnection::ZSLV, eHostConfig::server, 99, "ZSLV");
|
||||
}
|
||||
|
||||
void setIniFile(const QString &iniFileName)
|
||||
{
|
||||
if (!s_settings)
|
||||
qAddPostRoutine(cleanupSettings);
|
||||
delete s_settings;
|
||||
s_settings = new QSettings(iniFileName, QSettings::IniFormat);
|
||||
}
|
||||
|
||||
QString iniFile()
|
||||
{
|
||||
return s_settings ? s_settings->fileName() : QString();
|
||||
}
|
||||
|
||||
unsigned short portOffset()
|
||||
{
|
||||
return s_portOffset;
|
||||
}
|
||||
|
||||
void setPortOffset(unsigned short portOffset)
|
||||
{
|
||||
s_portOffset = portOffset;
|
||||
}
|
||||
|
||||
unsigned short port(eConnection connection)
|
||||
{
|
||||
initConfig();
|
||||
unsigned short port = s_config->value(connection).port;
|
||||
|
||||
if (s_settings)
|
||||
{
|
||||
bool bOk;
|
||||
QString key = s_config->value(connection).name + QLatin1String("/port");
|
||||
unsigned short port2 = s_settings->value(key, port).toString().toUShort(&bOk);
|
||||
if (bOk)
|
||||
port = port2;
|
||||
}
|
||||
if (port < 100)
|
||||
return portOffset() + port;
|
||||
return port;
|
||||
}
|
||||
|
||||
QString hostName(eConnection connection)
|
||||
{
|
||||
initConfig();
|
||||
|
||||
QString host;
|
||||
switch (s_config->value(connection).host)
|
||||
{
|
||||
case eHostConfig::public_local:
|
||||
host = QString::fromLocal8Bit(qgetenv("HOST"));
|
||||
break;
|
||||
case eHostConfig::localhost:
|
||||
host = QLatin1String("127.0.0.1");
|
||||
break;
|
||||
case eHostConfig::server:
|
||||
if (s_serverHostname)
|
||||
host = *s_serverHostname;
|
||||
if (host.isEmpty())
|
||||
host = QLatin1String("EXCTDS01");
|
||||
break;
|
||||
case eHostConfig::server_avs:
|
||||
host = QStringLiteral("EXCAVS01");
|
||||
break;
|
||||
}
|
||||
if (s_settings)
|
||||
{
|
||||
QString key = s_config->value(connection).name + QLatin1String("/host");
|
||||
QString host2 = s_settings->value(key, host).toString();
|
||||
if (!host2.isEmpty())
|
||||
host = host2;
|
||||
}
|
||||
return host;
|
||||
}
|
||||
|
||||
void setServerHostname(const QString &serverHostName)
|
||||
{
|
||||
if (!s_serverHostname)
|
||||
s_serverHostname = new QString(serverHostName);
|
||||
else
|
||||
*s_serverHostname = serverHostName;
|
||||
}
|
||||
|
||||
QString connectionName(eConnection connection)
|
||||
{
|
||||
if (s_config)
|
||||
{
|
||||
auto it = s_config->constFind(connection);
|
||||
if (it != s_config->constEnd())
|
||||
return it.value().name;
|
||||
}
|
||||
return QString::number((int)connection);
|
||||
}
|
||||
}
|
||||
return QString::number((int)connection);
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable → Regular
+32
-34
@@ -9,51 +9,49 @@ namespace NGL
|
||||
{
|
||||
|
||||
|
||||
namespace Connections
|
||||
{
|
||||
namespace Connections
|
||||
{
|
||||
|
||||
|
||||
enum class eConnection
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
AVS_WORKSTATION,
|
||||
AVS_WORKSTATION_VD,
|
||||
AVS_ROOT,
|
||||
AVS_FM,
|
||||
AVS_MOTION_RECORDER,
|
||||
AVS_AVA,
|
||||
ZWLVSV,
|
||||
ZSLV,
|
||||
ZWLVWCS,
|
||||
ZWLVWMS,
|
||||
PWS_WEBSOCKET,
|
||||
SCM_WEBSOCKET,
|
||||
ISM_WEBSOCKET,
|
||||
FLM_THP_SERVER,
|
||||
FLM_PDF_SERVER,
|
||||
LVS ,
|
||||
};
|
||||
enum class eConnection
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
AVS_WORKSTATION,
|
||||
AVS_WORKSTATION_VD,
|
||||
AVS_ROOT,
|
||||
AVS_FM,
|
||||
AVS_MOTION_RECORDER,
|
||||
AVS_AVA,
|
||||
ZWLVSV,
|
||||
ZSLV,
|
||||
ZWLVWCS,
|
||||
ZWLVWMS,
|
||||
PWS_WEBSOCKET,
|
||||
SCM_WEBSOCKET,
|
||||
ISM_WEBSOCKET,
|
||||
FLM_THP_SERVER,
|
||||
FLM_PDF_SERVER,
|
||||
LVS,
|
||||
};
|
||||
|
||||
|
||||
|
||||
NGLSETTINGS_EXPORT void setIniFile(const QString &iniFileName);
|
||||
NGLSETTINGS_EXPORT void setIniFile(const QString &iniFileName);
|
||||
|
||||
|
||||
NGLSETTINGS_EXPORT QString iniFile();
|
||||
NGLSETTINGS_EXPORT QString iniFile();
|
||||
|
||||
|
||||
|
||||
NGLSETTINGS_EXPORT unsigned short portOffset();
|
||||
void setPortOffset(unsigned short portOffset);
|
||||
NGLSETTINGS_EXPORT unsigned short portOffset();
|
||||
void setPortOffset(unsigned short portOffset);
|
||||
|
||||
|
||||
NGLSETTINGS_EXPORT unsigned short port(eConnection connection);
|
||||
NGLSETTINGS_EXPORT unsigned short port(eConnection connection);
|
||||
|
||||
|
||||
NGLSETTINGS_EXPORT QString hostName(eConnection connection);
|
||||
void setServerHostname(const QString &serverHostName);
|
||||
NGLSETTINGS_EXPORT QString hostName(eConnection connection);
|
||||
void setServerHostname(const QString &serverHostName);
|
||||
|
||||
|
||||
NGLSETTINGS_EXPORT QString connectionName(eConnection connection);
|
||||
}
|
||||
}
|
||||
NGLSETTINGS_EXPORT QString connectionName(eConnection connection);
|
||||
}
|
||||
}
|
||||
Executable → Regular
+9
-9
@@ -5,13 +5,13 @@
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef NGLSETTINGS_EXPORT
|
||||
# ifdef BUILD_STATIC_LIBRARIES
|
||||
# define NGLSETTINGS_EXPORT
|
||||
# else
|
||||
# ifdef MAKE_NGLSETTINGS_LIB
|
||||
# define NGLSETTINGS_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define NGLSETTINGS_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
# endif
|
||||
#ifdef BUILD_STATIC_LIBRARIES
|
||||
#define NGLSETTINGS_EXPORT
|
||||
#else
|
||||
#ifdef MAKE_NGLSETTINGS_LIB
|
||||
#define NGLSETTINGS_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
#define NGLSETTINGS_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
Executable → Regular
+26
-23
@@ -16,20 +16,21 @@ namespace NGL
|
||||
QSettings *Settings::s_globalSettings = nullptr;
|
||||
|
||||
Settings::Settings(const QString &iniFile_)
|
||||
: m_settings(nullptr)
|
||||
: m_settings(nullptr)
|
||||
{
|
||||
QString iniFile = iniFile_;
|
||||
if(iniFile == QLatin1String("gfs_ws.ini")) {
|
||||
if (iniFile == QLatin1String("gfs_ws.ini"))
|
||||
{
|
||||
const QByteArray defUser = qgetenv("USER");
|
||||
if( defUser == "ctc_aar" || defUser == "ctc_rbf" ) {
|
||||
if (defUser == "ctc_aar" || defUser == "ctc_rbf")
|
||||
{
|
||||
QByteArray home = qgetenv("HOME");
|
||||
if(!home.isEmpty()) {
|
||||
QString fn = QString::fromLocal8Bit(home) +
|
||||
QLatin1String("/gfs_") +
|
||||
QString::fromLocal8Bit(defUser.mid(4)) +
|
||||
QLatin1String(".ini");
|
||||
if (!home.isEmpty())
|
||||
{
|
||||
QString fn = QString::fromLocal8Bit(home) + QLatin1String("/gfs_") + QString::fromLocal8Bit(defUser.mid(4)) + QLatin1String(".ini");
|
||||
QFileInfo fi(fn);
|
||||
if(fi.exists() && fi.isFile() && fi.isReadable()) {
|
||||
if (fi.exists() && fi.isFile() && fi.isReadable())
|
||||
{
|
||||
iniFile = fn;
|
||||
}
|
||||
}
|
||||
@@ -39,8 +40,9 @@ namespace NGL
|
||||
initializeGlobalSettings();
|
||||
|
||||
initPre();
|
||||
if(!iniFile.isEmpty()) {
|
||||
if(QFileInfo(iniFile).isAbsolute())
|
||||
if (!iniFile.isEmpty())
|
||||
{
|
||||
if (QFileInfo(iniFile).isAbsolute())
|
||||
m_settings = new QSettings(iniFile, QSettings::IniFormat);
|
||||
else
|
||||
m_settings = new QSettings(basePath() + iniFile, QSettings::IniFormat);
|
||||
@@ -52,7 +54,7 @@ namespace NGL
|
||||
}
|
||||
|
||||
Settings::Settings(const QString &organization, const QString &application)
|
||||
: m_settings(new QSettings(organization, application))
|
||||
: m_settings(new QSettings(organization, application))
|
||||
{
|
||||
initPre();
|
||||
initPost();
|
||||
@@ -71,8 +73,8 @@ namespace NGL
|
||||
if (!s_globalSettings)
|
||||
{
|
||||
QString globalSettingsFile = NGL::findProjectConfigFile();
|
||||
|
||||
|
||||
|
||||
|
||||
if (!globalSettingsFile.isEmpty())
|
||||
s_globalSettings = new QSettings(globalSettingsFile, QSettings::IniFormat);
|
||||
}
|
||||
@@ -141,7 +143,7 @@ namespace NGL
|
||||
{
|
||||
initializeGlobalSettings();
|
||||
|
||||
return s_globalSettings->value(globalSectionName()+ QLatin1String("/DatabaseName"), QLatin1String("lts_ets_pro")).toString();
|
||||
return s_globalSettings->value(globalSectionName() + QLatin1String("/DatabaseName"), QLatin1String("lts_ets_pro")).toString();
|
||||
}
|
||||
|
||||
QString Settings::databaseHostname()
|
||||
@@ -209,23 +211,24 @@ namespace NGL
|
||||
QString Settings::fixupPath(const QString &_path) const
|
||||
{
|
||||
QString path = QDir::fromNativeSeparators(_path);
|
||||
if(!QDir::isAbsolutePath(path))
|
||||
if (!QDir::isAbsolutePath(path))
|
||||
path = basePath() + path;
|
||||
path = QDir::cleanPath(path);
|
||||
if(!path.endsWith(QLatin1Char('/')))
|
||||
if (!path.endsWith(QLatin1Char('/')))
|
||||
path += QLatin1Char('/');
|
||||
return path;
|
||||
}
|
||||
|
||||
QString Settings::getDirectory(const QByteArray &_dir, const QString &defPrefix, bool bPathLowercase)
|
||||
{
|
||||
if(m_paths[_dir].isEmpty()) {
|
||||
if (m_paths[_dir].isEmpty())
|
||||
{
|
||||
const QString lowerDir = QString::fromLatin1(_dir.toLower());
|
||||
const QString dir = bPathLowercase ? lowerDir : QString::fromLatin1(_dir);
|
||||
QString def = defPrefix + QLatin1Char('/') + dir + QLatin1Char('/');
|
||||
m_paths[_dir] = fixupPath(m_settings->value(QLatin1String("paths/") + lowerDir, def).toString());
|
||||
QDir d(m_paths[_dir]);
|
||||
if(!d.exists())
|
||||
if (!d.exists())
|
||||
d.mkpath(d.absolutePath());
|
||||
}
|
||||
return m_paths[_dir];
|
||||
@@ -235,18 +238,18 @@ namespace NGL
|
||||
{
|
||||
#ifdef WIN32
|
||||
QString path = QString::fromLocal8Bit(qgetenv("GFS_PATH"));
|
||||
if(path.isEmpty())
|
||||
if (path.isEmpty())
|
||||
path = QCoreApplication::applicationDirPath();
|
||||
m_paths["GFS_PATH"] = fixupPath(path);
|
||||
#else
|
||||
QByteArray path = qgetenv("GFS_PATH");
|
||||
if(path.isEmpty())
|
||||
if (path.isEmpty())
|
||||
path = qgetenv("HOME");
|
||||
m_paths["GFS_PATH"] = fixupPath(QString::fromLocal8Bit(path));
|
||||
#endif
|
||||
|
||||
QByteArray tmppath = qgetenv("TMP_PATH");
|
||||
if(tmppath.isEmpty())
|
||||
if (tmppath.isEmpty())
|
||||
tmppath = qgetenv("TMP");
|
||||
if (tmppath.isEmpty())
|
||||
tmppath = QDir::tempPath().toLocal8Bit();
|
||||
@@ -317,4 +320,4 @@ namespace NGL
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Executable → Regular
+85
-105
@@ -8,135 +8,115 @@
|
||||
|
||||
class QSettings;
|
||||
|
||||
namespace NGL {
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
|
||||
class NGLSETTINGS_EXPORT Settings {
|
||||
public:
|
||||
|
||||
|
||||
explicit Settings(const QString &iniFile);
|
||||
class NGLSETTINGS_EXPORT Settings
|
||||
{
|
||||
public:
|
||||
explicit Settings(const QString &iniFile);
|
||||
|
||||
|
||||
|
||||
explicit Settings(const QString &organization, const QString &application);
|
||||
|
||||
Settings(const Settings&) = delete;
|
||||
Settings &operator=(const Settings&) = delete;
|
||||
explicit Settings(const QString &organization, const QString &application);
|
||||
|
||||
|
||||
Settings(const Settings &) = delete;
|
||||
Settings &operator=(const Settings &) = delete;
|
||||
|
||||
virtual ~Settings();
|
||||
|
||||
|
||||
static void initializeGlobalSettings();
|
||||
virtual ~Settings();
|
||||
|
||||
|
||||
QString basePath() const;
|
||||
|
||||
QString tempPath() const;
|
||||
|
||||
QString printPath();
|
||||
|
||||
QString logoProject();
|
||||
|
||||
QString bitmapPath();
|
||||
|
||||
|
||||
|
||||
QString zsks_rxPath();
|
||||
|
||||
QString zsks_txPath();
|
||||
static void initializeGlobalSettings();
|
||||
|
||||
|
||||
|
||||
static QString databaseName();
|
||||
|
||||
static QString databaseHostname();
|
||||
|
||||
QString databaseUser();
|
||||
|
||||
QString databasePassword(const QString &databaseUser = QString());
|
||||
|
||||
QString databaseDriver();
|
||||
|
||||
|
||||
|
||||
QString aarServerPath(int exerciseId);
|
||||
bool isDatabaseConnectionLocal();
|
||||
QString basePath() const;
|
||||
|
||||
|
||||
int avsKeepAliveTimeout();
|
||||
QString avsServerHost();
|
||||
quint16 avsServerPortAVE();
|
||||
QString tempPath() const;
|
||||
|
||||
|
||||
QSettings *settings();
|
||||
|
||||
const QSettings *settings() const;
|
||||
QString printPath();
|
||||
|
||||
|
||||
int getInteger(const QString &key, int defVal) const;
|
||||
QString logoProject();
|
||||
|
||||
|
||||
int getInteger(const QString &group, const QString &key, int defVal) const
|
||||
{
|
||||
return getInteger(group + QLatin1Char('/') + key, defVal);
|
||||
}
|
||||
QString bitmapPath();
|
||||
|
||||
|
||||
float getFloat(const QString &key, float defVal) const;
|
||||
|
||||
|
||||
float getFloat(const QString &group, const QString &key, float defVal) const
|
||||
{
|
||||
return getFloat(group + QLatin1Char('/') + key, defVal);
|
||||
}
|
||||
QString zsks_rxPath();
|
||||
|
||||
|
||||
double getDouble(const QString &key, double defVal) const;
|
||||
QString zsks_txPath();
|
||||
|
||||
|
||||
double getDouble(const QString &group, const QString &key, double defVal) const
|
||||
{
|
||||
return getDouble(group + QLatin1Char('/') + key, defVal);
|
||||
}
|
||||
|
||||
|
||||
bool getBoolean(const QString &key, bool defVal) const;
|
||||
static QString databaseName();
|
||||
|
||||
|
||||
bool getBoolean(const QString &group, const QString &key, bool defVal) const
|
||||
{
|
||||
return getBoolean(group + QLatin1Char('/') + key, defVal);
|
||||
}
|
||||
static QString databaseHostname();
|
||||
|
||||
|
||||
QString getString(const QString &key, const QString &defVal) const;
|
||||
QString databaseUser();
|
||||
|
||||
|
||||
QString getString(const QString &group, const QString &key, const QString &defVal) const
|
||||
{
|
||||
return getString(group + QLatin1Char('/') + key, defVal);
|
||||
}
|
||||
QString databasePassword(const QString &databaseUser = QString());
|
||||
|
||||
static unsigned short portOffset();
|
||||
static unsigned short domainId();
|
||||
static QString serverHostname();
|
||||
static QString logPath();
|
||||
static QString globalSectionName();
|
||||
QString databaseDriver();
|
||||
|
||||
private:
|
||||
|
||||
QString fixupPath(const QString &path) const;
|
||||
|
||||
|
||||
QString getDirectory(const QByteArray &dir, const QString &defPrefix, bool bPathLowercase = false);
|
||||
private:
|
||||
void initPre();
|
||||
void initPost();
|
||||
QSettings *m_settings;
|
||||
static QSettings *s_globalSettings;
|
||||
QHash<QByteArray, QString> m_paths;
|
||||
QString aarServerPath(int exerciseId);
|
||||
bool isDatabaseConnectionLocal();
|
||||
|
||||
|
||||
int avsKeepAliveTimeout();
|
||||
QString avsServerHost();
|
||||
quint16 avsServerPortAVE();
|
||||
|
||||
|
||||
QSettings *settings();
|
||||
|
||||
const QSettings *settings() const;
|
||||
|
||||
|
||||
int getInteger(const QString &key, int defVal) const;
|
||||
|
||||
|
||||
int getInteger(const QString &group, const QString &key, int defVal) const { return getInteger(group + QLatin1Char('/') + key, defVal); }
|
||||
|
||||
|
||||
float getFloat(const QString &key, float defVal) const;
|
||||
|
||||
|
||||
float getFloat(const QString &group, const QString &key, float defVal) const { return getFloat(group + QLatin1Char('/') + key, defVal); }
|
||||
|
||||
|
||||
double getDouble(const QString &key, double defVal) const;
|
||||
|
||||
|
||||
double getDouble(const QString &group, const QString &key, double defVal) const { return getDouble(group + QLatin1Char('/') + key, defVal); }
|
||||
|
||||
|
||||
bool getBoolean(const QString &key, bool defVal) const;
|
||||
|
||||
|
||||
bool getBoolean(const QString &group, const QString &key, bool defVal) const { return getBoolean(group + QLatin1Char('/') + key, defVal); }
|
||||
|
||||
|
||||
QString getString(const QString &key, const QString &defVal) const;
|
||||
|
||||
|
||||
QString getString(const QString &group, const QString &key, const QString &defVal) const { return getString(group + QLatin1Char('/') + key, defVal); }
|
||||
|
||||
static unsigned short portOffset();
|
||||
static unsigned short domainId();
|
||||
static QString serverHostname();
|
||||
static QString logPath();
|
||||
static QString globalSectionName();
|
||||
|
||||
private:
|
||||
QString fixupPath(const QString &path) const;
|
||||
|
||||
|
||||
QString getDirectory(const QByteArray &dir, const QString &defPrefix, bool bPathLowercase = false);
|
||||
|
||||
private:
|
||||
void initPre();
|
||||
void initPost();
|
||||
QSettings *m_settings;
|
||||
static QSettings *s_globalSettings;
|
||||
QHash<QByteArray, QString> m_paths;
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user