From 69e6b34bab6fe9cf118d50a7aecc8eda9239f8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 7 May 2021 16:23:04 +0200 Subject: [PATCH] Updated to use new standalone tdehw library. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- CMakeLists.txt | 1 + ConfigureChecks.cmake | 20 ++++++++++++++++++++ config.h.cmake | 1 + libk3bdevice/CMakeLists.txt | 2 +- libk3bdevice/k3bhalconnection.cpp | 20 ++++++++++---------- libk3bdevice/k3bhalconnection.h | 2 +- 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dbeeb9..b24a524 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,7 @@ option( WITH_LIBDVDREAD "Enable support for libdvdread" ${WITH_ALL_OPTIONS option( WITH_MUSICBRAINZ "Enable Musicbrainz support" OFF ) option( WITH_SYSTEM_LIBSAMPLERATE "Use system libsamplerate instead of bundled one" ON ) +option( WITH_TDEHWLIB "Enable TDE hardware library support" ${WITH_ALL_OPTIONS} ) option( WITH_HAL "Enable hal support" OFF ) option( WITH_DEBUG "Enable extra debug" OFF ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index b3f7522..8ae2dad 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -100,6 +100,26 @@ if ( WITH_SYSTEM_LIBSAMPLERATE ) endif ( ) +##### tdehwlib ################################## + +if( WITH_TDEHWLIB ) + tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${TDE_INCLUDE_DIR}" ) + check_cxx_source_compiles( " + #include + #ifndef __TDE_HAVE_TDEHWLIB + #error tdecore is not build with tdehwlib + #endif + int main() { return 0; } " + HAVE_TDEHWLIB + ) + tde_restore( CMAKE_REQUIRED_INCLUDES ) + if( NOT HAVE_TDEHWLIB ) + tde_message_fatal( "tdehwlib is required, but not built in tdecore" ) + endif( NOT HAVE_TDEHWLIB ) + set( TDEHW_LIBRARIES "tdehw-shared" ) +endif( ) + + ##### hal ####################################### if( WITH_HAL ) diff --git a/config.h.cmake b/config.h.cmake index 5d10ff6..3f16a20 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -14,6 +14,7 @@ #cmakedefine HAVE_MUSICBRAINZ #cmakedefine WITH_ARTS +#cmakedefine HAVE_TDEHWLIB #cmakedefine HAVE_HAL #cmakedefine K3B_FFMPEG_ALL_CODECS diff --git a/libk3bdevice/CMakeLists.txt b/libk3bdevice/CMakeLists.txt index 90c13ed..bc1bfd8 100644 --- a/libk3bdevice/CMakeLists.txt +++ b/libk3bdevice/CMakeLists.txt @@ -31,7 +31,7 @@ tde_add_library( k3bdevice SHARED AUTOMOC k3bdeviceglobals.cpp k3bcrc.cpp k3bcdtext.cpp k3bhalconnection.cpp k3bdebug.cpp VERSION 5.0.0 - LINK tdecore-shared ${HAL_LIBRARIES} ${DBUS_TQT_LIBRARIES} + LINK tdecore-shared ${TDEHW_LIBRARIES} ${HAL_LIBRARIES} ${DBUS_TQT_LIBRARIES} DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/libk3bdevice/k3bhalconnection.cpp b/libk3bdevice/k3bhalconnection.cpp index 9111469..c102c50 100644 --- a/libk3bdevice/k3bhalconnection.cpp +++ b/libk3bdevice/k3bhalconnection.cpp @@ -629,7 +629,7 @@ void K3bDevice::HalConnection::ModifyDeviceHandler(TDEGenericDevice* hwdevice) #else // HAVE_HAL -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB #include #else #define TDEHardwareDevices void @@ -694,7 +694,7 @@ bool K3bDevice::HalConnection::isConnected() const bool K3bDevice::HalConnection::open() { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB // Initialize the TDE device manager d->m_hwdevices = TDEGlobal::hardwareDevices(); @@ -734,7 +734,7 @@ TQStringList K3bDevice::HalConnection::devices() const void K3bDevice::HalConnection::AddDeviceHandler(TDEGenericDevice* hwdevice) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB if (hwdevice->type() != TDEGenericDeviceType::Disk) { return; } @@ -760,7 +760,7 @@ void K3bDevice::HalConnection::AddDeviceHandler(TDEGenericDevice* hwdevice) void K3bDevice::HalConnection::RemoveDeviceHandler(TDEGenericDevice* hwdevice) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB if (hwdevice->type() != TDEGenericDeviceType::Disk) { return; } @@ -784,7 +784,7 @@ void K3bDevice::HalConnection::RemoveDeviceHandler(TDEGenericDevice* hwdevice) void K3bDevice::HalConnection::ModifyDeviceHandler(TDEGenericDevice* hwdevice) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB if (hwdevice->type() != TDEGenericDeviceType::Disk) { return; } @@ -801,7 +801,7 @@ void K3bDevice::HalConnection::ModifyDeviceHandler(TDEGenericDevice* hwdevice) int K3bDevice::HalConnection::lock(Device* dev) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB if (!d->deviceUdiMap.contains(dev->blockDeviceName())) { return org_freedesktop_Hal_Device_Volume_NoSuchDevice; } @@ -830,7 +830,7 @@ int K3bDevice::HalConnection::lock(Device* dev) int K3bDevice::HalConnection::unlock(Device* dev) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB if (!d->deviceUdiMap.contains(dev->blockDeviceName())) { return org_freedesktop_Hal_Device_Volume_NoSuchDevice; } @@ -862,7 +862,7 @@ int K3bDevice::HalConnection::mount( K3bDevice::Device* dev, const TQString& fstype, const TQStringList& options ) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB if (!d->deviceUdiMap.contains(dev->blockDeviceName())) { return org_freedesktop_Hal_Device_Volume_NoSuchDevice; } @@ -896,7 +896,7 @@ int K3bDevice::HalConnection::mount( K3bDevice::Device* dev, int K3bDevice::HalConnection::unmount(K3bDevice::Device* dev, const TQStringList& options) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB if (!d->deviceUdiMap.contains(dev->blockDeviceName())) { return org_freedesktop_Hal_Device_Volume_NoSuchDevice; } @@ -931,7 +931,7 @@ int K3bDevice::HalConnection::unmount(K3bDevice::Device* dev, const TQStringList int K3bDevice::HalConnection::eject(K3bDevice::Device* dev, const TQStringList& options) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB if (!d->deviceUdiMap.contains(dev->blockDeviceName())) { return org_freedesktop_Hal_Device_Volume_NoSuchDevice; } diff --git a/libk3bdevice/k3bhalconnection.h b/libk3bdevice/k3bhalconnection.h index 351a1ca..c780f81 100644 --- a/libk3bdevice/k3bhalconnection.h +++ b/libk3bdevice/k3bhalconnection.h @@ -30,7 +30,7 @@ #ifdef HAVE_HAL class DBusConnection; #endif -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef HAVE_TDEHWLIB class TDEGenericDevice; #else #define TDEGenericDevice void