core/qmlglobal: expose cacheDir

This commit is contained in:
outfoxxed 2025-05-16 20:01:38 -07:00
parent fee4942771
commit 69c7f4fe77
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 16 additions and 0 deletions

View file

@ -108,6 +108,10 @@ class QuickshellGlobal: public QObject {
/// If true then the configuration will be reloaded whenever any files change.
/// Defaults to true.
Q_PROPERTY(bool watchFiles READ watchFiles WRITE setWatchFiles NOTIFY watchFilesChanged);
/// The per-shell cache directory.
///
/// Usually `~/.cache/quickshell/by-shell/<shell-id>`
Q_PROPERTY(QString cacheDir READ cacheDir CONSTANT);
// clang-format on
QML_SINGLETON;
QML_NAMED_ELEMENT(Quickshell);
@ -152,6 +156,8 @@ public:
[[nodiscard]] bool watchFiles() const;
void setWatchFiles(bool watchFiles);
[[nodiscard]] QString cacheDir() const;
static QuickshellGlobal* create(QQmlEngine* engine, QJSEngine* /*unused*/);
signals: