/* * Copyright (C) 2020, KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * Authors: sunfengsheng * */ #ifndef APPMATCH_H #define APPMATCH_H #include #include #include #include #include #include #include #include #include "search-plugin-iface.h" #include "../appdata/app-info-table.h" namespace UkuiSearch { class AppMatch : public QThread { Q_OBJECT public: static AppMatch *getAppMatch(); void startMatchApp(QString input, size_t uniqueSymbol, DataQueue *searchResult); protected: void run() override; private: explicit AppMatch(QObject *parent = nullptr); ~AppMatch(); void getAllDesktopFilePath(QString path); void appNameMatch(QString keyWord, size_t uniqueSymbol, DataQueue *searchResult); void parseSoftWareCenterReturn(QList> list, size_t uniqueSymbol, DataQueue *searchResult); //void creatResultInfo(SearchPluginIface::ResultInfo &ri, QMapIterator &iter, bool isInstalled = true); QString m_sourceText; size_t m_uniqueSymbol; DataQueue *m_search_result = nullptr; QDBusInterface *m_interFace = nullptr; private Q_SLOTS: void slotDBusCallFinished(QString keyWord, size_t uniqueSymbol, DataQueue *searchResult); }; } #endif // APPMATCH_H