From aee4394e2535c6a4242c78a28be97748407b4e00 Mon Sep 17 00:00:00 2001 From: zhangjiaping Date: Mon, 22 Mar 2021 11:42:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A7=A3=E5=86=B3=E5=A4=9A=E9=9F=B3?= =?UTF-8?q?=E5=AD=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libsearch/appsearch/app-match.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/libsearch/appsearch/app-match.cpp b/libsearch/appsearch/app-match.cpp index c099ae8..2e541c1 100644 --- a/libsearch/appsearch/app-match.cpp +++ b/libsearch/appsearch/app-match.cpp @@ -256,6 +256,8 @@ void AppMatch::getAppName(QMap &installed) void AppMatch::appNameMatch(QString appname,QMap &installed){ NameString name{appname}; QStringList list; + QStringList pinyinlist; + pinyinlist=FileUtils::findMultiToneWords(appname); QMapIterator iter(m_installAppMap); while(iter.hasNext()) { @@ -270,18 +272,21 @@ void AppMatch::appNameMatch(QString appname,QMap &instal installed.insert(name,list); return; } - QString shouzimu=FileUtils::findMultiToneWords(appname).at(1);// 中文转首字母 - if(shouzimu.contains(m_sourceText,Qt::CaseInsensitive)){ -// installed.insert(name,m_installAppMap.value(name)); - installed.insert(name,list); - return; - } - if(m_sourceText.size()<2) - return; - QString pinyin=FileUtils::findMultiToneWords(appname).at(0);// 中文转拼音 - if(pinyin.contains(m_sourceText,Qt::CaseInsensitive)){ -// installed.insert(name,m_installAppMap.value(name)); - installed.insert(name,list); + for(int i;i