Modify app-match API

This commit is contained in:
zhangjiaping 2021-03-01 13:28:18 +08:00
parent 06420dccad
commit 71225ce64e
2 changed files with 27 additions and 21 deletions

View File

@ -43,25 +43,31 @@ AppMatch::~AppMatch(){
} }
} }
QStringList AppMatch::startMatchApp(QString input){ //QStringList AppMatch::startMatchApp(QString input){
input.replace(" ",""); // input.replace(" ","");
m_sourceText=input; // m_sourceText=input;
m_softWareCenterMap.clear(); // m_softWareCenterMap.clear();
m_matchInstallAppMap.clear(); // m_matchInstallAppMap.clear();
m_returnResult1.clear(); // m_returnResult1.clear();
if(input.isEmpty()){ // if(input.isEmpty()){
return m_returnResult; // return m_returnResult;
} // }
softWareCenterSearch(); // softWareCenterSearch();
getAppName(); // getAppName();
returnAppMap(); // returnAppMap();
m_returnResult1=m_midResult; // m_returnResult1=m_midResult;
m_midResult.clear(); // m_midResult.clear();
qWarning()<<"m_returnResult :"<<m_returnResult1; // qWarning()<<"m_returnResult :"<<m_returnResult1;
return m_returnResult; // return m_returnResult;
} //}
QMap<QString,QList<QString>> AppMatch::startMatchApp(QString input,int i){ /**
* @brief AppMatch::startMatchApp
* @param input
* @param i
* @return QMap<QString,QList<QString>> QMap<{.desktop(),()}>
*/
QMap<QString,QList<QString>> AppMatch::startMatchApp(QString input){
input.replace(" ",""); input.replace(" ","");
m_sourceText=input; m_sourceText=input;
m_softWareCenterMap.clear(); m_softWareCenterMap.clear();

View File

@ -35,8 +35,8 @@ class AppMatch : public QObject
public: public:
explicit AppMatch(QObject *parent = nullptr); explicit AppMatch(QObject *parent = nullptr);
~AppMatch(); ~AppMatch();
QStringList startMatchApp(QString input); // QStringList startMatchApp(QString input);
QMap<QString,QList<QString>> startMatchApp(QString input,int i); QMap<QString,QList<QString>> startMatchApp(QString input);
private: private:
void getAllDesktopFilePath(QString path); void getAllDesktopFilePath(QString path);
@ -54,7 +54,7 @@ private:
QStringList m_filePathList; QStringList m_filePathList;
QStringList m_returnResult; QStringList m_returnResult;
QDBusInterface *m_interFace=nullptr; QDBusInterface *m_interFace;
QMap<QString,QList<QString>> m_softWareCenterMap; QMap<QString,QList<QString>> m_softWareCenterMap;
QMap<QString,QList<QString>> m_installAppMap; QMap<QString,QList<QString>> m_installAppMap;
QMap<QString,QList<QString>> m_filterInstallAppMap; QMap<QString,QList<QString>> m_filterInstallAppMap;