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 debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Build-Depends:
qt6-wayland-dev,
qt6-wayland-private-dev,
libdtkcommon-dev,
libdtk6core-dev,
libdtk6core-dev (>= 6.0.43),
# v-- provides qdbusxml2cpp-fix binary
libdtk6core-bin,
# v-- provides DHiDPIHelper
Expand Down
2 changes: 1 addition & 1 deletion src/models/searchfilterproxymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int SearchFilterProxyModel::calculateWeight(const QModelIndex &modelIndex) const
const QString & vendor = modelIndex.data(AppItem::VendorRole).toString();
const QString & genericName = modelIndex.data(AppItem::GenericNameRole).toString();
const QString & transliterated = modelIndex.data(AppsModel::AllTransliteratedRole).toString();
const QString & jianpin = Dtk::Core::firstLetters(displayName).join(',');
const QString & jianpin = Dtk::Core::firstLetters(displayName, TS_NoneTone).join(',');

//包名搜索使用
const QString & desktopId = modelIndex.data(AppItem::DesktopIdRole).toString();
Expand Down
6 changes: 6 additions & 0 deletions tests/searchfilterproxymodeltest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ void TestSearchFilterProxyModel::setupTestData()
testItems.append(createTestAppItem("org.deepin.music", "音乐", "音乐播放器", "音乐", "deepin", 12));
testItems.append(createTestAppItem("org.deepin.reader", "阅读器", "文档阅读器", "阅读", "deepin", 7));
testItems.append(createTestAppItem("org.deepin.calendar", "日历", "日历", "日历", "deepin", 4));
testItems.append(createTestAppItem("org.deepin.defender", "安全中心", "安全中心", "安全中心", "deepin", 4));

// 包含特殊符号的应用
testItems.append(createTestAppItem("org.special.app1", "App@Name", "App@Name", "", "special", 1));
Expand Down Expand Up @@ -213,6 +214,11 @@ void TestSearchFilterProxyModel::testPinyinSearch()
qCDebug(logTest) << "Pinyin initials search for 'rl' returned" << model.rowCount() << "items";
QCOMPARE(model.rowCount(), 1);
QCOMPARE(model.data(model.index(0, 0), AppItem::DesktopIdRole).toString(), "org.deepin.calendar");
qCDebug(logTest) << "Testing Pinyin initials match for 'aqzx'";
model.setFilterRegularExpression(QRegularExpression("aqzx"));
qCDebug(logTest) << "Pinyin initials search for 'aqzx' returned" << model.rowCount() << "items";
QCOMPARE(model.rowCount(), 1);
QCOMPARE(model.data(model.index(0, 0), AppItem::DesktopIdRole).toString(), "org.deepin.defender");
qCInfo(logTest) << "Pinyin search tests completed successfully";
}

Expand Down