Skip to content

chore: remove touchpad switch file existence check#2908

Merged
deepin-bot[bot] merged 2 commits into
linuxdeepin:masterfrom
fly602:master
Jan 6, 2026
Merged

chore: remove touchpad switch file existence check#2908
deepin-bot[bot] merged 2 commits into
linuxdeepin:masterfrom
fly602:master

Conversation

@fly602

@fly602 fly602 commented Dec 26, 2025

Copy link
Copy Markdown
Contributor

Removed the touchpad switch file existence check functionality from the mouse settings plugin. The implementation included:

  1. Deleted touchpadSwitchFileExists() method from MouseModel class
  2. Removed corresponding Q_PROPERTY declaration from header file
  3. Eliminated visibility condition based on file existence in QML UI

This change was made because the touchpad switch file check is no longer needed in the current system configuration. The file path "/proc/ uos/touchpad_switch" was specific to a particular environment and the functionality has become obsolete with system updates.

Log: Removed touchpad switch file existence verification from mouse settings

Influence:

  1. Verify touchpad settings page loads correctly without file existence check
  2. Test touchpad functionality remains operational
  3. Confirm no regression in mouse/touchpad configuration options
  4. Validate UI layout consistency after removing the conditional visibility

chore: 移除触摸板开关文件存在性检查

从鼠标设置插件中移除了触摸板开关文件存在性检查功能。具体修改包括:

  1. 从 MouseModel 类中删除了 touchpadSwitchFileExists() 方法
  2. 从头文件中移除了对应的 Q_PROPERTY 声明
  3. 在 QML 界面中移除了基于文件存在性的可见性条件

进行此更改是因为在当前系统配置中不再需要触摸板开关文件检查。文件路径 "/
proc/uos/touchpad_switch" 特定于某个环境,随着系统更新该功能已变得过时。

Log: 从鼠标设置中移除了触摸板开关文件存在性验证
PMS: BUG-342407
Influence:

  1. 验证触摸板设置页面在没有文件存在性检查时正确加载
  2. 测试触摸板功能保持正常运行
  3. 确认鼠标/触摸板配置选项没有回归问题
  4. 验证移除条件可见性后 UI 布局的一致性

Summary by Sourcery

Remove the obsolete touchpad switch file existence check from the mouse settings plugin.

Enhancements:

  • Drop the touchpadSwitchFileExists property and associated method from MouseModel as the underlying proc file is no longer used.
  • Always show the touchpad switch in the QML UI by removing its conditional visibility based on the deprecated file check.

Removed the touchpad switch file existence check functionality from the
mouse settings plugin. The implementation included:
1. Deleted touchpadSwitchFileExists() method from MouseModel class
2. Removed corresponding Q_PROPERTY declaration from header file
3. Eliminated visibility condition based on file existence in QML UI

This change was made because the touchpad switch file check is no
longer needed in the current system configuration. The file path "/proc/
uos/touchpad_switch" was specific to a particular environment and the
functionality has become obsolete with system updates.

Log: Removed touchpad switch file existence verification from mouse
settings

Influence:
1. Verify touchpad settings page loads correctly without file existence
check
2. Test touchpad functionality remains operational
3. Confirm no regression in mouse/touchpad configuration options
4. Validate UI layout consistency after removing the conditional
visibility

chore: 移除触摸板开关文件存在性检查

从鼠标设置插件中移除了触摸板开关文件存在性检查功能。具体修改包括:
1. 从 MouseModel 类中删除了 touchpadSwitchFileExists() 方法
2. 从头文件中移除了对应的 Q_PROPERTY 声明
3. 在 QML 界面中移除了基于文件存在性的可见性条件

进行此更改是因为在当前系统配置中不再需要触摸板开关文件检查。文件路径 "/
proc/uos/touchpad_switch" 特定于某个环境,随着系统更新该功能已变得过时。

