Commit 59e7b81e authored by Aard's avatar Aard

[ssu] Read loglevel through QSettings to avoid recursion/crash

parent b062d35c
......@@ -12,7 +12,6 @@
#include <getdef.h>
#include "ssucoreconfig.h"
#include "ssulog.h"
SsuCoreConfig *SsuCoreConfig::ssuCoreConfig = 0;
......
......@@ -27,11 +27,13 @@ void SsuLog::print(int priority, QString message){
QByteArray ba = message.toUtf8();
const char *ca = ba.constData();
// directly go through qsettings here to avoid recursive invocation
// of coreconfig / ssulog
if (ssuLogLevel == -1){
SsuCoreConfig *settings = SsuCoreConfig::instance();
QSettings settings(SSU_CONFIGURATION, QSettings::IniFormat);
if (settings->contains("loglevel"))
ssuLog->ssuLogLevel = settings->value("loglevel").toInt();
if (settings.contains("loglevel"))
ssuLog->ssuLogLevel = settings.value("loglevel").toInt();
else
ssuLog->ssuLogLevel = LOG_ERR;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment