Skip to content

Commit 9bd6fa9

Browse files
chore: remove event logging for screenshot and recording actions
- Removed logging for various screenshot and recording events in MainWindow and RecordProcess classes to streamline functionality. - Updated event log utility definitions to exclude unused event types related to screenshots and recordings. Task: https://pms.uniontech.com/task-view-388229.html
1 parent 8eb791c commit 9bd6fa9

3 files changed

Lines changed: 15 additions & 32 deletions

File tree

src/main_window.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,8 +1527,6 @@ void MainWindow::initScreenRecorder()
15271527
void MainWindow::initScrollShot()
15281528
{
15291529
qCInfo(dsrApp) << __LINE__ << __FUNCTION__ << "正在初始化滚动截图...";
1530-
QJsonObject obj{{"tid", EventLogUtils::StartScrollShot}, {"version", QCoreApplication::applicationVersion()}};
1531-
EventLogUtils::get().writeLogs(obj);
15321530
m_zoomIndicator->hideMagnifier();
15331531

15341532
#ifdef OCR_SCROLL_FLAGE_ON
@@ -2252,8 +2250,6 @@ void MainWindow::topWindow()
22522250
return;
22532251
}
22542252

2255-
QJsonObject obj{{"tid", EventLogUtils::StartScreenShot}, {"version", QCoreApplication::applicationVersion()}};
2256-
EventLogUtils::get().writeLogs(obj);
22572253
int t_windowCount = DWindowManagerHelper::instance()->allWindowIdList().size();
22582254
DForeignWindow *prewindow = nullptr;
22592255
for (int i = t_windowCount - 1; i >= 0; i--) {
@@ -3734,8 +3730,6 @@ void MainWindow::changeShotToolEvent(const QString &func)
37343730
qCDebug(dsrApp) << "MainWindow::changeShotToolEvent >> func: " << func;
37353731
// 调用ocr功能时先截图后,退出截图录屏,将刚截图的图片串递到ocr识别界面;
37363732
if (func == "ocr") {
3737-
QJsonObject obj{{"tid", EventLogUtils::StartOcr}, {"version", QCoreApplication::applicationVersion()}};
3738-
EventLogUtils::get().writeLogs(obj);
37393733
// 调起OCR识别界面, 传入截图路径
37403734
m_ocrInterface = new OcrInterface("com.deepin.Ocr", "/com/deepin/Ocr", QDBusConnection::sessionBus(), this);
37413735
int delayTime = 0;
@@ -3757,6 +3751,13 @@ void MainWindow::changeShotToolEvent(const QString &func)
37573751
});
37583752
}
37593753
} else if (func == "pinScreenshots") {
3754+
{
3755+
QJsonObject obj{{"tid", EventLogUtils::Start},
3756+
{"version", QCoreApplication::applicationVersion()},
3757+
{"mode", 1},
3758+
{"startup_mode", "B8"}};
3759+
EventLogUtils::get().writeLogs(obj);
3760+
}
37603761
m_functionType = status::pinscreenshots;
37613762
m_pinInterface = new PinScreenShotsInterface(
37623763
"com.deepin.PinScreenShots", "/com/deepin/PinScreenShots", QDBusConnection::sessionBus(), this);
@@ -3780,6 +3781,13 @@ void MainWindow::changeShotToolEvent(const QString &func)
37803781
} else if (func == "record" || func == "shot") {
37813782
changeFunctionButton(func);
37823783
} else {
3784+
if (func == QStringLiteral("aiassistant")) {
3785+
QJsonObject obj{{"tid", EventLogUtils::Start},
3786+
{"version", QCoreApplication::applicationVersion()},
3787+
{"mode", 1},
3788+
{"startup_mode", "B9"}};
3789+
EventLogUtils::get().writeLogs(obj);
3790+
}
37833791
m_currentToolShape = func;
37843792
// if (!m_sideBar->isVisible()) {
37853793
updateSideBarPos();
@@ -3805,9 +3813,6 @@ void MainWindow::prepareScreenshot()
38053813
{
38063814
qCInfo(dsrApp) << __FUNCTION__ << __LINE__ << "正在准备截图...";
38073815
// 双击截图保存按钮会触发重复进入
3808-
QJsonObject obj{{"tid", EventLogUtils::StartScreenShot}, {"version", QCoreApplication::applicationVersion()}};
3809-
if (m_functionType == status::shot)
3810-
EventLogUtils::get().writeLogs(obj);
38113816
static bool isSaving = false;
38123817
if (isSaving)
38133818
return;
@@ -4046,9 +4051,6 @@ void MainWindow::saveScreenShot()
40464051
{
40474052
qCInfo(dsrApp) << __FUNCTION__ << __LINE__ << "正在执行截图保存流程...";
40484053
// 双击截图保存按钮会触发重复进入
4049-
QJsonObject obj{{"tid", EventLogUtils::StartScreenShot}, {"version", QCoreApplication::applicationVersion()}};
4050-
if (m_functionType == status::shot)
4051-
EventLogUtils::get().writeLogs(obj);
40524054
static bool isSaving = false;
40534055
if (isSaving)
40544056
return;
@@ -7012,8 +7014,6 @@ void MainWindow::addCursorToImage()
70127014
void MainWindow::shotFullScreen(bool isFull)
70137015
{
70147016
qCInfo(dsrApp) << __FUNCTION__ << __LINE__ << "正在截取全屏...";
7015-
QJsonObject obj{{"tid", EventLogUtils::StartScreenShot}, {"version", QCoreApplication::applicationVersion()}};
7016-
EventLogUtils::get().writeLogs(obj);
70177017
QRect target = m_backgroundRect;
70187018
qCDebug(dsrApp) << "m_backgroundRect" << m_backgroundRect;
70197019
if (Utils::isWaylandMode) {

src/record_process.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "utils.h"
99
#include "utils/audioutils.h"
1010
#include "gstrecord/gstinterface.h"
11-
#include "utils/eventlogutils.h"
1211
#include "utils/log.h"
1312
#ifdef KF5_WAYLAND_FLAGE_ON
1413
#include "waylandrecord/avlibinterface.h"
@@ -825,12 +824,6 @@ void RecordProcess::startRecord()
825824
}
826825
}
827826

828-
QJsonObject obj{
829-
{"tid", EventLogUtils::StartRecording},
830-
{"version", QCoreApplication::applicationVersion()},
831-
{"type", m_recordType == Utils::kGIF ? "gif" : (m_recordType == Utils::kMKV ? "mkv" : "mp4")}
832-
};
833-
EventLogUtils::get().writeLogs(obj);
834827
if (Utils::isSysHighVersion1040() == false) {
835828
qCInfo(dsrApp) << "系统版本小于1040, 不显示录制时长功能。";
836829
return;
@@ -876,12 +869,6 @@ void RecordProcess::setFullScreenRecord(bool flag)
876869

877870
void RecordProcess::stopRecord()
878871
{
879-
// QJsonObject obj{
880-
// {"tid", EventLogUtils::EndRecording},
881-
// {"version", QCoreApplication::applicationVersion()},
882-
// {"type", m_recordType == Utils::kGIF ? "gif" : (m_recordType == Utils::kMKV ? "mkv" : "mp4")}
883-
// };
884-
// EventLogUtils::get().writeLogs(obj);
885872
if (Utils::isSysHighVersion1040() == true) {
886873
qCInfo(dsrApp) << __FUNCTION__ << __LINE__ << "正在暂停录屏计时...";
887874
qCDebug(dsrApp) << "Pause the screen recording timer!";

src/utils/eventlogutils.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2022-2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -15,10 +15,6 @@ class EventLogUtils
1515
OpeningTime = 1000000000,
1616
ClosingTime = 1000000001,
1717
Start = 1000200000,
18-
StartRecording = 1000200001,
19-
StartScreenShot = 1000200002,
20-
StartOcr = 1000200003,
21-
StartScrollShot = 1000200004,
2218
EndRecording = 1000200005,
2319
EndScreenShot = 1000200006
2420
};

0 commit comments

Comments
 (0)