From f1031391ea8b2f61dc8fc13f5f3b557b2d1974ac Mon Sep 17 00:00:00 2001 From: Ye ShanShan Date: Sun, 7 Apr 2024 11:04:18 +0800 Subject: [PATCH] fix: can't write environ to storage m_environ maybe empty when it is be set more than once. and the key is already exists in storage. --- src/dbus/applicationservice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbus/applicationservice.cpp b/src/dbus/applicationservice.cpp index fe8e3a1..0f8a49e 100644 --- a/src/dbus/applicationservice.cpp +++ b/src/dbus/applicationservice.cpp @@ -573,7 +573,7 @@ void ApplicationService::setEnviron(const QString &value) noexcept } auto appId = id(); - if (!m_environ.isEmpty()) { + if (!storagePtr->readApplicationValue(appId, ApplicationPropertiesGroup, Environ).isNull()) { if (!storagePtr->updateApplicationValue(appId, ApplicationPropertiesGroup, Environ, value)) { sendErrorReply(QDBusError::Failed, "update environ failed."); return;