From b42add39670e4b60f36a2b445a87c1fdc5ebb0c2 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 3 Mar 2024 15:31:15 -0800 Subject: [PATCH] fix: Process.pid and Quickshell.env returning undefined instead of null --- src/core/qmlglobal.cpp | 2 +- src/io/process.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/qmlglobal.cpp b/src/core/qmlglobal.cpp index 014999d6..4915546a 100644 --- a/src/core/qmlglobal.cpp +++ b/src/core/qmlglobal.cpp @@ -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()); } diff --git a/src/io/process.cpp b/src/io/process.cpp index 54f60723..b971347c 100644 --- a/src/io/process.cpp +++ b/src/io/process.cpp @@ -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()); }