core/qmlglobal: add dataPath(), statePath() and cachePath()

This commit is contained in:
outfoxxed 2025-05-16 20:33:40 -07:00
parent c1c24c2998
commit a05c0de53b
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 30 additions and 0 deletions

View file

@ -155,6 +155,12 @@ public:
/// Setting the `fallback` parameter of `iconPath` will attempt to load the fallback
/// icon if the requested one could not be loaded.
Q_INVOKABLE static QString iconPath(const QString& icon, const QString& fallback);
/// Equivalent to `${Quickshell.dataDir}/${path}`
Q_INVOKABLE [[nodiscard]] QString dataPath(const QString& path) const;
/// Equivalent to `${Quickshell.stateDir}/${path}`
Q_INVOKABLE [[nodiscard]] QString statePath(const QString& path) const;
/// Equivalent to `${Quickshell.cacheDir}/${path}`
Q_INVOKABLE [[nodiscard]] QString cachePath(const QString& path) const;
[[nodiscard]] QString shellRoot() const;