forked from quickshell/quickshell
fix: Process.pid and Quickshell.env returning undefined instead of null
This commit is contained in:
parent
087c929871
commit
b42add3967
|
@ -79,7 +79,7 @@ void QuickshellGlobal::updateScreens() {
|
||||||
|
|
||||||
QVariant QuickshellGlobal::env(const QString& variable) { // NOLINT
|
QVariant QuickshellGlobal::env(const QString& variable) { // NOLINT
|
||||||
auto vstr = variable.toStdString();
|
auto vstr = variable.toStdString();
|
||||||
if (!qEnvironmentVariableIsSet(vstr.data())) return QVariant();
|
if (!qEnvironmentVariableIsSet(vstr.data())) return QVariant::fromValue(nullptr);
|
||||||
|
|
||||||
return qEnvironmentVariable(vstr.data());
|
return qEnvironmentVariable(vstr.data());
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ void Process::setRunning(bool running) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant Process::pid() const {
|
QVariant Process::pid() const {
|
||||||
if (this->process == nullptr) return QVariant();
|
if (this->process == nullptr) return QVariant::fromValue(nullptr);
|
||||||
return QVariant::fromValue(this->process->processId());
|
return QVariant::fromValue(this->process->processId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue