fix: define declared method + insert new bar entries to config file list + rename Hyprsunset -> Nightlight
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

This commit is contained in:
2026-09-28 13:11:31 +02:00
parent 5618ba9e6b
commit 4c3d38f023
23 changed files with 1443 additions and 1182 deletions
+25 -30
View File
@@ -8,44 +8,39 @@
namespace ZShell::settings {
class SettingsFile : public QObject {
Q_OBJECT
Q_OBJECT
public:
enum class LoadResult : quint8 {
Unchanged,
Changed,
ParseError,
Error
};
public:
enum class LoadResult : quint8 { Unchanged, Changed, ParseError, Error };
explicit SettingsFile(QString path, QObject* parent = nullptr);
explicit SettingsFile(QString path, QObject* parent = nullptr);
[[nodiscard]] std::optional<QJsonValue> read() const;
void write(const QJsonValue& json);
[[nodiscard]] std::optional<QJsonValue> read() const;
void write(const QJsonValue& json);
LoadResult load(bool reportErrors = true);
LoadResult load(bool reportErrors = true);
signals:
void changed(); // Data changed, not file watcher event
void readFailed(const QString& error);
void writeFailed(const QString& error);
signals:
void changed(); // Data changed, not file watcher event
void readFailed(const QString& error);
void writeFailed(const QString& error);
private:
QString m_path;
QFileSystemWatcher* m_watcher;
QTimer* m_saveDebounce;
QTimer* m_loadDebounce;
int m_loadRetries;
std::optional<QJsonValue> m_lastData;
std::optional<QJsonValue> m_pendingWrite;
private:
QString m_path;
QFileSystemWatcher* m_watcher;
QTimer* m_saveDebounce;
QTimer* m_loadDebounce;
int m_loadRetries;
std::optional<QJsonValue> m_lastData;
std::optional<QJsonValue> m_pendingWrite;
void onFileChanged();
void onDirChanged();
void onFileChanged();
void onDirChanged();
void initWatcher();
void scheduleLoad();
void onLoadDebounced();
void save();
void initWatcher();
void scheduleLoad();
void onLoadDebounced();
void save();
};
} // namespace ZShell::settings