Skip to content

fix: add input device bus interface for USB Devices#528

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/eaglefrom
add-uos:develop/eagle
Sep 4, 2025
Merged

fix: add input device bus interface for USB Devices#528
deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/eaglefrom
add-uos:develop/eagle

Conversation

@add-uos
Copy link
Contributor

@add-uos add-uos commented Sep 3, 2025

improve input device Bus interface detectionadd, add input device bus interface for USB Devices

Log: add input device bus interface for USB Devices
Bug: https://pms.uniontech.com/bug-view-331181.html
Change-Id: Ie66f434275af797a31a083f9ea6eb8a63dd427ab

Summary by Sourcery

Bug Fixes:

  • Add "USB" to the supported input device bus interfaces list

improve input device Bus interface detectionadd, add input device bus
interface for USB Devices

Log: add input device bus interface for USB Devices
Bug: https://pms.uniontech.com/bug-view-331181.html
Change-Id: Ie66f434275af797a31a083f9ea6eb8a63dd427ab
@sourcery-ai
Copy link

sourcery-ai bot commented Sep 3, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Extended input device bus interface detection by including USB devices in the supported interfaces list.

Class diagram for updated DeviceInput supported interfaces

classDiagram
class DeviceInput {
  +QStringList m_supportInterfaces
}
DeviceInput : m_supportInterfaces = ["PS/2", "Bluetooth", "I2C", "USB"]
Loading

File-Level Changes

Change Details Files
Added USB to the list of supported input device bus interfaces
  • Appended "USB" to m_supportInterfaces QStringList initialization
deepin-devicemanager/src/DeviceManager/DeviceInput.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link

deepin pr auto review

根据提供的git diff,我看到在DeviceInput.cpp文件中,对m_supportInterfaces列表进行了一个简单的修改,添加了"USB"接口支持。让我对这个修改进行分析:

  1. 语法逻辑:
  • 语法上没有问题,QStringList的初始化语法正确
  • 添加"USB"到支持的接口列表中符合逻辑扩展
  1. 代码质量:
  • 修改简单直接,保持了代码的一致性
  • 建议:为了提高代码可维护性,建议将支持接口的定义移到单独的静态常量或配置文件中,而不是直接硬编码在类中
  1. 代码性能:
  • 这次修改不会影响性能,只是增加了一个字符串元素到静态列表中
  • 静态列表的初始化只在程序启动时进行一次,对运行时性能没有影响
  1. 代码安全:
  • 添加"USB"接口是安全的,前提是代码中已经有相应的USB设备处理逻辑
  • 建议:确保添加USB支持后,相关的设备检测和处理逻辑已经实现,避免出现识别到设备但无法正确处理的情况

改进建议:

  1. 考虑将支持接口列表的定义移到单独的头文件中作为静态常量,例如:
static const QStringList SUPPORTED_INTERFACES = {"PS/2", "Bluetooth", "I2C", "USB"};
  1. 添加适当的注释说明USB接口支持的添加原因和实现时间,方便后续维护

  2. 考虑添加单元测试来验证USB接口设备的正确识别和处理

  3. 如果可能,将接口支持列表做成可配置的,通过配置文件或设置来管理,而不是硬编码在代码中

总体来说,这个修改本身是简单且安全的,但建议配合相关的USB设备处理逻辑一起完善,并考虑上述改进建议以提高代码质量和可维护性。

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@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 Sep 4, 2025

/forcemerge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Sep 4, 2025

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit 45383ea into linuxdeepin:develop/eagle Sep 4, 2025
15 of 17 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