diff --git a/libsearch/plugininterface/search-plugin-iface.h b/libsearch/plugininterface/search-plugin-iface.h index a2cb769..4b1345a 100644 --- a/libsearch/plugininterface/search-plugin-iface.h +++ b/libsearch/plugininterface/search-plugin-iface.h @@ -24,12 +24,13 @@ public: QIcon icon; QString name; QVector description; - QMap actionMap;//action name and action key + QStringList actionList; //all actions, take fist for double click action. + QString key; }; virtual ~SearchPluginIface() {} virtual QString getPluginName() = 0; virtual void KeywordSearch(QString keyword,QQueue *searchResult) = 0; - virtual void openAction(QString name, QString key) = 0; + virtual void openAction(QString action, QString key) = 0; }; } diff --git a/src/content-widget.cpp b/src/content-widget.cpp index 7d7103d..e289b41 100644 --- a/src/content-widget.cpp +++ b/src/content-widget.cpp @@ -91,6 +91,7 @@ void ContentWidget::initUI() { clearLayout(m_homePageLyt); initHomePage(); }); + connect(m_detailView, &SearchDetailView::actionTriggerd, this, &ContentWidget::effectiveSearch); m_resultDetailArea->setWidget(m_detailView); m_resultDetailArea->setWidgetResizable(true); m_resultListArea->setFrameShape(QFrame::NoFrame); @@ -283,7 +284,7 @@ void ContentWidget::setupConnect(SearchListView * listview) { connect(listview, &SearchListView::currentSelectPos, [ = ](QPoint pos) { m_resultListArea->ensureVisible(pos.x(), pos.y()); }); - connect(listview, &SearchListView::mousePressed, this, &ContentWidget::mousePressed); + connect(listview, &SearchListView::mousePressed, this, &ContentWidget::effectiveSearch); connect(listview, &SearchListView::currentRowChanged, this, &ContentWidget::onListViewRowChanged); connect(listview, &SearchListView::onRowDoubleClicked, this, &ContentWidget::onListViewRowDoubleClicked); } diff --git a/src/content-widget.h b/src/content-widget.h index 5f5132b..d57e956 100644 --- a/src/content-widget.h +++ b/src/content-widget.h @@ -109,7 +109,7 @@ private: Q_SIGNALS: void currentItemChanged(); - void mousePressed(); + void effectiveSearch(); private Q_SLOTS: void clearLayout(QLayout *); diff --git a/src/control/search-detail-view.cpp b/src/control/search-detail-view.cpp index cd0d551..291547f 100644 --- a/src/control/search-detail-view.cpp +++ b/src/control/search-detail-view.cpp @@ -406,6 +406,7 @@ void SearchDetailView::execActions(const int& type, const int& option, const QSt default: break; } + Q_EMIT this->actionTriggerd(); } /** diff --git a/src/control/search-detail-view.h b/src/control/search-detail-view.h index a06cf87..0d5770a 100644 --- a/src/control/search-detail-view.h +++ b/src/control/search-detail-view.h @@ -105,6 +105,7 @@ private: Q_SIGNALS: void configFileChanged(); + void actionTriggerd(); private Q_SLOTS: void execActions(const int&, const int&, const QString&); void refreshIcon(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3d15fb2..305366a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -253,7 +253,7 @@ void MainWindow::initUi() { mainlayout->addWidget(m_titleFrame); mainlayout->addWidget(m_contentFrame); mainlayout->addWidget(m_searchWidget); - connect(m_contentFrame, &ContentWidget::mousePressed, m_searchLayout, &SearchBarHLayout::effectiveSearchRecord); + connect(m_contentFrame, &ContentWidget::effectiveSearch, m_searchLayout, &SearchBarHLayout::effectiveSearchRecord); connect(QApplication::primaryScreen(), &QScreen::geometryChanged, this, &MainWindow::monitorResolutionChange);