author | sandman <sandman> | 2002-06-21 01:23:55 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-06-21 01:23:55 (UTC) |
commit | 3f1129f79e945135828191679559da70cf4ac6fa (patch) (unidiff) | |
tree | ac5a2e4698a93a201c6bdb5bcf377e1e429c32ed | |
parent | 2a7407325b1607c9ee40ed3558c8549672a36ad4 (diff) | |
download | opie-3f1129f79e945135828191679559da70cf4ac6fa.zip opie-3f1129f79e945135828191679559da70cf4ac6fa.tar.gz opie-3f1129f79e945135828191679559da70cf4ac6fa.tar.bz2 |
Added a hack to support on-demand loading of liquid style with Qt2
Will be removed, once we switch to Qt3
-rw-r--r-- | library/qpeapplication.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index f84bc0e..1534b0b 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -90,6 +90,7 @@ | |||
90 | #endif | 90 | #endif |
91 | #include <stdlib.h> | 91 | #include <stdlib.h> |
92 | 92 | ||
93 | #include <dlfcn.h> // for Liquid HACK | ||
93 | 94 | ||
94 | class QPEApplicationData { | 95 | class QPEApplicationData { |
95 | public: | 96 | public: |
@@ -1314,6 +1315,27 @@ void QPEApplication::internalSetStyle( const QString &style ) | |||
1314 | setStyle( new QMotifPlusStyle ); | 1315 | setStyle( new QMotifPlusStyle ); |
1315 | } | 1316 | } |
1316 | #endif | 1317 | #endif |
1318 | |||
1319 | // HACK for Qt2 only | ||
1320 | else if ( style == "Liquid" ) { | ||
1321 | static void *lib = 0; | ||
1322 | QStyle *sty = 0; | ||
1323 | |||
1324 | |||
1325 | if ( !lib ) { | ||
1326 | QString path = QPEApplication::qpeDir() + "/plugins/styles/" + "libliquid.so"; | ||
1327 | lib = ::dlopen ( path. local8Bit ( ), RTLD_NOW | RTLD_GLOBAL ); | ||
1328 | } | ||
1329 | if ( lib ) { | ||
1330 | void *sym = ::dlsym ( lib, "allocate" ); | ||
1331 | |||
1332 | if ( sym ) | ||
1333 | sty = ((QStyle * (*) ( )) sym ) ( ); | ||
1334 | } | ||
1335 | if ( sty ) | ||
1336 | setStyle ( sty ); | ||
1337 | } | ||
1338 | // HACK for Qt2 only | ||
1317 | #endif | 1339 | #endif |
1318 | } | 1340 | } |
1319 | 1341 | ||