diff --git a/libsearch/websearch/web-search-plugin.cpp b/libsearch/websearch/web-search-plugin.cpp index 64f1718..d210790 100644 --- a/libsearch/websearch/web-search-plugin.cpp +++ b/libsearch/websearch/web-search-plugin.cpp @@ -1,5 +1,8 @@ #include "web-search-plugin.h" #include "global-settings.h" +#define WEB_ENGINE_KEY "webEngine" +#define BROWSERTYPE "x-scheme-handler/http" +#define DESKTOPPATH "/usr/share/applications/" using namespace UkuiSearch; WebSearchPlugin::WebSearchPlugin(QObject *parent) : QObject(parent) @@ -30,9 +33,22 @@ void UkuiSearch::WebSearchPlugin::KeywordSearch(QString keyword, DataQueueenqueue(resultInfo); + g_object_unref(textinfo); } void WebSearchPlugin::stopSearch() @@ -112,3 +128,16 @@ void UkuiSearch::WebSearchPlugin::initDetailPage() openAction(0, m_currentActionKey, 0); }); } + +QString WebSearchPlugin::getDefaultAppId(const char *contentType) +{ + GAppInfo * app = g_app_info_get_default_for_type(contentType, false); + if(app != NULL){ + const char * id = g_app_info_get_id(app); + QString strId(id); + g_object_unref(app); + return strId; + } else { + return QString(""); + } +} diff --git a/libsearch/websearch/web-search-plugin.h b/libsearch/websearch/web-search-plugin.h index 5790411..87d2414 100644 --- a/libsearch/websearch/web-search-plugin.h +++ b/libsearch/websearch/web-search-plugin.h @@ -12,8 +12,10 @@ #include #include "action-label.h" #include "search-plugin-iface.h" +#include namespace UkuiSearch { + class LIBSEARCH_EXPORT WebSearchPlugin : public QObject, public SearchPluginIface { Q_OBJECT @@ -48,6 +50,8 @@ private: bool m_enable = true; QList m_actionInfo; + + QString getDefaultAppId(const char * contentType); }; } #endif // WEBSEARCHPLUGIN_H