summaryrefslogtreecommitdiffstats
path: root/tdecore/kinstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdecore/kinstance.cpp')
-rw-r--r--tdecore/kinstance.cpp42
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