fix(data-collect):补充AI搜索的数据埋点.

This commit is contained in:
JunjieBai 2024-04-28 17:26:57 +08:00 committed by iaom
parent bbd70d7508
commit 769919d746
1 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,7 @@
#include "file-utils.h"
#include "thumbnail-creator.h"
#include "file-indexer-config.h"
#include "data-collecter.h"
#include <unistd.h>
#include <QMessageBox>
#include <QJsonObject>
@ -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);
});
}