Commit Graph

67 Commits

Author SHA1 Message Date
ComixHe 8e85a7cd54 feat: support Qt 6.10
Signed-off-by: ComixHe <heyuming@deepin.org>
2025-10-11 13:17:44 +08:00
yeshanshan c5be272ad8 fix: fix dconfig static variable release issue
Fixed dconfig exit crash caused by static variable destruction order
1. Added null pointer check before accessing m_config in updateValue
method to prevent accessing destroyed objects
2. Added m_config.storeRelaxed(nullptr) in destructor to clear the
atomic pointer
3. Added early return checks in connect and updateValue methods when
config is null
4. Updated default value for p_rules to use proper unicode string
literal

The issue occurred because static dconfig objects were being destroyed
after the QCoreApplication instance, leading to attempts to access
already destroyed DConfig objects during cleanup. The fix ensures proper
null checking and pointer cleanup to prevent crashes during application
exit.

Log: Fixed application exit crash related to dconfig static variables

Influence:
1. Test application normal startup and shutdown
2. Verify dconfig functionality still works correctly
3. Test with multiple dconfig instances
4. Verify no crashes occur during application termination
5. Test configuration value changes and updates

fix: 修复dconfig静态变量释放导致的退出异常

修复了由静态变量销毁顺序引起的dconfig退出崩溃问题
1. 在updateValue方法中添加空指针检查,防止访问已销毁的对象
2. 在析构函数中添加m_config.storeRelaxed(nullptr)来清理原子指针
3. 在connect和updateValue方法中添加config为null时的提前返回检查
4. 更新p_rules的默认值为正确的unicode字符串字面量

问题出现在静态dconfig对象在QCoreApplication实例之后被销毁时,导致在清
理过程中尝试访问已销毁的DConfig对象。修复确保进行适当的空值检查和指针清
理,以防止应用程序退出时的崩溃。

Log: 修复了与dconfig静态变量相关的应用程序退出崩溃问题

Influence:
1. 测试应用程序正常启动和关闭
2. 验证dconfig功能仍然正常工作
3. 测试多个dconfig实例的情况
4. 验证应用程序终止时不会发生崩溃
5. 测试配置值更改和更新功能

PMS: BUG-324689
2025-09-25 15:26:44 +08:00
yeshanshan 39b91e4b79 fix: resolve non-reproducible DBUS code generation issue
Changed QSet to QStringList for annotations collection to ensure
deterministic output order
Added removeDuplicates() call to maintain uniqueness while preserving
order
This fixes non-reproducible builds caused by QSet's unpredictable
iteration order

Log: Fixed DBUS code generation reproducibility issue

Influence:
1. Verify DBUS interface code generation produces identical output for
same inputs
2. Test with multiple interface definitions containing annotations
3. Check build reproducibility across different systems

fix: 修复DBUS代码生成不可重复的问题

将注解集合从QSet改为QStringList以确保输出顺序确定性
添加removeDuplicates()调用在保持顺序的同时确保唯一性
修复了由于QSet迭代顺序不可预测导致的构建不可重复问题

Log: 修复了DBUS代码生成不可重复的问题

Influence:
1. 验证相同输入下DBUS接口代码生成是否产生相同输出
2. 测试包含多个注解的接口定义
3. 检查不同系统间的构建可重复性
2025-08-19 18:42:54 +08:00
Ye ShanShan 579d86a5f1 fix: correct bitwise operation in dconfig status tracking
1. Fixed incorrect bitwise AND operation in property status tracking
2. Changed `fetchAndAndOrdered(1 << index)` to `fetchAndAndOrdered(~(1
<< index))`
3. This ensures proper bit clearing when unsetting property flags
4. The change was made in both the generated header and the generator
tool
5. Without this fix, status tracking would incorrectly set bits instead
of clearing them

fix: 修正 dconfig 状态跟踪中的位操作

