Merge branch '0615-newfrontend' into 'new-frontend'

Add double click function;

See merge request kylin-desktop/ukui-search!77
This commit is contained in:
PengfeiZhang 2021-08-06 02:13:18 +00:00
commit 6715853c22
2 changed files with 20 additions and 19 deletions

View File

@ -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="<<e;
// }
QString plugin_id = m_model->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="<<e;
}
}
/**

View File

@ -146,11 +146,11 @@ void ResultView::onRowDoubleClickedSlot(const QModelIndex &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;
// }
if (!info.actionKey.isEmpty()) {
plugin->openAction(0, info.actionKey, info.type);
} else {
throw -2;
}
} else {
throw -1;
}