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
13 changes: 4 additions & 9 deletions service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ set(APP_DCONFIG_SCHEMA "${APP_DCONFIG_DIR}/com.deepin.diskmanager.storage.json")

# Find the library
find_package(PkgConfig REQUIRED)
find_package(DtkCore)
if(DtkCore_FOUND)
get_target_property(DTKCORE_INCLUDE_DIRS Dtk::Core INTERFACE_INCLUDE_DIRECTORIES)
find_path(DCONFIG_HEADER_PATH NAMES DConfig PATHS ${DTKCORE_INCLUDE_DIRS})
if(DCONFIG_HEADER_PATH)
add_definitions(-DHAVE_DCONFIG)
endif()
endif()
find_package(DtkCore REQUIRED)
find_package(DtkGui REQUIRED)
find_package(Qt5 COMPONENTS
Core
Expand Down Expand Up @@ -89,5 +82,7 @@ install(PROGRAMS ${APP_USBADD_FILES} DESTINATION libexec/openconnect/)
install(PROGRAMS ${APP_USBREMOVE_FILES} DESTINATION libexec/openconnect/)
install(FILES ${APP_UDEV_FILES} DESTINATION /lib/udev/rules.d/)
install(FILES ${APP_POLICY_FILES} DESTINATION share/polkit-1/actions)
install(FILES ${APP_DCONFIG_SCHEMA} DESTINATION share/dsg/configs/com.deepin.diskmanager/)
if(DEFINED DSG_DATA_DIR)
install(FILES ${APP_DCONFIG_SCHEMA} DESTINATION share/dsg/configs/com.deepin.diskmanager/)
endif()
install(PROGRAMS ${APP_DEEPIN_DISKMANAGER_SERVICE_BIN} DESTINATION bin/)
5 changes: 3 additions & 2 deletions service/diskoperation/DeviceStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
#include "DeviceStorage.h"
#include <QDebug>
#include <QFile>
#include <QRegularExpression>

Check warning on line 8 in service/diskoperation/DeviceStorage.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

Check warning on line 9 in service/diskoperation/DeviceStorage.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

Check warning on line 10 in service/diskoperation/DeviceStorage.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QVariant> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#ifdef HAVE_DCONFIG
#include <dtkcore_config.h>

Check warning on line 11 in service/diskoperation/DeviceStorage.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <dtkcore_config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#ifdef DTKCORE_CLASS_DConfigFile
#include <DConfig>

Check warning on line 13 in service/diskoperation/DeviceStorage.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DConfig> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#endif
#include "utils.h"

Check warning on line 15 in service/diskoperation/DeviceStorage.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "utils.h" not found.

namespace DiskManager {

Expand Down Expand Up @@ -594,7 +595,7 @@
static QStringList ufsSpecVersions()
{
const QStringList fallback{"300", "310", "400", "410"};
#ifdef HAVE_DCONFIG
#ifdef DTKCORE_CLASS_DConfigFile
QScopedPointer<Dtk::Core::DConfig> cfg(
Dtk::Core::DConfig::create("com.deepin.diskmanager", "com.deepin.diskmanager.storage"));
if (cfg && cfg->isValid()) {
Expand Down
9 changes: 1 addition & 8 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ LIST(APPEND SRC_LIST ${UT_DISKOPERATION})
file(GLOB ALL_HEADERS "../service/diskoperation/*.h" "../service/diskoperation/filesystems/*.h")
file(GLOB ALL_SOURCES "../service/diskoperation/*.cpp" "../service/diskoperation/filesystems/*.cpp")

find_package(DtkCore)
if(DtkCore_FOUND)
get_target_property(DTKCORE_INCLUDE_DIRS Dtk::Core INTERFACE_INCLUDE_DIRECTORIES)
find_path(DCONFIG_HEADER_PATH NAMES DConfig PATHS ${DTKCORE_INCLUDE_DIRS})
if(DCONFIG_HEADER_PATH)
add_definitions(-DHAVE_DCONFIG)
endif()
endif()
find_package(DtkCore REQUIRED)

add_executable(${PROJECT_NAME_TEST} ${SRC_LIST} ${ALL_HEADERS} ${ALL_SOURCES})

Expand Down
Loading