global: add Quickshell.processId and rename Process.pid

This commit is contained in:
outfoxxed 2024-03-08 23:25:54 -08:00
parent b720dfa165
commit a35d3f9584
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 15 additions and 6 deletions

View file

@ -15,6 +15,7 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#include <qvariant.h>
#include <unistd.h>
#include "qmlscreen.hpp"
#include "rootwrapper.hpp"
@ -67,6 +68,10 @@ QuickshellGlobal::QuickshellGlobal(QObject* parent): QObject(parent) {
}
}
qint32 QuickshellGlobal::processId() const { // NOLINT
return getpid();
}
qsizetype QuickshellGlobal::screensCount(QQmlListProperty<QuickshellScreenInfo>* prop) {
return static_cast<QuickshellGlobal*>(prop->object)->mScreens.size(); // NOLINT
}