Skip to content

fix: remove maybe_unused attribute and add Q_UNUSED#276

Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743:master
Jul 28, 2025
Merged

fix: remove maybe_unused attribute and add Q_UNUSED#276
18202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743
Copy link
Contributor

Removed the [[maybe_unused]] attribute from the QtConcurrent::run result
variable and replaced it with Q_UNUSED macro. This change was made
because:

  1. [[maybe_unused]] is a C++17 feature that might not be supported in
    all build environments
  2. Q_UNUSED is the Qt-specific and more portable way to suppress unused
    variable warnings
  3. Maintains consistency with Qt coding standards
  4. The variable is intentionally unused as we're running the task
    asynchronously without tracking the result

fix: 移除 maybe_unused 属性并添加 Q_UNUSED

移除了 QtConcurrent::run 结果变量的 [[maybe_unused]] 属性,改用 Q_UNUSED
宏。此变更的原因是:

  1. [[maybe_unused]] 是 C++17 特性,可能在某些构建环境中不受支持
  2. Q_UNUSED 是 Qt 特有的更便携的方式来抑制未使用变量警告
  3. 保持与 Qt 编码标准的一致性
  4. 该变量是故意不使用的,因为我们异步运行任务而不跟踪结果

Removed the [[maybe_unused]] attribute from the QtConcurrent::run result
variable and replaced it with Q_UNUSED macro. This change was made
because:
1. [[maybe_unused]] is a C++17 feature that might not be supported in
all build environments
2. Q_UNUSED is the Qt-specific and more portable way to suppress unused
variable warnings
3. Maintains consistency with Qt coding standards
4. The variable is intentionally unused as we're running the task
asynchronously without tracking the result

fix: 移除 maybe_unused 属性并添加 Q_UNUSED

移除了 QtConcurrent::run 结果变量的 [[maybe_unused]] 属性,改用 Q_UNUSED
宏。此变更的原因是:
1. [[maybe_unused]] 是 C++17 特性,可能在某些构建环境中不受支持
2. Q_UNUSED 是 Qt 特有的更便携的方式来抑制未使用变量警告
3. 保持与 Qt 编码标准的一致性
4. 该变量是故意不使用的,因为我们异步运行任务而不跟踪结果
@18202781743 18202781743 requested review from BLumia and mhduiy July 28, 2025 02:54
deepin-ci-robot added a commit to linuxdeepin/qt6integration that referenced this pull request Jul 28, 2025
Synchronize source files from linuxdeepin/qt5integration.

Source-pull-request: linuxdeepin/qt5integration#276
@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

关键摘要:

  • QtConcurrent::run调用中,result变量被声明为auto类型,但在函数末尾被Q_UNUSED(result)忽略,这可能是为了防止编译器警告,但应该确认是否有必要。
  • QSaveFilesetDirectWriteFallback(true)调用增加了缓存文件能被成功保存的概率,这是一个好的做法。

是否建议立即修改:

  • 是,应该确认result变量的使用是否必要,如果不需要,应该移除相关代码以避免混淆。

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy

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

@18202781743 18202781743 merged commit 11860ac into linuxdeepin:master Jul 28, 2025
21 of 22 checks passed
18202781743 pushed a commit to linuxdeepin/qt6integration that referenced this pull request Jul 28, 2025
Synchronize source files from linuxdeepin/qt5integration.

Source-pull-request: linuxdeepin/qt5integration#276
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