Log: 从鼠标设置中移除了触摸板开关文件存在性验证
PMS: BUG-342407
Influence:
1. 验证触摸板设置页面在没有文件存在性检查时正确加载
2. 测试触摸板功能保持正常运行
3. 确认鼠标/触摸板配置选项没有回归问题
4. 验证移除条件可见性后 UI 布局的一致性
@sourcery-ai

sourcery-ai Bot commented Dec 26, 2025

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Removes the obsolete touchpad switch existence check from the mouse settings plugin by deleting the backing C++ API and the QML visibility binding that depended on it.

Class diagram for MouseModel touchpadSwitchFileExists removal

classDiagram
    class OldMouseModel {
        <<QObject>>
        +bool tapEnabled
        +QString gestureFingerAniPath
        +QString gestureActionAniPath
        +int cursorSize
        +QList~int~ availableCursorSizes
        +bool touchpadSwitchFileExists()
    }

    class NewMouseModel {
        <<QObject>>
        +bool tapEnabled
        +QString gestureFingerAniPath
        +QString gestureActionAniPath
        +int cursorSize
        +QList~int~ availableCursorSizes
    }

    OldMouseModel <|-- NewMouseModel
Loading

File-Level Changes

Change Details Files
Remove the touchpad switch existence check logic from the MouseModel backend.
  • Deleted the touchpadSwitchFileExists() method implementation that used QFile::exists on /proc/uos/touchpad_switch.
  • Removed the touchpadSwitchFileExists() declaration from the MouseModel class interface.
src/plugin-mouse/operation/mousemodel.cpp
src/plugin-mouse/operation/mousemodel.h
Simplify the touchpad QML page by always showing the relevant switch control.
  • Removed the visible binding that depended on dccData.touchpadSwitchFileExists so the switch is now always visible.
src/plugin-mouse/qml/Touchpad.qml

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - 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
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, fly602

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

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我来对这段代码的变更进行审查:

  1. 代码变更概述:
  • 移除了MouseModel类中的touchpadSwitchFileExists()方法和相关的Q_PROPERTY声明
  • 移除了Touchpad.qml中控制触摸板开关显示的visible属性绑定
  1. 代码质量分析:
    优点:
  • 移除了不必要的文件检查逻辑,简化了代码结构
  • 删除了未使用的Q_PROPERTY,减少了不必要的属性暴露
  • 提高了代码的可维护性

潜在问题:

  • 这个改动可能会影响触摸板开关的显示逻辑。原本是根据"/proc/uos/touchpad_switch"文件是否存在来决定是否显示触摸板开关,现在直接显示开关,可能会导致在某些不支持触摸板的设备上也显示开关控件。
  1. 安全性分析:
  • 移除文件检查逻辑本身不会带来安全风险
  • 但需要确保在所有支持的设备上都能正确处理触摸板开关的显示
  1. 性能分析:
  • 移除文件检查实际上可以提升性能,因为减少了文件系统访问
  • 减少了不必要的属性绑定,也有助于提升QML的渲染性能

改进建议:

  1. 如果确实需要移除文件检查,建议:
  • 添加其他机制来判断设备是否支持触摸板
  • 或者确保触摸板开关在不支持的设备上被正确禁用
  1. 代码组织建议:
  • 如果这个功能不再需要,建议添加注释说明移除的原因
  • 考虑添加版本控制相关的注释,记录这个变更的背景
  1. 测试建议:
  • 需要在各种硬件配置下测试触摸板开关的显示和行为
  • 特别要测试在不支持触摸板的设备上的表现
  1. 文档建议:
  • 更新相关文档,说明触摸板开关的显示逻辑变更
  • 如果有相关的API文档,也需要相应更新

总结:
这个改动从代码简洁性和性能角度来看是积极的,但需要确保不会影响功能正确性。建议进行充分的测试,并考虑添加适当的注释说明变更原因。

@fly602

fly602 commented Jan 6, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Jan 6, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit 04dbc56 into linuxdeepin:master Jan 6, 2026
16 of 18 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.

3 participants