Commit 7b6ffd5
committed
feat: add isReadOnly method to DConfig
1. Added isReadOnly virtual method to DConfigBackend base class with
default implementation returning false
2. Implemented isReadOnly in FileBackend by checking permissions from
config file metadata
3. Implemented isReadOnly in DBusBackend by calling remote permissions
method via D-Bus
4. Added public isReadOnly method to DConfig class that delegates to
backend implementation
5. Updated documentation with Chinese and English API documentation for
the new method
6. Added test configuration items with readwrite and readonly
permissions in test data
7. Added unit tests to verify isReadOnly functionality for both
permission types
Log: Added DConfig.isReadOnly() method to check if configuration items
are read-only
Influence:
1. Test isReadOnly returns true for configuration items with readonly
permissions
2. Test isReadOnly returns false for configuration items with readwrite
permissions
3. Verify isReadOnly works correctly with both FileBackend and
DBusBackend implementations
4. Test isReadOnly returns false when DConfig is in invalid state
5. Verify documentation is properly updated in both English and Chinese
versions
feat: DConfig新增isReadOnly接口
1. 在DConfigBackend基类中添加isReadOnly虚方法,默认实现返回false
2. 在FileBackend中实现isReadOnly,通过检查配置文件元数据中的权限设置
3. 在DBusBackend中实现isReadOnly,通过D-Bus调用远程权限方法
4. 在DConfig类中添加公共isReadOnly方法,委托给后端实现
5. 更新文档,添加中英文API文档说明新方法
6. 在测试数据中添加具有读写和只读权限的测试配置项
7. 添加单元测试验证isReadOnly功能对两种权限类型的处理
Log: 新增DConfig.isReadOnly()方法用于检查配置项是否为只读
Influence:
1. 测试isReadOnly对只读权限配置项返回true
2. 测试isReadOnly对读写权限配置项返回false
3. 验证isReadOnly在FileBackend和DBusBackend实现中都能正常工作
4. 测试当DConfig处于无效状态时isReadOnly返回false
5. 验证中英文文档都已正确更新1 parent 421510c commit 7b6ffd5
File tree
5 files changed
+90
-0
lines changed- docs/global
- include/global
- src
- tests
- data
5 files changed
+90
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
66 | 74 | | |
67 | 75 | | |
68 | 76 | | |
| |||
384 | 392 | | |
385 | 393 | | |
386 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
387 | 400 | | |
388 | 401 | | |
389 | 402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
| |||
230 | 237 | | |
231 | 238 | | |
232 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
233 | 246 | | |
234 | 247 | | |
235 | 248 | | |
| |||
425 | 438 | | |
426 | 439 | | |
427 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
428 | 453 | | |
429 | 454 | | |
430 | 455 | | |
| |||
821 | 846 | | |
822 | 847 | | |
823 | 848 | | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
824 | 864 | | |
825 | 865 | | |
826 | 866 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
108 | 128 | | |
109 | 129 | | |
110 | 130 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
0 commit comments