-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 @@ -81,24 +81,25 @@ #include <sys/file.h> #include <sys/ioctl.h> #include <sys/soundcard.h> // for setBacklight() #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) #include <linux/fb.h> #include <sys/types.h> #include <sys/stat.h> #endif #include <stdlib.h> +#include <dlfcn.h> // for Liquid HACK class QPEApplicationData { public: QPEApplicationData() : presstimer(0), presswidget(0), rightpressed(FALSE), kbgrabber(0), kbregrab(FALSE), notbusysent(FALSE), preloaded(FALSE), forceshow(FALSE), nomaximize(FALSE), qpe_main_widget(0), keep_running(TRUE) { qcopq.setAutoDelete(TRUE); } int presstimer; @@ -1305,24 +1306,45 @@ void QPEApplication::internalSetStyle( const QString &style ) } #endif #ifndef QT_NO_STYLE_MOTIF else if ( style == "Motif" ) { setStyle( new QMotifStyle ); } #endif #ifndef QT_NO_STYLE_MOTIFPLUS else if ( style == "MotifPlus" ) { setStyle( new QMotifPlusStyle ); } #endif + + // HACK for Qt2 only + else if ( style == "Liquid" ) { + static void *lib = 0; + QStyle *sty = 0; + + + if ( !lib ) { + QString path = QPEApplication::qpeDir() + "/plugins/styles/" + "libliquid.so"; + lib = ::dlopen ( path. local8Bit ( ), RTLD_NOW | RTLD_GLOBAL ); + } + if ( lib ) { + void *sym = ::dlsym ( lib, "allocate" ); + + if ( sym ) + sty = ((QStyle * (*) ( )) sym ) ( ); + } + if ( sty ) + setStyle ( sty ); + } + // HACK for Qt2 only #endif } /*! \internal */ void QPEApplication::prepareForTermination(bool willrestart) { if ( willrestart ) { // Draw a big wait icon, the image can be altered in later revisions // QWidget *d = QApplication::desktop(); QImage img = Resource::loadImage( "launcher/new_wait" ); |