diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2021-05-07 03:36:45 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-05-07 03:36:45 +0200 |
commit | c7b651a6ca408afe6dbf22e782fa1b3bca8468d0 (patch) | |
tree | b82b2222f7b154fe15054e224c4f942c2e1efea2 /tdecore/kinstance.cpp | |
parent | 44ad33926031a2aae1c515488fc2eded94fd6c8f (diff) | |
download | tdelibs-c7b651a6ca408afe6dbf22e782fa1b3bca8468d0.tar.gz tdelibs-c7b651a6ca408afe6dbf22e782fa1b3bca8468d0.zip |
Build tdehw library as a standalone library.
This causes tdecore API change!
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdecore/kinstance.cpp')
-rw-r--r-- | tdecore/kinstance.cpp | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/tdecore/kinstance.cpp b/tdecore/kinstance.cpp index cbdf86783..8ae747948 100644 --- a/tdecore/kinstance.cpp +++ b/tdecore/kinstance.cpp @@ -25,6 +25,8 @@ #include "kcharsets.h" #include "kiconloader.h" #ifdef __TDE_HAVE_TDEHWLIB +#include "klibloader.h" +#include "tdeversion.h" #include "tdehardwaredevices.h" #include "tdenetworkconnections.h" #endif @@ -285,22 +287,42 @@ TDEIconLoader *TDEInstance::iconLoader() const #ifdef __TDE_HAVE_TDEHWLIB TDEHardwareDevices *TDEInstance::hardwareDevices() const { - DEBUG_CHECK_ALIVE - if( _hardwaredevices == 0 ) { - _hardwaredevices = new TDEHardwareDevices( ); - } + DEBUG_CHECK_ALIVE + if (_hardwaredevices == 0) + { + TQString libName = TQString("libtdehw.so.%1").arg(TDE_VERSION_MAJOR); + KLibrary *lib = KLibLoader::self()->library(libName.latin1()); + if (lib) + { + TDEHardwareDevices* (*create)() = (TDEHardwareDevices* (*)())lib->symbol("create_tdeHardwareDevices"); + if (create) + { + _hardwaredevices = create(); + } + } + } - return _hardwaredevices; + return _hardwaredevices; } TDEGlobalNetworkManager *TDEInstance::networkManager() const { - DEBUG_CHECK_ALIVE - if( _networkmanager == 0 ) { - _networkmanager = new TDEGlobalNetworkManager( ); - } + DEBUG_CHECK_ALIVE + if (_networkmanager == 0) + { + TQString libName = TQString("libtdehw.so.%1").arg(TDE_VERSION_MAJOR); + KLibrary *lib = KLibLoader::self()->library(libName.latin1()); + if (lib) + { + TDEGlobalNetworkManager* (*create)() = (TDEGlobalNetworkManager* (*)())lib->symbol("create_tdeGlobalNetworkManager"); + if (create) + { + _networkmanager = create(); + } + } + } - return _networkmanager; + return _networkmanager; } #endif |