1 Star 0 Fork 17

huangjiawen/kiran-cc-daemon_1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-fix-xsettings-Fix-the-problem-that-variable-serial-i.patch 2.20 KB
一键复制 编辑 原始数据 按行查看 历史
From b4411b9fd05760433c8b15b3a9baa1dbe788a1f0 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 10 Aug 2023 15:55:34 +0800
Subject: [PATCH] fix(xsettings): Fix the problem that variable serial isn't
increased when xsettings registry property is updated.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复当xsettings registry属性变化时serial变量未递增问题
Related #11637
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
plugins/xsettings/xsettings-registry.cpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/plugins/xsettings/xsettings-registry.cpp b/plugins/xsettings/xsettings-registry.cpp
index 13472de..4d76599 100644
--- a/plugins/xsettings/xsettings-registry.cpp
+++ b/plugins/xsettings/xsettings-registry.cpp
@@ -209,19 +209,19 @@ bool XSettingsRegistry::init()
bool XSettingsRegistry::update(const std::string &name, int32_t value)
{
- auto var = std::make_shared<XSettingsPropertyInt>(name, value);
+ auto var = std::make_shared<XSettingsPropertyInt>(name, value, this->serial_);
return this->update(var);
}
bool XSettingsRegistry::update(const std::string &name, const Glib::ustring &value)
{
- auto var = std::make_shared<XSettingsPropertyString>(name, value.raw());
+ auto var = std::make_shared<XSettingsPropertyString>(name, value.raw(), this->serial_);
return this->update(var);
}
bool XSettingsRegistry::update(const std::string &name, const XSettingsColor &value)
{
- auto var = std::make_shared<XSettingsPropertyColor>(name, value);
+ auto var = std::make_shared<XSettingsPropertyColor>(name, value, this->serial_);
return this->update(var);
}
@@ -282,6 +282,7 @@ bool XSettingsRegistry::notify()
data.append(std::string("\0\0\0", 3));
data.append(std::string((char *)&this->serial_, 4));
data.append(std::string((char *)&nsettings, 4));
+ ++this->serial_;
// 填充body
for (const auto &iter : this->properties_)
@@ -310,4 +311,4 @@ char XSettingsRegistry::byte_order()
return (*(char *)&myint == 1) ? MSBFirst : LSBFirst;
}
-} // namespace Kiran
\ No newline at end of file
+} // namespace Kiran
--
2.36.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kylin-huangjiawen/kiran-cc-daemon_spec.git
git@gitee.com:kylin-huangjiawen/kiran-cc-daemon_spec.git
kylin-huangjiawen
kiran-cc-daemon_spec
kiran-cc-daemon_1
master

搜索帮助