Skip to content

Conversation

@xionglinlin
Copy link
Contributor

fix: refresh UI model after updating log info

  1. Added m_model->refreshUpdateUiModel() call after updating item info
    in UpdateLogHelper
  2. This ensures the UI model is refreshed when update log information is
    fetched successfully
  3. Fixes potential UI display issues where the model might not reflect
    the latest log data

Influence:

  1. Verify that the update log information is properly displayed in the
    UI after updates
  2. Test both successful update log retrieval scenarios
  3. Check that UI updates correctly when update status changes
  4. Ensure no regression in update log display functionality

fix: 更新日志信息后刷新UI模型

  1. 在UpdateLogHelper更新项目信息后添加m_model->refreshUpdateUiModel()
    调用
  2. 确保当更新日志信息成功获取时,UI模型能够及时刷新
  3. 修复模型可能无法反映最新日志数据的潜在UI显示问题

Influence:

  1. 验证更新后更新日志信息是否正确显示在UI中
  2. 测试成功获取更新日志的场景
  3. 检查更新状态变化时UI是否正确更新
  4. 确保更新日志显示功能没有回归问题

pms: Bug-345827

1. Moved battery capacity warning from updateTitle to updateTips
property
2. Now shows "Installation update failed" as the main title consistently
3. Battery warning appears only in the tips section when battery is
below 60%
4. Maintains same functionality but with improved UI clarity

Log: Fixed update failure page to show consistent failure title and
moved battery warning to tips section

Influence:
1. Test update failure scenario with battery below 60% - should show
failure title with battery warning in tips
2. Test update failure scenario with battery above 60% - should show
only failure title and standard tips
3. Verify the "Continue Update" button functionality remains unchanged
4. Check that the warning icon and log button still work correctly
5. Test UI layout to ensure tips section properly displays battery
warning

fix: 将电池电量警告从更新失败标题中分离

1. 将电池容量警告从 updateTitle 属性移动到 updateTips 属性
2. 现在始终显示"安装更新失败"作为主标题
3. 电池警告仅在电量低于60%时显示在提示部分
4. 保持相同功能但提高了UI清晰度

Log: 修复更新失败页面,显示一致的失败标题并将电池警告移至提示部分

Influence:
1. 测试电池电量低于60%时的更新失败场景 - 应显示失败标题并在提示中包含电
池警告
2. 测试电池电量高于60%时的更新失败场景 - 应仅显示失败标题和标准提示
3. 验证"继续更新"按钮功能保持不变
4. 检查警告图标和日志按钮是否仍正常工作
5. 测试UI布局以确保提示部分正确显示电池警告

pms: Bug-342839
1. Added m_model->refreshUpdateUiModel() call after updating item info
in UpdateLogHelper
2. This ensures the UI model is refreshed when update log information is
fetched successfully
3. Fixes potential UI display issues where the model might not reflect
the latest log data

Influence:
1. Verify that the update log information is properly displayed in the
UI after updates
2. Test both successful update log retrieval scenarios
3. Check that UI updates correctly when update status changes
4. Ensure no regression in update log display functionality

fix: 更新日志信息后刷新UI模型

1. 在UpdateLogHelper更新项目信息后添加m_model->refreshUpdateUiModel()
调用
2. 确保当更新日志信息成功获取时,UI模型能够及时刷新
3. 修复模型可能无法反映最新日志数据的潜在UI显示问题

Influence:
1. 验证更新后更新日志信息是否正确显示在UI中
2. 测试成功获取更新日志的场景
3. 检查更新状态变化时UI是否正确更新
4. 确保更新日志显示功能没有回归问题

pms: Bug-345827
@deepin-ci-robot
Copy link

deepin pr auto review

我来对这个diff进行详细审查:

  1. 代码逻辑审查:
  • 在updatework.cpp中,两处都增加了m_model->refreshUpdateUiModel()的调用,这个改动是合理的,因为在更新日志信息后需要刷新UI模型以保持数据同步。
  • 在updateMain.qml中,将电池电量低提示从updateTitle移到了updateTips中,这个改动使得UI显示更加合理,因为:
    • 标题应该保持简洁明了,直接显示"安装更新失败"
    • 详细的提示信息应该放在tips中,这样层次更清晰
  1. 代码质量改进建议:
  • 在updatework.cpp中,建议将重复的代码块提取成一个单独的函数,因为两处代码几乎完全相同:
void UpdateWorker::handleUpdateLog() {
    QMap<UpdateType, UpdateItemInfo> resultMap = UpdateLogHelper::ref().getUpdateLog();
    if (!resultMap.isEmpty()) {
        for (UpdateType type : resultMap.keys()) {
            UpdateLogHelper::ref().updateItemInfo(resultMap.value(type));
        }
        m_model->refreshUpdateUiModel();
    } else {
        qCWarning(logDccUpdatePlugin) << "Get update log failed";
    }
}
  1. 代码性能考虑:
  • 目前的实现中,refreshUpdateUiModel()可能会触发整个UI的重绘,建议确认是否可以优化为只更新变化的部分。
  1. 代码安全性:
  • 代码中没有明显的安全问题,但建议在getUpdateLog()updateItemInfo()调用时添加异常处理,以防数据损坏或意外情况。
  1. 其他建议:
  • 在updateMain.qml中,建议为电池电量提示添加一个单独的属性,这样更便于维护:
property string batteryWarning: qsTr("The battery capacity is lower than 60%. To get successful updates, please plug in.")

updateTips: {
    if (!dccData.model().batterIsOK) {
        return batteryWarning
    }
    return dccData.model().installFailedTips
}

这些改动总体上是积极的,提高了代码的可维护性和用户体验。建议在实施上述改进后进行充分测试,确保UI更新的正确性和性能。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@xionglinlin xionglinlin merged commit 99cddcf into linuxdeepin:master Dec 26, 2025
6 checks passed
@xionglinlin
Copy link
Contributor Author

integrate

@xionglinlin
Copy link
Contributor Author

/integrate

@github-actions
Copy link

AutoIntegrationPr Bot
auto integrate with pr url: deepin-community/Repository-Integration#3575
PrNumber: 3575
PrBranch: auto-integration-20515140136

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