feat: display all update log details in update list#222
feat: display all update log details in update list#222xionglinlin wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
1. Added getDetailInfos method to UpdateListModel to retrieve detailed update information for each item 2. Modified UpdateLogHelper to include all system update logs in detail info instead of filtering out professional edition versions 3. Updated UpdateList.qml UI to display detailed update logs with version-specific information and release times 4. Removed redundant version label and improved layout spacing for better readability 5. Each update item now shows multiple detailed entries with their own info and release time Log: Update list now displays detailed version history for each update item Influence: 1. Test that update list displays detailed version information for system updates 2. Verify that all historical update logs are shown for each update item 3. Check that links within update descriptions are clickable and open correctly 4. Test UI layout with different theme types (light/dark) 5. Verify that professional edition versions are no longer filtered out from details 6. Test with multiple update items to ensure proper rendering of detailed information feat: 在更新列表中显示所有更新日志详情 1. 在UpdateListModel中添加getDetailInfos方法,用于获取每个更新项的详细更 新信息 2. 修改UpdateLogHelper,将所有系统更新日志包含在详细信息中,不再过滤专业 版版本 3. 更新UpdateList.qml界面,显示详细的更新日志,包含特定版本的信息和发布 时间 4. 移除了冗余的版本标签,改进了布局间距以提高可读性 5. 每个更新项现在显示多个详细条目,每个条目都有自己的信息和发布时间 Log: 更新列表现在显示每个更新项的详细版本历史记录 Influence: 1. 测试更新列表是否显示系统更新的详细版本信息 2. 验证每个更新项是否显示所有历史更新日志 3. 检查更新描述中的链接是否可点击并能正确打开 4. 测试不同主题类型(浅色/深色)下的UI布局 5. 确认专业版版本不再从详细信息中被过滤掉 6. 测试多个更新项以确保详细信息正确渲染
deepin pr auto review代码审查报告我对提供的 Git diff 进行了仔细审查,以下是关于语法逻辑、代码质量、代码性能和代码安全的改进意见: 1. 语法逻辑方面UpdateListModel::getDetailInfos
UpdateLogHelper::handleSystemItemInfo
UpdateList.qml
2. 代码质量方面UpdateListModel::getDetailInfos
UpdateLogHelper::handleSystemItemInfo
UpdateList.qml
3. 代码性能方面UpdateListModel::getDetailInfos
UpdateList.qml
4. 代码安全方面UpdateListModel::getDetailInfos
UpdateList.qml
5. 其他建议
6. 代码改进建议以下是针对 QVariantList UpdateListModel::getDetailInfos(int index) const
{
QVariantList result;
// 边界检查
if (index < 0 || index >= m_updateLists.count()) {
qCWarning(logDccUpdatePlugin) << "Invalid index for getDetailInfos:" << index;
return result;
}
// 获取详细信息并转换为 QVariantList
const auto& detailInfos = m_updateLists[index]->detailInfos();
result.reserve(detailInfos.size()); // 预分配空间以提高性能
for (const auto& detail : detailInfos) {
QVariantMap map;
map["name"] = detail.name;
map["updateTime"] = detail.updateTime;
map["info"] = detail.info;
map["link"] = detail.link;
map["vulLevel"] = detail.vulLevel;
result.append(map);
}
return result;
}对于 QML 部分,可以考虑以下改进: // 详情列表
Repeater {
model: repeater.model.getDetailInfos(index)
ColumnLayout {
Layout.fillWidth: true
spacing: 4 // 添加适当的间距
D.Label {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
Layout.bottomMargin: -12
font: D.DTK.fontManager.t8
visible: modelData.info !== ""
text: modelData.info
wrapMode: Text.WordWrap
color: D.DTK.themeType == D.ApplicationHelper.LightType ?
Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1)
onLinkActivated: (link)=> {
// 添加链接验证
if (isValidUrl(link)) {
dccData.work().openUrl(link)
} else {
console.warn("Invalid link:", link)
}
}
}
D.Label {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
visible: modelData.updateTime !== ""
font: D.DTK.fontManager.t8
color: D.DTK.themeType == D.ApplicationHelper.LightType ?
Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1)
text: qsTr("Release time:") + modelData.updateTime
wrapMode: Text.WordWrap
}
}
}这些改进可以提高代码的可读性、性能和安全性,同时保持原有功能。 |
|
TAG Bot New tag: 1.0.41 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, xionglinlin The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
TAG Bot New tag: 1.0.42 |
|
TAG Bot New tag: 1.0.43 |
Log: Update list now displays detailed version history for each update item
Influence:
feat: 在更新列表中显示所有更新日志详情
Log: 更新列表现在显示每个更新项的详细版本历史记录
Influence: