feat: always show all quick panel plugins#1658
Conversation
Remove filtering logic in QuickPanelProxyModel that was hiding plugins not in the m_quickPlugins list. This change reverts to showing all available quick plugins unconditionally, ensuring no plugins are inadvertently excluded from the panel. Influence: 1. Verify all quick panel plugins are visible in the tray area 2. Ensure no plugins are missing or incorrectly filtered out 3. Test with various plugin configurations to confirm consistent display feat: 始终显示所有快捷面板插件 移除 QuickPanelProxyModel 中的过滤逻辑,该逻辑会隐藏不在 m_quickPlugins 列表中的插件。此修改恢复无条件显示所有可用快捷插件,确保没有插件被意外排 除在面板之外。 Influence: 1. 验证所有快捷面板插件在托盘区域均可见 2. 确保没有插件被遗漏或错误过滤 3. 使用不同插件配置进行测试,确认显示一致性
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR removes the quick panel plugin whitelisting filter in QuickPanelProxyModel so that all plugins from the source model are always shown in the tray quick panel, regardless of m_quickPlugins content. Sequence diagram for updated quick panel plugin filteringsequenceDiagram
participant SourceModel
participant QuickPanelProxyModel
participant TrayQuickPanelView
TrayQuickPanelView->>QuickPanelProxyModel: filterAcceptsRow(sourceRow, sourceParent)
QuickPanelProxyModel->>SourceModel: index(sourceRow, 0, sourceParent)
SourceModel-->>QuickPanelProxyModel: QModelIndex
alt index is invalid
QuickPanelProxyModel-->>TrayQuickPanelView: return false
else index is valid
QuickPanelProxyModel-->>TrayQuickPanelView: return true
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- With
filterAcceptsRownow always returning true, consider whether this proxy model still needs to override it at all, or if the class can rely on the base implementation instead. - Now that filtering logic is removed, review whether
m_quickPluginsandupdateQuickPlugins()(and any related state) are still needed, and clean up any dead code or unused members to keep the model focused on its current behavior.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- With `filterAcceptsRow` now always returning true, consider whether this proxy model still needs to override it at all, or if the class can rely on the base implementation instead.
- Now that filtering logic is removed, review whether `m_quickPlugins` and `updateQuickPlugins()` (and any related state) are still needed, and clean up any dead code or unused members to keep the model focused on its current behavior.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review★ 总体评分:65分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 diff --git a/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp b/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp
index 67fb874fd..4ad8ef62b 100644
--- a/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp
+++ b/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp
@@ -118,7 +118,10 @@ bool QuickPanelProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &so
const auto index = this->sourceModel()->index(sourceRow, 0, sourceParent);
if (!index.isValid())
return false;
- return true;
+ if (m_quickPlugins.isEmpty())
+ return true;
+ const auto &id = surfacePluginId(index);
+ return m_quickPlugins.contains(id);
}
void QuickPanelProxyModel::updateQuickPlugins() |
|
@18202781743: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
有过滤功能,它还是个白名单 |
Remove filtering logic in QuickPanelProxyModel that was hiding plugins
not in the
m_quickPlugins list. This change reverts to showing all available quick
plugins
unconditionally, ensuring no plugins are inadvertently excluded from
the panel.
Influence:
feat: 始终显示所有快捷面板插件
移除 QuickPanelProxyModel 中的过滤逻辑,该逻辑会隐藏不在 m_quickPlugins
列表中的插件。此修改恢复无条件显示所有可用快捷插件,确保没有插件被意外排
除在面板之外。
Influence:
Summary by Sourcery
Enhancements: