Commit 6b9f4c1b authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Track connections in KActivitiesStats

Enables us to offer quick access to frequently used
remote desktop sessions from various places
parent 194d0c55
Pipeline #207515 passed with stage
in 51 seconds
......@@ -40,6 +40,16 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
I18n
)
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS Activities)
set_package_properties(KF5Activities PROPERTIES DESCRIPTION "KActivities libraries"
URL "https://www.kde.org"
TYPE OPTIONAL
PURPOSE "For tracking which remote desktops are frequently accessed"
)
if (KF5Activities_FOUND)
set(HAVE_KACTIVITIES TRUE)
endif()
find_package(KF5DocTools)
# use sane compile flags
......@@ -114,6 +124,8 @@ add_executable(krdc)
target_compile_definitions(krdc PRIVATE -DBUILD_ZEROCONF)
configure_file(config-kactivities.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kactivities.h)
target_sources(krdc PRIVATE
config/hostpreferenceslist.cpp
config/preferencesdialog.cpp
......@@ -157,6 +169,10 @@ target_link_libraries(krdc
krdccore
)
if (KF5Activities_FOUND)
target_link_libraries(krdc KF5::Activities)
endif()
install(TARGETS krdc ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.kde.krdc.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.krdc.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
......
/*
SPDX-FileCopyrightText: 2022 Kai Uwe Broulik <kde@broulik.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#cmakedefine01 HAVE_KACTIVITIES
......@@ -6,6 +6,8 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config-kactivities.h"
#include "mainwindow.h"
#include "krdc_debug.h"
#include "settings.h"
......@@ -31,6 +33,10 @@
#include <KToggleFullScreenAction>
#include <KToolBar>
#if HAVE_KACTIVITIES
#include <KActivities/ResourceInstance>
#endif
#include <QClipboard>
#include <QDockWidget>
#include <QFontMetrics>
......@@ -304,6 +310,10 @@ void MainWindow::newConnection(const QUrl &newUrl, bool switchFullscreenWhenConn
view->start();
setFactor(view->hostPreferences()->scaleFactor());
#if HAVE_KACTIVITIES
KActivities::ResourceInstance::notifyAccessed(url, QGuiApplication::desktopFileName());
#endif
Q_EMIT factorUpdated(view->hostPreferences()->scaleFactor());
Q_EMIT scaleUpdated(scale_state);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment