forked from quickshell/quickshell
core/qmlglobal: expose cacheDir
This commit is contained in:
parent
fee4942771
commit
69c7f4fe77
3 changed files with 16 additions and 0 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "generation.hpp"
|
||||
#include "iconimageprovider.hpp"
|
||||
#include "paths.hpp"
|
||||
#include "qmlscreen.hpp"
|
||||
#include "rootwrapper.hpp"
|
||||
|
||||
|
@ -189,6 +190,14 @@ 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();
|
||||
|
||||
qCritical() << "Could not find cache dir.";
|
||||
return "/quickshell-cache-not-found";
|
||||
}
|
||||
|
||||
QVariant QuickshellGlobal::env(const QString& variable) { // NOLINT
|
||||
auto vstr = variable.toStdString();
|
||||
if (!qEnvironmentVariableIsSet(vstr.data())) return QVariant::fromValue(nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue