-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigworker.h
More file actions
54 lines (42 loc) · 1.28 KB
/
configworker.h
File metadata and controls
54 lines (42 loc) · 1.28 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef CONFIGWORKER_H
#define CONFIGWORKER_H
#include <QObject>
#include <QtSql/QtSql>
#include "types.h"
#include <QString>
#include <QVector>
#include <QStringList>
#include <QMap>
#define CONGIF_FILENAME "./config.txt"
#define DB_LEAGUES_TABLE(x) ("leaguesOf" + (x))
#define DB_CMDS_TABLE(x, y) (x) + "_" + (y)
#define STR_MACRO(x) #x
#define DB_TABLE_RESULTS(x) "RES_TABLE_" STR_MACRO(x)
class ConfigWorker {
public:
ConfigWorker();
~ConfigWorker();
void setData(QString, QString, QVector<Command>);
QStringList getLeagues(QString);
QVector<CMDState> getCmds(QString, QString);
int openDB();
void fillDB();
QStringList getContries();
QString getXlsxPath() const;
QString getDBPath() const;
void setXlsxPath(QString);
void setDBPath(QString);
int setConfigFile();
void saveConfigFile();
void changeCmdState(QString, QString, QString, bool);
void changeAllCmdsState(bool);
void changeLigaState(QString country, QString league, bool state);
int saveAnalizeResults(QList<ResAnalize> vled);
QList<ResAnalize> loadAnalizeResults(QString path);
private:
void initDatabase();
QSqlDatabase sdb;
QString db_path;
QString xlsx_path;
};
#endif // CONFIGWORKER_H