C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 6s
C++ / clang-tidy (pull_request) Failing after 21s
JS/TS / lint (pull_request) Successful in 10s
Python / static (pull_request) Successful in 26s
Rust / build (pull_request) Successful in 47s
Rust / fmt (pull_request) Successful in 28s
Python / verify (pull_request) Successful in 1m39s
Rust / clippy (pull_request) Successful in 46s
39 lines
798 B
C++
39 lines
798 B
C++
#pragma once
|
|
|
|
#include "common.hpp"
|
|
#include "objectnode.hpp"
|
|
#include "settingsfile.hpp"
|
|
|
|
namespace ZShell::settings {
|
|
|
|
class RootNode : public ObjectNode {
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(
|
|
QList<ZShell::settings::Diagnostic> diagnostics READ diagnostics NOTIFY
|
|
diagnosticsChanged)
|
|
|
|
public:
|
|
explicit RootNode(
|
|
const QString& path, RootNode* fallback, QObject* parent = nullptr);
|
|
|
|
[[nodiscard]] QList<Diagnostic> diagnostics() const;
|
|
|
|
void load();
|
|
|
|
signals:
|
|
void diagnosticsChanged();
|
|
void treeLoaded(RootNode* self);
|
|
void treeLoadFailed(RootNode* self, const QString& error);
|
|
void treeSaveFailed(RootNode* self, const QString& error);
|
|
|
|
private:
|
|
SettingsFile* const m_file;
|
|
QList<Diagnostic> m_diagnostics;
|
|
|
|
void reloadFromFile();
|
|
void saveToFile();
|
|
};
|
|
|
|
} // namespace ZShell::settings
|