diff --git a/libsearch/aisearch/ai-search-plugin.cpp b/libsearch/aisearch/ai-search-plugin.cpp index 39b464a..26889a1 100644 --- a/libsearch/aisearch/ai-search-plugin.cpp +++ b/libsearch/aisearch/ai-search-plugin.cpp @@ -23,6 +23,7 @@ #include "file-utils.h" #include "thumbnail-creator.h" #include "file-indexer-config.h" +#include "data-collecter.h" #include #include #include @@ -107,6 +108,7 @@ void AiSearchPlugin::openAction(int actionkey, QString key, int type) //TODO add some return message here. switch (actionkey) { case 0: + DataCollecter::collectLaunchEvent(QStringLiteral("AISearch"), QStringLiteral("openFile")); if(FileUtils::openFile(key) == -1) { QMessageBox msgBox(m_detailPage); msgBox.setModal(true); @@ -117,9 +119,11 @@ void AiSearchPlugin::openAction(int actionkey, QString key, int type) } break; case 1: + DataCollecter::collectLaunchEvent(QStringLiteral("AISearch"), QStringLiteral("openFileInDir")); FileUtils::openFile(key, true); break; case 2: + DataCollecter::collectLaunchEvent(QStringLiteral("AISearch"), QStringLiteral("copyPath")); FileUtils::copyPath(key); default: break; @@ -237,6 +241,7 @@ void AiSearchPlugin::initDetailPage() m_detailLyt->addStretch(); connect(m_actionLabel1, &ActionLabel::actionTriggered, [ & ](){ + DataCollecter::collectLaunchEvent(QStringLiteral("AISearch"), QStringLiteral("openFile")); if(FileUtils::openFile(m_currentActionKey) == -1) { QMessageBox msgBox(m_detailPage); msgBox.setModal(true); @@ -247,9 +252,11 @@ void AiSearchPlugin::initDetailPage() } }); connect(m_actionLabel2, &ActionLabel::actionTriggered, [ & ](){ + DataCollecter::collectLaunchEvent(QStringLiteral("AISearch"), QStringLiteral("openFileInDir")); FileUtils::openFile(m_currentActionKey, true); }); connect(m_actionLabel3, &ActionLabel::actionTriggered, [ & ](){ + DataCollecter::collectLaunchEvent(QStringLiteral("AISearch"), QStringLiteral("copyPath")); FileUtils::copyPath(m_currentActionKey); }); }