From c303c7bbe5b72ea7c355cfb1b1ce73d7be1786f2 Mon Sep 17 00:00:00 2001 From: jixiaoxu Date: Fri, 6 Aug 2021 10:04:36 +0800 Subject: [PATCH] Add double click function; --- frontend/view/best-list-view.cpp | 29 +++++++++++++++-------------- frontend/view/result-view.cpp | 10 +++++----- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/frontend/view/best-list-view.cpp b/frontend/view/best-list-view.cpp index 7b65a53..f169dff 100644 --- a/frontend/view/best-list-view.cpp +++ b/frontend/view/best-list-view.cpp @@ -55,20 +55,21 @@ void BestListView::clearSelectedRow() void BestListView::onRowDoubleClickedSlot(const QModelIndex &index) { const SearchPluginIface::ResultInfo &info = m_model->getInfo(index); -// SearchPluginIface *plugin = SearchPluginManager::getInstance()->getPlugin(m_plugin_id); -// try { -// if (plugin) { -//// if (!info.actionList.isEmpty()) { -//// plugin->openAction(info.actionList.at(0), info.key); -//// } else { -//// throw -2; -//// } -// } else { -// throw -1; -// } -// } catch(int e) { -// qWarning()<<"Open failed, reason="<getPluginInfo(index);; + SearchPluginIface *plugin = SearchPluginManager::getInstance()->getPlugin(plugin_id); + try { + if (plugin) { + if (!info.actionKey.isEmpty()) { + plugin->openAction(0, info.actionKey, info.type); + } else { + throw -2; + } + } else { + throw -1; + } + } catch(int e) { + qWarning()<<"Open failed, reason="<getPlugin(m_plugin_id); try { if (plugin) { -// if (!info.actionList.isEmpty()) { -// plugin->openAction(info.actionList.at(0), info.key); -// } else { -// throw -2; -// } + if (!info.actionKey.isEmpty()) { + plugin->openAction(0, info.actionKey, info.type); + } else { + throw -2; + } } else { throw -1; }