fix(view): initialize deferred all-items grid state#466
Conversation
396a78f to
f3358d9
Compare
Initialize the grid mapping when its source model is attached. 在源模型绑定时初始化缩略图网格映射。 Log: 修复全部合集首屏状态和右键交互 Influence: 全部合集首屏日期、比例按钮、缩略图选中和右键菜单
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // src/src/thumbnailview/thumbnailmodel.cpp
void ThumbnailModel::setSourceModel(QAbstractItemModel *sourceModel)
{
QSortFilterProxyModel::setSourceModel(sourceModel);
// 假设连接仍然需要保留以应对后续的模型重置
connect(sourceModel, SIGNAL(modelReset()), this, SIGNAL(srcModelReseted()));
// 若 sourceModel 在设置时已经处于 reset 状态且不会主动发出信号,则保留手动触发;
// 否则建议添加条件判断或移除,避免重复触发。
// 此处保留原样,但建议在 code review 时与原作者确认其必要性。
Q_EMIT srcModelReseted();
if (!m_sortRoleName.isEmpty()) {
setSortRoleName(m_sortRoleName);
}
} |
|
[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 |
Initialize the grid mapping when its source model is attached.
在源模型绑定时初始化缩略图网格映射。
Log: 修复全部合集首屏状态和右键交互
Influence: 全部合集首屏日期、比例按钮、缩略图选中和右键菜单