summaryrefslogtreecommitdiffstats
path: root/src/config.cpp
blob: 450c8db54b3ab058d01ce0bdeb669437eb4a453a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "config.h"

#include <QFile>
#include <QTextStream>

const QString CONFIG_DIR("/opt/openslx/xscreensaver");
const QString CONFIG_QSS(CONFIG_DIR + "/style.qss");

Config::Config()
{

}

QString Config::loadFileToString(const QString &fileName)
{
    QFile f(fileName);
    QString str;
    if (f.open(QFile::ReadOnly | QFile::Text)) {
        QTextStream s(&f);
        s.setCodec("UTF-8");
        str = s.readAll();
    }
    return str;
}

QString Config::getMainQss()
{
    return loadFileToString(CONFIG_QSS);
}