Skip to content

Commit 33637f3

Browse files
18202781743deepin-bot[bot]
authored andcommitted
fix: remove fallback to file mode in DConfig
1. Removed the fallback mechanism from DBus mode to file mode in DConfig 2. DConfig now only supports DBus mode by default without falling back to file mode 3. This prevents applications from creating directories when calling interfaces during image building The change removes the automatic fallback to FileBackend when DBusBackend is unavailable. Previously, if DBus service wasn't available, DConfig would fall back to file mode which could cause directory creation during container/image building. Now it will only use DBus mode or fail if DBus is unavailable. Influence: 1. Test DConfig initialization when DBus service is available 2. Verify DConfig fails gracefully when DBus service is unavailable 3. Test that no directories are created during container/image building scenarios 4. Verify existing DBus-based configurations continue to work correctly 5. Test application behavior when DConfig cannot initialize due to missing DBus fix: 移除 DConfig 中回退到文件模式的机制 1. 移除了 DConfig 中从 DBus 模式回退到文件模式的机制 2. DConfig 现在默认只支持 DBus 模式,不会回退到文件模式 3. 这可以防止在构建镜像时,应用程序调用接口去创建目录 此更改移除了当 DBusBackend 不可用时自动回退到 FileBackend 的机制。之前, 如果 DBus 服务不可用,DConfig 会回退到文件模式,这可能导致在容器/镜像构 建期间创建目录。现在它只会使用 DBus 模式,或者在 DBus 不可用时失败。 Influence: 1. 测试当 DBus 服务可用时的 DConfig 初始化 2. 验证当 DBus 服务不可用时 DConfig 优雅地失败 3. 测试在容器/镜像构建场景下不会创建目录 4. 验证现有的基于 DBus 的配置继续正常工作 5. 测试由于缺少 DBus 导致 DConfig 无法初始化时的应用程序行为 PMS: BUG-312173
1 parent 0b45d73 commit 33637f3

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/dconfig.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: LGPL-3.0-or-later
44

@@ -557,10 +557,6 @@ DConfigBackend *DConfigPrivate::getOrCreateBackend()
557557
qCDebug(cfLog, "Fallback to DBus mode");
558558
backend.reset(new DBusBackend(this));
559559
}
560-
if (!backend) {
561-
qCDebug(cfLog, "Can't use DBus config service, fallback to DConfigFile mode");
562-
backend.reset(new FileBackend(this));
563-
}
564560
#else
565561
backend.reset(new FileBackend(this));
566562
#endif //D_DISABLE_DBUS_CONFIG

0 commit comments

Comments
 (0)