core/qmlglobal: add shellId, instanceId, appId and launchTime props

This commit is contained in:
2 * r + 2 * t 2026-03-24 19:21:20 +11:00 committed by outfoxxed
parent b83c39c8af
commit d612227740
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 37 additions and 0 deletions

View file

@ -26,6 +26,7 @@
#include "../io/processcore.hpp"
#include "generation.hpp"
#include "iconimageprovider.hpp"
#include "instanceinfo.hpp"
#include "paths.hpp"
#include "qmlscreen.hpp"
#include "rootwrapper.hpp"
@ -153,6 +154,22 @@ qint32 QuickshellGlobal::processId() const { // NOLINT
return getpid();
}
QString QuickshellGlobal::instanceId() const { // NOLINT
return InstanceInfo::CURRENT.instanceId;
}
QString QuickshellGlobal::shellId() const { // NOLINT
return InstanceInfo::CURRENT.shellId;
}
QString QuickshellGlobal::appId() const { // NOLINT
return InstanceInfo::CURRENT.appId;
}
QDateTime QuickshellGlobal::launchTime() const { // NOLINT
return InstanceInfo::CURRENT.launchTime;
}
qsizetype QuickshellGlobal::screensCount(QQmlListProperty<QuickshellScreenInfo>* /*unused*/) {
return QuickshellTracked::instance()->screens.size();
}