mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Servatrice: group all the use of QSettings in a single file
and add a method to guess the path of servatrice.ini
This commit is contained in:
parent
277aba79dc
commit
a1b6600fe1
7 changed files with 113 additions and 53 deletions
|
|
@ -1,9 +1,9 @@
|
|||
#include "server_logger.h"
|
||||
#include "settingscache.h"
|
||||
#include <QSocketNotifier>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QDateTime>
|
||||
#include <QSettings>
|
||||
#include <iostream>
|
||||
#ifdef Q_OS_UNIX
|
||||
# include <sys/types.h>
|
||||
|
|
@ -50,9 +50,8 @@ void ServerLogger::logMessage(QString message, void *caller)
|
|||
callerString = QString::number((qulonglong) caller, 16) + " ";
|
||||
|
||||
//filter out all log entries based on values in configuration file
|
||||
QSettings settings("servatrice.ini", QSettings::IniFormat);
|
||||
bool shouldWeWriteLog = settings.value("server/writelog").toBool();
|
||||
QString logFilters = settings.value("server/logfilters").toString();
|
||||
bool shouldWeWriteLog = settingsCache->value("server/writelog").toBool();
|
||||
QString logFilters = settingsCache->value("server/logfilters").toString();
|
||||
QStringList listlogFilters = logFilters.split(",", QString::SkipEmptyParts);
|
||||
bool shouldWeSkipLine = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue