Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
# SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: CC0-1.0

Expand Down Expand Up @@ -31,6 +31,15 @@ if(Qt6_VERSION VERSION_GREATER_EQUAL 6.10)
find_package(Qt6 COMPONENTS GuiPrivate REQUIRED)
endif()

# Check if dde-api provides EventLogger (header-only)
find_package(DDEAPI QUIET)
if(DDEAPI_FOUND)
set(HAVE_DDE_API_EVENTLOGGER ON)
message(STATUS "Found DDEAPI: EventLogger available")
else()
message(STATUS "DDEAPI not found, event logging will be disabled")
endif()

set_package_properties(${ASQT_NS} PROPERTIES
DESCRIPTION "Library that lists Appstream resources"
URL "https://www.freedesktop.org"
Expand Down Expand Up @@ -140,6 +149,11 @@ target_link_libraries(launchpadcommon PUBLIC
treeland-integration
)

if (HAVE_DDE_API_EVENTLOGGER)
target_compile_definitions(launchpadcommon PRIVATE HAVE_DDE_API_EVENTLOGGER)
target_link_libraries(launchpadcommon PRIVATE DDEAPI::EventLogger)
endif()

install(TARGETS launchpadcommon DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(
FILES dist/org.deepin.dde.shell.launchpad.appdata.xml
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Build-Depends:
# v-- provides DHiDPIHelper
libdtk6gui-dev (>= 6.0.19),
libdtk6declarative-dev (>> 6.7.33),
dde-api-dev (>> 6.0.39),
libdde-shell-dev (>= 0.0.10),
libappstreamqt-dev (>= 1.0.0)
Standards-Version: 4.6.0
Expand Down
24 changes: 23 additions & 1 deletion launchercontroller.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -12,15 +12,32 @@
#include <QCommandLineParser>
#include <launcher1adaptor.h>
#include <QDBusMessage>
#include <QDBusConnection>

Check warning on line 15 in launchercontroller.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDBusConnection> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QLoggingCategory>

Check warning on line 16 in launchercontroller.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QLoggingCategory> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#ifdef HAVE_DDE_API_EVENTLOGGER
#include <dde-api/eventlogger.hpp>

Check warning on line 19 in launchercontroller.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <dde-api/eventlogger.hpp> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#endif

#include <private/qguiapplication_p.h>

Check warning on line 22 in launchercontroller.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <private/qguiapplication_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

DGUI_USE_NAMESPACE

namespace {
Q_LOGGING_CATEGORY(logController, "org.deepin.dde.launchpad.controller")

constexpr qint64 EVENT_LOGGER_LAUNCHPAD_MODE = 1000610012;

void logLaunchpadMode(const QString &mode, const char *description)
{
#ifdef HAVE_DDE_API_EVENTLOGGER
DDE_EventLogger::EventLogger::instance().writeEventLog(
DDE_EventLogger::EventLoggerData(EVENT_LOGGER_LAUNCHPAD_MODE, QStringLiteral("launchpad_config"), {
{QStringLiteral("launchpad_mode"), mode}
}));
#endif
qCInfo(logController) << "EventLogger: launchpad mode" << description << ":" << mode;
}
}

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

logLaunchpadMode(m_currentFrame, "on startup");

// Interval set to 500=>1000ms for issue https://github.com/linuxdeepin/developer-center/issues/8137
m_timer->setInterval(1000);
m_timer->setSingleShot(true);
Expand Down Expand Up @@ -151,6 +170,9 @@

m_currentFrame = frame;
qDebug() << "set current frame:" << m_currentFrame;

logLaunchpadMode(m_currentFrame, "changed to");

m_pendingHide = false;
m_timer->start();
emit currentFrameChanged();
Expand Down
Loading