mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-24 21:00:47 +02:00
78 lines
1.2 KiB
C++
78 lines
1.2 KiB
C++
#include <QStandardItemModel>
|
|
#include <QQmlEngine>
|
|
|
|
#include <latch>
|
|
#include <thread>
|
|
|
|
class ConfigModel : public QStandardItemModel {
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_SINGLETON
|
|
|
|
public:
|
|
ConfigModel();
|
|
|
|
void Reload();
|
|
|
|
public slots:
|
|
bool has(const QString&, bool unused) const;
|
|
void erase(const QString&);
|
|
|
|
bool getBool(const QString&, bool unused) const;
|
|
QString getString(const QString&, bool unused) const;
|
|
int getInt(const QString&, bool unused) const;
|
|
|
|
void setBool(const QString&, bool);
|
|
void setString(const QString&, const QString&);
|
|
void setInt(const QString&, int value);
|
|
};
|
|
|
|
class EnvVarModel : public QStandardItemModel {
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_SINGLETON
|
|
|
|
public:
|
|
EnvVarModel();
|
|
|
|
void Reload();
|
|
};
|
|
|
|
class RootFSModel : public QStandardItemModel {
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_SINGLETON
|
|
|
|
std::thread Thread;
|
|
std::latch ExitRequest {1};
|
|
|
|
int INotifyFD;
|
|
int FolderFD;
|
|
|
|
void INotifyThreadFunc();
|
|
|
|
public:
|
|
RootFSModel();
|
|
~RootFSModel();
|
|
|
|
public slots:
|
|
void Reload();
|
|
|
|
bool hasItem(const QString&) const;
|
|
|
|
QUrl getBaseUrl() const;
|
|
};
|
|
|
|
#include <QApplication>
|
|
|
|
class ConfigRuntime : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
ConfigRuntime() {}
|
|
|
|
public slots:
|
|
void onSave(const QUrl&);
|
|
void onLoad(const QUrl&);
|
|
};
|