core/qmlglobal: expose dataDir and stateDir

This commit is contained in:
outfoxxed 2025-05-16 20:14:59 -07:00
parent 69c7f4fe77
commit c1c24c2998
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 96 additions and 30 deletions

View file

@ -190,12 +190,16 @@ void QuickshellGlobal::setWatchFiles(bool watchFiles) { // NOLINT
QuickshellSettings::instance()->setWatchFiles(watchFiles);
}
QString QuickshellGlobal::cacheDir() const { // NOLINT
auto* dir = QsPaths::instance()->cacheDir();
if (dir) return dir->path();
QString QuickshellGlobal::dataDir() const { // NOLINT
return QsPaths::instance()->shellDataDir().path();
}
qCritical() << "Could not find cache dir.";
return "/quickshell-cache-not-found";
QString QuickshellGlobal::stateDir() const { // NOLINT
return QsPaths::instance()->shellStateDir().path();
}
QString QuickshellGlobal::cacheDir() const { // NOLINT
return QsPaths::instance()->shellCacheDir().path();
}
QVariant QuickshellGlobal::env(const QString& variable) { // NOLINT