Skip to content

Conversation

@add-uos
Copy link
Contributor

@add-uos add-uos commented Jul 29, 2025

Corrected I2C protocol touchpad showing as PS/2 interface in Device Manager, and updated input device interface detection rules.

Log: Fix incorrect Bus interface display for I2C devices
Bug: https://pms.uniontech.com/bug-view-326531.html
Change-Id: Id30e6e792ce8757de50a53e68fec6af69d490644

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. 代码重复

    • getMouseInfoFromBusDevice 函数在 setInfoFromlshwsetInfoFromHwinfo 中被调用两次,建议检查是否需要重复调用,或者将调用移至一个公共函数中。
  2. 错误处理

    • getMouseInfoFromBusDevice 函数中,process.waitForFinished(10000); 设置了超时时间为10秒,但未处理超时的情况。建议添加超时处理逻辑,例如记录日志或抛出异常。
  3. 正则表达式

    • getMouseInfoFromBusDevice 函数中,使用了 QRegExp 来解析字符串,建议使用 QRegularExpression 以提高正则表达式的性能和安全性。
  4. 字符串比较

    • getMouseInfoFromBusDevice 函数中,使用了 QString::startsWithQString::contains 来比较字符串,建议使用 QString::compare 方法进行不区分大小写的比较。
  5. 代码注释

    • getMouseInfoFromBusDevice 函数的注释应该更详细地描述函数的功能和参数,以便其他开发者更好地理解代码。
  6. 代码风格

    • getMouseInfoFromBusDevice 函数中的变量命名和代码风格不一致,例如 trimmedLinetrimmed_line,建议统一代码风格。
  7. 性能优化

    • getMouseInfoFromBusDevice 函数中使用了 QProcess 来读取 /proc/bus/input/devices 文件,如果这个文件很大,可能会导致性能问题。建议考虑使用其他方法来获取设备信息,例如直接读取文件内容。
  8. 安全性

    • getMouseInfoFromBusDevice 函数中直接从 /proc/bus/input/devices 文件读取设备信息,如果文件内容被恶意修改,可能会导致安全风险。建议添加适当的输入验证和错误处理逻辑。

综上所述,建议对代码进行重构和优化,以提高代码的可读性、可维护性和性能。

Corrected I2C protocol touchpad showing as PS/2 interface in Device
Manager, and updated input device interface detection rules.

Log: Fix incorrect Bus interface display for I2C devices

Bug: https://pms.uniontech.com/bug-view-326531.html
Task: https://pms.uniontech.com/task-view-379781.html
Change-Id: Id30e6e792ce8757de50a53e68fec6af69d490644
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos, GongHeng2017, max-lvs

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

@add-uos
Copy link
Contributor Author

add-uos commented Jul 29, 2025

/merge

@deepin-bot deepin-bot bot merged commit 6e5ecd7 into linuxdeepin:develop/eagle Jul 29, 2025
16 checks passed
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.

4 participants