fix: Process.pid and Quickshell.env returning undefined instead of null

This commit is contained in:
outfoxxed 2024-03-03 15:31:15 -08:00
parent 087c929871
commit b42add3967
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 2 additions and 2 deletions

View file

@ -79,7 +79,7 @@ void QuickshellGlobal::updateScreens() {
QVariant QuickshellGlobal::env(const QString& variable) { // NOLINT
auto vstr = variable.toStdString();
if (!qEnvironmentVariableIsSet(vstr.data())) return QVariant();
if (!qEnvironmentVariableIsSet(vstr.data())) return QVariant::fromValue(nullptr);
return qEnvironmentVariable(vstr.data());
}

View file

@ -20,7 +20,7 @@ void Process::setRunning(bool running) {
}
QVariant Process::pid() const {
if (this->process == nullptr) return QVariant();
if (this->process == nullptr) return QVariant::fromValue(nullptr);
return QVariant::fromValue(this->process->processId());
}