fix(view): defer all-items grid initialization#465
Conversation
Reuse the all-items model for the title and defer grid initialization. 复用全部合集模型计算标题,并在首帧后创建缩略图网格。 Log: 优化全部合集首屏标题与缩略图加载时序 Influence: 全部合集首屏日期、缩略图显示和启动阶段导入刷新
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // src/src/thumbnailview/thumbnailmodel.cpp
QHash<int, QByteArray> ThumbnailModel::roleNames() const
{
qDebug() << "ThumbnailModel::roleNames - Entry";
QHash<int, QByteArray> hash;
if (auto *model = sourceModel()) {
hash = model->roleNames();
} else {
qWarning() << "ThumbnailModel::roleNames - sourceModel() is null, returning base roles only.";
}
hash.insert(Roles::BlankRole, "blank");
hash.insert(Roles::SelectedRole, "selected");
hash.insert(Roles::Thumbnail, "thumbnail");
return hash;
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pengfeixx, wyu71 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 |
Reuse the all-items model for the title and defer grid initialization.
复用全部合集模型计算标题,并在首帧后创建缩略图网格。
Log: 优化全部合集首屏标题与缩略图加载时序
Influence: 全部合集首屏日期、缩略图显示和启动阶段导入刷新