Updated to use new standalone tdehw library.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/8/head
Slávek Banko 4 years ago
parent 804f6a4d46
commit 69e6b34bab
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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 )

@ -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 <kdemacros.h>
#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 )

@ -14,6 +14,7 @@
#cmakedefine HAVE_MUSICBRAINZ
#cmakedefine WITH_ARTS
#cmakedefine HAVE_TDEHWLIB
#cmakedefine HAVE_HAL
#cmakedefine K3B_FFMPEG_ALL_CODECS

@ -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}
)

@ -629,7 +629,7 @@ void K3bDevice::HalConnection::ModifyDeviceHandler(TDEGenericDevice* hwdevice)
#else // HAVE_HAL
#ifdef __TDE_HAVE_TDEHWLIB
#ifdef HAVE_TDEHWLIB
#include <tdehardwaredevices.h>
#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;
}

@ -30,7 +30,7 @@
#ifdef HAVE_HAL
class DBusConnection;
#endif
#ifdef __TDE_HAVE_TDEHWLIB
#ifdef HAVE_TDEHWLIB
class TDEGenericDevice;
#else
#define TDEGenericDevice void

Loading…
Cancel
Save