diff --git a/libsearch/appsearch/app-match.cpp b/libsearch/appsearch/app-match.cpp index 91ca946..27eb2ff 100644 --- a/libsearch/appsearch/app-match.cpp +++ b/libsearch/appsearch/app-match.cpp @@ -43,25 +43,31 @@ AppMatch::~AppMatch(){ } } -QStringList AppMatch::startMatchApp(QString input){ - input.replace(" ",""); - m_sourceText=input; - m_softWareCenterMap.clear(); - m_matchInstallAppMap.clear(); - m_returnResult1.clear(); - if(input.isEmpty()){ - return m_returnResult; - } - softWareCenterSearch(); - getAppName(); - returnAppMap(); - m_returnResult1=m_midResult; - m_midResult.clear(); - qWarning()<<"m_returnResult :"<> AppMatch::startMatchApp(QString input,int i){ +/** + * @brief AppMatch::startMatchApp 查询应用,含所有已安装与未安装 + * @param input 关键词 + * @param i + * @return QMap> QMap<应用名,{.desktop(未安装为空),图标(安装的是名字,未安装是路径)}> + */ +QMap> AppMatch::startMatchApp(QString input){ input.replace(" ",""); m_sourceText=input; m_softWareCenterMap.clear(); diff --git a/libsearch/appsearch/app-match.h b/libsearch/appsearch/app-match.h index 44d4ec2..03f933c 100644 --- a/libsearch/appsearch/app-match.h +++ b/libsearch/appsearch/app-match.h @@ -35,8 +35,8 @@ class AppMatch : public QObject public: explicit AppMatch(QObject *parent = nullptr); ~AppMatch(); - QStringList startMatchApp(QString input); - QMap> startMatchApp(QString input,int i); +// QStringList startMatchApp(QString input); + QMap> startMatchApp(QString input); private: void getAllDesktopFilePath(QString path); @@ -54,7 +54,7 @@ private: QStringList m_filePathList; QStringList m_returnResult; - QDBusInterface *m_interFace=nullptr; + QDBusInterface *m_interFace; QMap> m_softWareCenterMap; QMap> m_installAppMap; QMap> m_filterInstallAppMap;