summaryrefslogtreecommitdiff
authorsandman <sandman>2002-07-01 09:45:51 (UTC)
committer sandman <sandman>2002-07-01 09:45:51 (UTC)
commit346ea8fa0d904e940659bc35fad0fc0da8cc7f80 (patch) (side-by-side diff)
tree26e3865ba996ff5154132ed9020cab897cb9ad94
parent05d74acac3af056bfd784c6f2b7f72d313ea64bc (diff)
downloadopie-346ea8fa0d904e940659bc35fad0fc0da8cc7f80.zip
opie-346ea8fa0d904e940659bc35fad0fc0da8cc7f80.tar.gz
opie-346ea8fa0d904e940659bc35fad0fc0da8cc7f80.tar.bz2
Made loading of custom styles much faster, since symbols are now resolved
"on-the-fly" (This only makes it harder for new styles to be debugged)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 6e2db7c..dff8235 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1304,97 +1304,97 @@ void QPEApplication::internalSetStyle( const QString &style )
} else {
QStyle *s = QStyleFactory::create(style);
if ( s ) setStyle(s);
}
#else
if ( style == "Windows" ) {
setStyle( new QWindowsStyle );
} else if ( style == "QPE" ) {
setStyle( new QPEStyle );
} else if ( style == "Light" ) {
setStyle( new LightStyle );
}
#ifndef QT_NO_STYLE_PLATINUM
else if ( style == "Platinum" ) {
setStyle( new QPlatinumStyle );
}
#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 {
// style == "Liquid Style (libliquid.so)" (or "Windows XP (libxp.so)"
int p2 = style. findRev ( ']' );
int p1 = style. findRev ( '[' );
QString style2;
if (( p1 > 0 ) && ( p2 > 0 ) && (( p1 + 1 ) < p2 ))
style2 = "lib" + style. mid ( p1 + 1, p2 - p1 - 1 ). lower ( ) + ".so";
else
style2 = "lib" + style. lower ( ) + ".so";
// static QLibrary *currentlib = 0;
static void *currentlib = 0;
QString path = QPEApplication::qpeDir ( ) + "/plugins/styles/" + style2;
do { // try/catch simulation
// QLibrary *lib = new QLibrary ( path, QLibrary::Immediately );
- void *lib = ::dlopen ( path. local8Bit ( ), RTLD_NOW | RTLD_GLOBAL );
+ void *lib = ::dlopen ( path. local8Bit ( ), RTLD_LAZY | RTLD_GLOBAL );
if ( lib ) {
//QStyle * (*fpa) ( ) = (QStyle * (*) ( )) lib-> resolve ( "allocate" );
QStyle * (*fpa) ( ) = (QStyle * (*) ( )) ::dlsym ( lib, "allocate" );
if ( fpa ) {
QStyle *sty = ( *fpa ) ( );
if ( sty ) {
setStyle ( sty );
if ( currentlib ) {
//delete currentlib;
::dlclose ( currentlib );
}
currentlib = lib;
break;
}
}
//delete lib;
::dlclose ( lib );
}
} while ( false );
}
// 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" );
QPixmap pix;
pix.convertFromImage(img.smoothScale(1*img.width(), 1*img.height()));
QLabel *lblWait = new QLabel(0, "wait hack!", QWidget::WStyle_Customize |
QWidget::WStyle_NoBorder | QWidget::WStyle_Tool );
lblWait->setPixmap( pix );
lblWait->setAlignment( QWidget::AlignCenter );
lblWait->show();
lblWait->showMaximized();
}
#ifndef SINGLE_APP