1. 修复了属性状态跟踪中错误的位与操作
2. 将 `fetchAndAndOrdered(1 << index)` 改为 `fetchAndAndOrdered(~(1
<< index))`
3. 确保在取消设置属性标志时能正确清除位
4. 修改同时应用于生成的头部文件和生成器工具
5. 若不修复此问题,状态跟踪会错误地设置位而非清除它们
2025-05-08 09:46:40 +00:00
Ye ShanShan 7319297676 fix: add QPointer check for parent object safety
1. Added QPointer include for tracking parent object lifecycle
2. Changed parent initialization to nullptr in constructor for safety
3. Implemented parent object tracking using QPointer to prevent dangling
pointers
4. Added logic to handle parent object deletion during async operation
5. Added proper parent reassignment if parent still exists after
operation

These changes prevent potential crashes when parent objects are deleted
during asynchronous configuration operations, particularly important in
multi-threaded scenarios where parent objects might be destroyed while
operations are pending.

fix: 添加 QPointer 检查确保父对象安全

1. 添加 QPointer 头文件用于跟踪父对象生命周期
2. 构造函数中将父对象初始化为 nullptr 提高安全性
3. 使用 QPointer 实现父对象跟踪,防止悬垂指针
4. 添加处理异步操作期间父对象被删除的逻辑
5. 操作完成后如果父对象仍存在则正确重新设置父对象

这些修改防止了在异步配置操作期间父对象被删除时可能导致的崩溃,对于多线程
场景下父对象可能在操作挂起时被销毁的情况尤为重要。
2025-05-07 03:45:01 +00:00
JiDe Zhang 8db10c9145 fix: resolve compilation failure on Qt 6.9
Updated the dvtablehook.h file to adjust the typedef for Fun2ReturnType
based on changes in Qt 6.9 interfaces. Additionally, the main.cpp
file now casts the unicode value to short to prevent type issues.
These changes are necessary to ensure compatibility with the latest
Qt framework and to resolve the build issues that arise from interface
modifications.

修复: 解决在Qt 6.9上的编译失败

更新了dvtablehook.h文件,以根据Qt 6.9接口的变化调整Fun2ReturnType的
typedef。此外,main.cpp文件现在将unicode值转换为short,以防止类型问题。
这些更改对于确保与最新Qt框架兼容以及解决接口修改引起的构建问题是必要的。
2025-04-12 17:55:30 +08:00
JiDe Zhang e8eedb9efe feat: supports create generic config by dconfig2cpp 2025-03-06 20:59:55 +08:00
JiDe Zhang c250cf2111 fix: build failed on Qt6
create dconfig2cpp's config failed if not assign application id.
Add missing parameter in dconfig2cpp generated code.
2025-03-06 20:59:55 +08:00
JiDe Zhang e6985b9351 feat: dconfig2cpp always add bindableFoo functions on Qt6
Direct string literal for the property name, because the literal was
use on the Q_PROPERTY macro, so use the hex encode for the property name
strings can't avoid the Chinese text codec problems.
2025-03-06 17:18:56 +08:00
JiDe Zhang 8b8bb8512c feat: dconfig2cpp generated codes supports qml
On the DtkDeclarative's DConfigWrapper, it needs know whether the value
is default, so always create the *IsDefaultValue functions.
2025-02-25 09:53:04 +08:00
JiDe Zhang a9a569b42a feat: support auto generate the Qt code from a dconfig's json
To help developer get/set dconfig in the non GUI thread.
2025-02-20 19:45:06 +08:00
Ye ShanShan 73aa1884c0 chore: remove warning for dbusxml2cpp in qt6
adapt to qt6.
2024-05-13 11:00:36 +08:00
groveer fe43eb823d fix(qdbusxml2cpp): support qt 6.7
as title

