Skip to content

Conversation

@zy-seven
Copy link
Collaborator

@zy-seven zy-seven commented Dec 5, 2024

optimize dbus monitor

Log: optimize dbus monitor

Bug: https://pms.uniontech.com/bug-view-291055.html

@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

代码审查意见:

  1. 重复定义宏

    • multitaskview.cpp文件中,DBUS_APPEARANCE_SERVICEDBUS_APPEARANCE_OBJDBUS_APPEARANCE_INTF宏在多个文件中重复定义,建议将这些宏移动到一个公共头文件中,以避免重复定义。
  2. 不必要的QDBusInterface调用

    • outline.cpp文件中,ActiveColor函数中直接使用QDBusInterface获取属性值,建议使用m_colorConfigReader来获取属性值,以保持一致性。
  3. 未使用的变量

    • chameleonbutton.cpp文件中,qDebug宏被注释掉了,如果不需要调试信息,建议删除这些代码以保持代码的整洁。
  4. 潜在的内存泄漏

    • workspace.cpp文件中,m_fontSizeConfigReaderm_fontFamilyConfigReader被定义为指针,但在析构函数中并没有释放这些指针,建议使用std::unique_ptr来管理这些指针的生命周期,以避免潜在的内存泄漏。
  5. 代码风格一致性

    • workspace.cpp文件中,slotActiveColorChangedslotIconThemeChanged函数的参数类型不一致,建议统一使用QVariant类型作为参数。
  6. 未使用的变量

    • workspace.h文件中,KWinDBusServiceKWinDBusPathKWinDBusInterface宏在文件中未使用,建议删除这些宏以保持代码的整洁。
  7. 潜在的空指针解引用

    • workspace.cpp文件中,m_colorConfigReaderm_iconConfigReaderActiveColor函数中被使用前没有检查是否为空,建议在访问这些指针之前添加空指针检查。
  8. 代码重复

    • workspace.cpp文件中,getFontSizeScalegetFontFamily函数中重复了类似的代码来获取属性值,建议将这些代码封装到一个公共函数中,以减少代码重复。

总体来说,代码中存在一些重复定义、未使用的变量、潜在的内存泄漏和代码风格不一致的问题,建议进行相应的修改和优化。

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: haidong-602, zy-seven

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zy-seven zy-seven merged commit 67d3e2a into linuxdeepin:master Dec 5, 2024
14 checks passed
@zy-seven zy-seven deleted the fix-291055 branch December 7, 2024 08:18
wineee added a commit to wineee/deepin-kwin that referenced this pull request Mar 20, 2025
wineee added a commit to wineee/deepin-kwin that referenced this pull request Mar 20, 2025
zccrs pushed a commit that referenced this pull request Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants