Add double click function;

This commit is contained in:
jixiaoxu 2021-08-06 10:04:36 +08:00
parent d76302d0ee
commit c303c7bbe5
2 changed files with 20 additions and 19 deletions

View File

@ -55,20 +55,21 @@ void BestListView::clearSelectedRow()
void BestListView::onRowDoubleClickedSlot(const QModelIndex &index) void BestListView::onRowDoubleClickedSlot(const QModelIndex &index)
{ {
const SearchPluginIface::ResultInfo &info = m_model->getInfo(index); const SearchPluginIface::ResultInfo &info = m_model->getInfo(index);
// SearchPluginIface *plugin = SearchPluginManager::getInstance()->getPlugin(m_plugin_id); QString plugin_id = m_model->getPluginInfo(index);;
// try { SearchPluginIface *plugin = SearchPluginManager::getInstance()->getPlugin(plugin_id);
// if (plugin) { try {
//// if (!info.actionList.isEmpty()) { if (plugin) {
//// plugin->openAction(info.actionList.at(0), info.key); if (!info.actionKey.isEmpty()) {
//// } else { plugin->openAction(0, info.actionKey, info.type);
//// throw -2; } else {
//// } throw -2;
// } else { }
// throw -1; } else {
// } throw -1;
// } catch(int e) { }
// qWarning()<<"Open failed, reason="<<e; } catch(int e) {
// } qWarning()<<"Open failed, reason="<<e;
}
} }
/** /**

View File

@ -146,11 +146,11 @@ void ResultView::onRowDoubleClickedSlot(const QModelIndex &index)
SearchPluginIface *plugin = SearchPluginManager::getInstance()->getPlugin(m_plugin_id); SearchPluginIface *plugin = SearchPluginManager::getInstance()->getPlugin(m_plugin_id);
try { try {
if (plugin) { if (plugin) {
// if (!info.actionList.isEmpty()) { if (!info.actionKey.isEmpty()) {
// plugin->openAction(info.actionList.at(0), info.key); plugin->openAction(0, info.actionKey, info.type);
// } else { } else {
// throw -2; throw -2;
// } }
} else { } else {
throw -1; throw -1;
} }