Log:
2024-04-15 17:30:40 +08:00
chenhongtao a94a528d86 feat: allow skip including headers of annotations
Log:
Issue: https://github.com/linuxdeepin/dtk/issues/147
2023-12-19 14:33:36 +08:00
ck 6afbef5890 chore: fix relative path invalid link
```
 dci --export ./ ./xxx.dci
 # invalid symlink ./1.webp -> 3/36/normal.light/3/1.webp
 # should be       ./1.webp -> ../../normal.light/3/1.webp
```
2023-12-13 10:00:26 +08:00
Gary Wang c7a4732115 fix: correct Dtk6SettingsToolsMacros.cmake path
* fix: correct Dtk6SettingsToolsMacros.cmake path

修正 Dtk6SettingsToolsMacros.cmake 路径不正确的问题
同时避免硬编码版本号到 6

Log:
2023-10-23 10:21:41 +08:00
YeShanShan f29a571b83 fix: Type error for qdbusxml2cpp
We get typeName using `QMetaType::name` in qt6.
  filename of `moc` is changed from `xxx.moc` to `moc_xxx.cpp`, and
it is consistent with qt6.
https://code.qt.io/cgit/qt/qtbase.git/tree/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp?h=dev#n221
2023-10-23 00:19:32 +08:00
ck 5f8a646ba3 chore: dpinyin tweak
- remove duplicate results when permuting and combining Pinyin
- limit the number of results to avoid of OOM
- ch2py print elapsed time

Issue: https://github.com/linuxdeepin/dtk/issues/109
2023-10-09 14:54:15 +08:00
ck f184e05ebd chore(tools): show help if argc < 2
show help instead of show nothing
2023-09-25 10:48:35 +08:00
ck 844a68df95 fix(build): skip failed unit test
- gsettings schema remvove from dtkcommon, Skip
- if DSYSINFO_PREFIX empty, Skip
- add_definitions ==> target_compile_definitions
- setting cache variable move to dtkcore.cmake
2023-09-19 16:56:18 +08:00
ck d56c3629e8 chore: remove unused pro files
remove unused files
2023-07-05 10:19:56 +08:00
wangyixue 5e8b5d2820 fix: qdbusxml2cpp-fix not in path
Now qdbusxml2cpp-fix is not in PATH, just export it as a target so
others can use it.

Log: fix qdbusxml2cpp-fix not in path
2023-06-19 14:40:22 +08:00
ck f5fd6cf9a8 feat: support dtk6core build
cmake -DDVERSION=6.0.0 to build libdtk6core
install qdbusxml2cpp-fix to DCore/bin to avoid conficts
do not build doc when build dtk6
remove Core5Compat depends
DVERSION ==> DTK_VERSION
tools install to CMAKE_INSTALL_LIBEXECDIR
2023-06-16 08:32:50 +08:00
guoyao 4c6390cd5b chore: remove build warning
as title

Log:
2023-04-27 08:54:19 +08:00
heyuming d1605f7da2 feat: support Qt6
Log: 支持Qt6
2023-02-14 13:22:03 +08:00
ck 4cfda53c9c feat: add chinese2pinyin polyphonic support
1. update dpinyin.dict with polyphonic support
2. add pinyin and firstLetters function
3. add ch2py tools to convert Chinese to Pinyin

dict data reference https://github.com/mozillazg/pinyin-data (zdict.txt MIT)
Bug: https://pms.uniontech.com/bug-view-143063.html,https://pms.uniontech.com/bug-view-182013.html

Log: Chinese2Pinyin polyphonic support
Influence: Chinese to Pinyin
Change-Id: I5fd05c071f68908949e2b1abbbd11feed302abd4
2023-01-18 17:36:05 +08:00
ck d3e83fdecf fix(build): dtkcore namespace not using
add DCORE_USE_NAMESPACE

Log: none
Influence: none
Change-Id: Ib9003d4f162732a1c17b4c7588f614b1c4d5580a
2023-01-03 17:17:41 +08:00
rewine deb1c8e37d feat: optimization logic for other distribution
优化对其他发行版的支持

