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.
This commit is contained in:
Ye ShanShan 2024-04-07 11:04:18 +08:00 committed by Comix
parent d541c433bb
commit f1031391ea

View File

@ -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;