refactor: adding function to check if server config file have the needed read permissions
This commit is contained in:
parent
d8c7367900
commit
2ecf91e50a
2 changed files with 7 additions and 0 deletions
|
|
@ -238,6 +238,12 @@ QString Settings::serverConfigFile()
|
|||
return useExt ? value(Server::ExternalConfigFile).toString() : defaultValue(Server::ExternalConfigFile).toString();
|
||||
}
|
||||
|
||||
bool Settings::isServerConfigFileReadable()
|
||||
{
|
||||
auto file = QFile(serverConfigFile());
|
||||
return file.open(QFile::ReadOnly);
|
||||
}
|
||||
|
||||
bool Settings::isWritable()
|
||||
{
|
||||
return instance()->m_settings->isWritable();
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ public:
|
|||
static QVariant value(const QString &key = QString());
|
||||
static void restoreDefaultSettings();
|
||||
static QVariant defaultValue(const QString &key);
|
||||
static bool isServerConfigFileReadable();
|
||||
static bool isWritable();
|
||||
static bool isPortableMode();
|
||||
static QString settingsFile();
|
||||
|
|
|
|||
Loading…
Reference in a new issue