Log: 优化非deepin/uos发行版支持
2022-12-23 05:38:23 +00:00
songwentao 468f065f28 fix: qdbusxml2cpp-fix error
修复使用命令生成代码文件,编译报错问题

Log:
2022-12-07 08:08:32 +00:00
ck 391dd999bd chore: link to real source file when export
link to the real source instead of path in dci file

Log: fix invalid link
Influence: none
Change-Id: I10be7efc5d2e5bb14e0ffeb0198c4ee8ab3f230b
2022-12-06 17:22:59 +08:00
ck b3fd390fa0 chore: add command tree and install dci tool
useage ./dci --tree /path/to/dcifile.dci
install dci in libdtkcore5-bin

Log: none
Influcen: none
Change-Id: I1123d533d367c5b91c735dd0fc581f9896b1e557
2022-12-06 17:22:59 +08:00
范朋程 554d22da1a feat: add ddbusextendedabstractinterface
通过此类可以很方便得实现异步dbus通信
修改tools生成信息中的类名

Log: add ddbusextendedabstractinterface
Change-Id: Ida45d0d22d065af3d86c7ad062419183572291dc
feat: add ddbusextendedabstractinterface

通过此类可以很方便得实现异步dbus通信

Log: add ddbusextendedabstractinterface
Change-Id: Ida45d0d22d065af3d86c7ad062419183572291dc
2022-10-31 15:20:34 +08:00
rewine 8ce7d3e3c7 feat: Optimize compilation parameters
Log: Optimize compilation parameters
2022-10-09 07:21:28 +00:00
rewine 363b612ef7 chore(tools): remove deprecated script
Log: remove deprecated script
2022-09-08 16:01:54 +08:00
rewine 5321d477ad feat: use CMakePackageConfigHelpers to generate better config.cmake
1. 对 CMAKE_INSTALL_PREFIX 默认值修改移动到根目录 CMakeLists.txt
2. 增加 INCLUDE_INSTALL_DIR TOOL_INSTALL_DIR 变量化简写法
3. 使用专门处理 config.cmake 的 configure_package_config_file 函数代替 configure_file
4. 使用 write_basic_package_version_file 生成 cmake 用的版本文件
5. 补充 pkg-config 的 -L 参数
6. 使用更普适的方法配置 pkg-config 内路径
2022-09-07 10:01:28 +00:00
chenhongtao 068a6d9688 fix(shell): wrong target
A mistake, since the target name changed, the target name in shell
should also change

Log: fix recoveryshell
2022-09-06 06:16:31 +00:00
ShootingStarDragons db5ae947fe feat(tocmake): tocmake
Change the build system to cmake

Log: use cmake
2022-08-16 07:50:54 +00:00
guoyao c6629ebb55 chore: adapt REUSE license header
开源合规

Log: 开源合规
2022-08-11 14:02:36 +08:00
Chen Bin 40d737ebcf fix: Optimize the use of DCI tools
1. Add a comment to introduce a real example of the tool.
2. Fix possible fileName acquisition failures in export scenarios

Log:
Influence: None
Change-Id: I752d8d3548793af35b25f748d0f255a86dc32c8f
2022-07-12 15:09:47 +08:00
Chen Bin 8f69866f49 fix(DCI file): Soft link error
Soft link directories retain the original directory
rather than the directory in the relative DCI file,
resulting in the target file not being indexed correctly

Log:
Influence: dci tool
Change-Id: I15779b6b2552537ac2fd8be8f856d7b3d27be44e
2022-02-22 13:28:48 +08:00
zccrs d2f6c41315 feat: 允许获取 dci 内部软链接文件的原始数据
对于 symlink 的目标路径而言,其内容非常灵活,当目标是项目路径时,其
真实的指向文件与链接文件本身所在的位置息息相关,原设计中默认将相对
路径转为 dci 内部的绝对路径,此举虽然方便了使用,但是却丢失了链接
文件的真实信息,当对 dci 格式与真实的文件系统进行导入导出时,将无法
获取链接文件的目标路径,因此添加 origin 参数,当其为 true 时将禁止
自动转换路径,直接返回原本的链接路径。
修复 dci 命令行工具未能正确处理软链接文件的存储和导出问题,QFileInfo
的 symlinkTarget 的设计也对链接内容就行了加工,无法满足使用场景,因此
改为使用 POSIX 中的 readlink 来获取原始的链接目标。

