Skip to content

Commit 36d9123

Browse files
committed
feat: complete launchpad logging integration
Add optional dde-api detection and Debian build dependency updates, and finish launchpad-side logging support in the shared launcher controller. Keep the launchpad build configuration and packaging aligned with the new logging integration. Remove redundant EventLogger::init() call in LauncherController since the singleton is already initialized by dde-shell (launchpadcommon.so runs in the dde-shell process), and use find_path with NO_CACHE instead of manual cache clearing. feat: 完善启动器日志集成 增加可选 dde-api 检测与 Debian 构建依赖更新,并在共享启动器控制器中补全启动器侧日志支持。 同步更新启动器的构建配置与打包依赖,使新的日志集成能够正确构建和交付。 移除 LauncherController 中多余的 EventLogger::init() 调用,因为 单例已由 dde-shell 初始化(launchpadcommon.so 运行在 dde-shell 进程内),并使用 find_path 的 NO_CACHE 代替手动清除缓存。 PMS: TASK-388657
1 parent ca88a70 commit 36d9123

3 files changed

Lines changed: 38 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
1+
# SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
22
#
33
# SPDX-License-Identifier: CC0-1.0
44

@@ -31,6 +31,15 @@ if(Qt6_VERSION VERSION_GREATER_EQUAL 6.10)
3131
find_package(Qt6 COMPONENTS GuiPrivate REQUIRED)
3232
endif()
3333

34+
# Check if dde-api eventlogger.hpp exists
35+
find_path(DDE_API_EVENTLOGGER_INCLUDE_DIR NAMES dde-api/eventlogger.hpp NO_CACHE)
36+
if(DDE_API_EVENTLOGGER_INCLUDE_DIR)
37+
set(HAVE_DDE_API_EVENTLOGGER ON)
38+
message(STATUS "Found dde-api eventlogger.hpp: ${DDE_API_EVENTLOGGER_INCLUDE_DIR}")
39+
else()
40+
message(STATUS "dde-api eventlogger.hpp not found, event logging will be disabled")
41+
endif()
42+
3443
set_package_properties(${ASQT_NS} PROPERTIES
3544
DESCRIPTION "Library that lists Appstream resources"
3645
URL "https://www.freedesktop.org"
@@ -140,6 +149,10 @@ target_link_libraries(launchpadcommon PUBLIC
140149
treeland-integration
141150
)
142151

152+
if (HAVE_DDE_API_EVENTLOGGER)
153+
target_compile_definitions(launchpadcommon PRIVATE HAVE_DDE_API_EVENTLOGGER)
154+
endif()
155+
143156
install(TARGETS launchpadcommon DESTINATION ${CMAKE_INSTALL_LIBDIR})
144157
install(
145158
FILES dist/org.deepin.dde.shell.launchpad.appdata.xml

debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Build-Depends:
2424
# v-- provides DHiDPIHelper
2525
libdtk6gui-dev (>= 6.0.19),
2626
libdtk6declarative-dev (>> 6.7.33),
27+
dde-api-dev (>> 6.0.39),
2728
libdde-shell-dev (>= 0.0.10),
2829
libappstreamqt-dev (>= 1.0.0)
2930
Standards-Version: 4.6.0

launchercontroller.cpp

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

@@ -15,12 +15,29 @@
1515
#include <QDBusConnection>
1616
#include <QLoggingCategory>
1717

18+
#ifdef HAVE_DDE_API_EVENTLOGGER
19+
#include <dde-api/eventlogger.hpp>
20+
#endif
21+
1822
#include <private/qguiapplication_p.h>
1923

2024
DGUI_USE_NAMESPACE
2125

2226
namespace {
2327
Q_LOGGING_CATEGORY(logController, "org.deepin.dde.launchpad.controller")
28+
29+
constexpr qint64 EVENT_LOGGER_LAUNCHPAD_MODE = 1000610012;
30+
31+
void logLaunchpadMode(const QString &mode, const char *description)
32+
{
33+
#ifdef HAVE_DDE_API_EVENTLOGGER
34+
DDE_EventLogger::EventLogger::instance().writeEventLog(
35+
DDE_EventLogger::EventLoggerData(EVENT_LOGGER_LAUNCHPAD_MODE, QStringLiteral("launchpad_config"), {
36+
{QStringLiteral("launchpad_mode"), mode}
37+
}));
38+
#endif
39+
qCInfo(logController) << "EventLogger: launchpad mode" << description << ":" << mode;
40+
}
2441
}
2542

2643
LauncherController::LauncherController(QObject *parent)
@@ -39,6 +56,8 @@ LauncherController::LauncherController(QObject *parent)
3956
m_currentFrame = settings.value("current_frame", "WindowedFrame").toString();
4057
qCInfo(logController) << "Current frame mode:" << m_currentFrame;
4158

59+
logLaunchpadMode(m_currentFrame, "on startup");
60+
4261
// Interval set to 500=>1000ms for issue https://github.com/linuxdeepin/developer-center/issues/8137
4362
m_timer->setInterval(1000);
4463
m_timer->setSingleShot(true);
@@ -151,6 +170,9 @@ void LauncherController::setCurrentFrame(const QString &frame)
151170

152171
m_currentFrame = frame;
153172
qDebug() << "set current frame:" << m_currentFrame;
173+
174+
logLaunchpadMode(m_currentFrame, "changed to");
175+
154176
m_pendingHide = false;
155177
m_timer->start();
156178
emit currentFrameChanged();

0 commit comments

Comments
 (0)