Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/models/org.deepin.ds.launchpad.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"description": "Whether to allow the search for Desktop ID during the search.",
"description[zh_CN]": "在搜索时候是否允许搜索Desktop ID。",
"permissions": "readwrite",
"visibility": "private"
"visibility": "public"
}
}
}
9 changes: 4 additions & 5 deletions src/models/searchfilterproxymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,10 @@ int SearchFilterProxyModel::calculateWeight(const QModelIndex &modelIndex) const
}));

// 包名搜索(仅在配置启用时生效)
if (m_searchPackageEnabled) {
matchTypes.push_back(qMakePair(QString("desktopId"), [&]() -> bool {
return desktopIdLower.contains(searchPatternLower);
}));
}
matchTypes.push_back(qMakePair(QString("desktopId"), [&]() -> bool {
if (!m_searchPackageEnabled) return false;
return desktopIdLower.contains(searchPatternLower);
}));

// 计算匹配索引(索引越小优先级越高)
auto it = std::find_if(matchTypes.begin(), matchTypes.end(),
Expand Down