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){
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 :"<<m_returnResult1;
return m_returnResult;
}
//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 :"<<m_returnResult1;
// 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(" ","");
m_sourceText=input;
m_softWareCenterMap.clear();

View File

@ -35,8 +35,8 @@ class AppMatch : public QObject
public:
explicit AppMatch(QObject *parent = nullptr);
~AppMatch();
QStringList startMatchApp(QString input);
QMap<QString,QList<QString>> startMatchApp(QString input,int i);
// QStringList startMatchApp(QString input);
QMap<QString,QList<QString>> 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<QString,QList<QString>> m_softWareCenterMap;
QMap<QString,QList<QString>> m_installAppMap;
QMap<QString,QList<QString>> m_filterInstallAppMap;