From 5cc4c4b72ff8823e1c8745787e26e7266f45fa7e Mon Sep 17 00:00:00 2001 From: liudun Date: Fri, 26 Jan 2024 16:16:05 +0800 Subject: [PATCH] Remove depends for libkysdk-system --- debian/control | 1 - polkit-agent/CMakeLists.txt | 5 +++++ polkit-agent/src/PolkitListener.cpp | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index cb99e3e..cdfc268 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,6 @@ Build-Depends: cmake, debhelper-compat (= 13), libglib2.0-dev, libgsettings-qt-dev, - libkysdk-system-dev, libopencv-dev, libpam-dev, libpolkit-qt5-1-dev, diff --git a/polkit-agent/CMakeLists.txt b/polkit-agent/CMakeLists.txt index 473b7e4..388c12a 100644 --- a/polkit-agent/CMakeLists.txt +++ b/polkit-agent/CMakeLists.txt @@ -3,7 +3,12 @@ project(ukui-polkit-agent) pkg_check_modules(QGS REQUIRED gsettings-qt) #pkg_search_module(GSETTINGS_QT REQUIRED gsettings-qt) + pkg_check_modules(KDKINFO REQUIRED kysdk-sysinfo) +if (KDKINFO_FOUND) + add_definitions(-DKEKINFO_FOUND="true") +endif() + #pkg_search_module(KDKINFO REQUIRED kysdk-sysinfo) find_package(PolkitQt5-1 REQUIRED 0.103.0) diff --git a/polkit-agent/src/PolkitListener.cpp b/polkit-agent/src/PolkitListener.cpp index d2de14f..089589b 100644 --- a/polkit-agent/src/PolkitListener.cpp +++ b/polkit-agent/src/PolkitListener.cpp @@ -54,7 +54,11 @@ PolkitListener::~PolkitListener() bool PolkitListener::isMavis() { +#ifdef KDK_INFOFOUND char *prjName = kdk_system_get_projectName(); +#else + char *prjName; +#endif if (prjName) { QString strFeature = QString(prjName); free(prjName); @@ -70,7 +74,11 @@ bool PolkitListener::isMavis() bool PolkitListener::isSupportTableMode() { +#ifdef KDK_INFOFOUND unsigned int nFeature = kdk_system_get_productFeatures(); +#else + unsigned int nFeature; +#endif if (nFeature&0x02) { // 支持平板模式 return true; }