Log:
Change-Id: Ifd0abca205311d6075df65977672817debd0a7b4
2021-09-18 17:23:16 +08:00
zccrs adcff99e0c feat: Add the dci command tool project
提供 dci 命令行工具,支持将一个目录打包生成 dci 文件,或者反向将一个
dci 文件解包为一个目录。此工具支持非 Linux 平台,如 macos。

Log:
Change-Id: I4dec9877fa2cbff5ab1a23bf6a2ee65e7c4bb08f
2021-09-17 18:02:13 +08:00
wangpenga 5712b5f618 fix: unit test memory leak.
修复单元测试中的内存泄露。

Log:
Change-Id: I42404a332a90f2f5b58d2532299f1b01351f291c
2021-06-18 15:01:38 +08:00
ck 74f9f9da90 feat: add qdbusxml2cpp-fix
dtkcore5-bin 新增qdbusxml2cpp-fix(from dde-qt-dbus-factory, 修复生成的类中无属性变化的信号问题)。
修复没有参数时block的bug,无参数直接showhelp

Log: 添加xml2cpp修复版工具
Change-Id: Ic7c4ec4d9564735f4b9e19de67a57f2322e7a0c7
2021-03-23 11:36:04 +08:00
sunkang b9205142b7 feat: 适配多版本合并(移除冲突添加依赖)
1. 移除prf文件,全部移动到libdtkcommon包中
2. 移除cmake文件夹中的文件,移动到libdtkcommon包中
3. 移除src/com.deepin.dtk.gschema.xml文件,移动到libdtkcommon包中
4. 修改control文件,添加依赖libdtkcommon包

Log: dtkcore多版本前的适配版本(移除冲突)
Change-Id: Iac4310cef55ab2bf31478e905d751aa121fb4078
2021-03-01 19:39:05 +08:00
ck 562b0e8c37 fix: correct tools output message typo
打印信息有误,更新api.json

Log: 修复工具输出信息有误的地方
Change-Id: I0eb72cb6162882e083d931318672b008dfdb0cf1
Reviewed-on: http://gerrit.uniontech.com/c/dtkcore/+/5078
Reviewed-by: <mailman@uniontech.com>
Reviewed-by: caitongxun <caitongxun@uniontech.com>
Reviewed-by: chenke <chenke@uniontech.com>
Tested-by: <mailman@uniontech.com>
2020-09-16 17:01:59 +08:00
Robin Lee 9f052cf1ee Fix shebang 2020-07-24 10:58:54 +08:00
ck 523a51ab69 feat: os-version 系统识别方案新接口
根据系统识别方案实现新的接口

Log: 系统识别方案新接口
Task: https://pms.uniontech.com/zentao/task-view-30524.html
Change-Id: I9e1b95a0e85d40c97164b2dd95090bd1d4abf2f9
Reviewed-on: http://gerrit.uniontech.com/c/dtkcore/+/506
Reviewed-by: <mailman@uniontech.com>
Reviewed-by: chenke <chenke@uniontech.com>
Reviewed-by: zhangjide <zhangjide@uniontech.com>
Tested-by: <mailman@uniontech.com>
2020-07-24 01:09:36 +00:00
Gary Wang 57fc346a46 license: switch to LGPLv3 license 2020-04-24 14:44:07 +08:00
Gary Wang 63d6f5c4b3 feat: support get installed memory size from lshw 2020-03-18 16:39:07 +08:00