-rw-r--r-- | library/qpeapplication.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 533d7bd..e92b4dd 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -1198,57 +1198,62 @@ void QPEApplication::internalSetStyle( const QString &style ) | |||
1198 | else if ( style == "QPE" ) { | 1198 | else if ( style == "QPE" ) { |
1199 | setStyle( new QPEStyle ); | 1199 | setStyle( new QPEStyle ); |
1200 | } | 1200 | } |
1201 | else if ( style == "Light" ) { | 1201 | else if ( style == "Light" ) { |
1202 | setStyle( new LightStyle ); | 1202 | setStyle( new LightStyle ); |
1203 | } | 1203 | } |
1204 | #ifndef QT_NO_STYLE_PLATINUM | 1204 | #ifndef QT_NO_STYLE_PLATINUM |
1205 | else if ( style == "Platinum" ) { | 1205 | else if ( style == "Platinum" ) { |
1206 | setStyle( new QPlatinumStyle ); | 1206 | setStyle( new QPlatinumStyle ); |
1207 | } | 1207 | } |
1208 | #endif | 1208 | #endif |
1209 | #ifndef QT_NO_STYLE_MOTIF | 1209 | #ifndef QT_NO_STYLE_MOTIF |
1210 | else if ( style == "Motif" ) { | 1210 | else if ( style == "Motif" ) { |
1211 | setStyle( new QMotifStyle ); | 1211 | setStyle( new QMotifStyle ); |
1212 | } | 1212 | } |
1213 | #endif | 1213 | #endif |
1214 | #ifndef QT_NO_STYLE_MOTIFPLUS | 1214 | #ifndef QT_NO_STYLE_MOTIFPLUS |
1215 | else if ( style == "MotifPlus" ) { | 1215 | else if ( style == "MotifPlus" ) { |
1216 | setStyle( new QMotifPlusStyle ); | 1216 | setStyle( new QMotifPlusStyle ); |
1217 | } | 1217 | } |
1218 | #endif | 1218 | #endif |
1219 | 1219 | ||
1220 | else { | 1220 | else { |
1221 | QStyle *sty = 0; | 1221 | QStyle *sty = 0; |
1222 | QString path = QPEApplication::qpeDir ( ) + "/plugins/styles/lib" + style. lower ( ) + ".so"; | 1222 | QString path = QPEApplication::qpeDir ( ) + "/plugins/styles/"; |
1223 | |||
1224 | if ( style. find ( ".so" ) > 0 ) | ||
1225 | path += style; | ||
1226 | else | ||
1227 | path = path + "lib" + style. lower ( ) + ".so"; // compatibility | ||
1223 | 1228 | ||
1224 | static QLibrary *lastlib = 0; | 1229 | static QLibrary *lastlib = 0; |
1225 | static StyleInterface *lastiface = 0; | 1230 | static StyleInterface *lastiface = 0; |
1226 | 1231 | ||
1227 | QLibrary *lib = new QLibrary ( path ); | 1232 | QLibrary *lib = new QLibrary ( path ); |
1228 | StyleInterface *iface = 0; | 1233 | StyleInterface *iface = 0; |
1229 | 1234 | ||
1230 | if ( lib-> queryInterface ( IID_Style, ( QUnknownInterface ** ) &iface ) == QS_OK ) | 1235 | if (( lib-> queryInterface ( IID_Style, ( QUnknownInterface ** ) &iface ) == QS_OK ) && iface ) |
1231 | sty = iface-> create ( ); | 1236 | sty = iface-> create ( ); |
1232 | 1237 | ||
1233 | if ( sty ) { | 1238 | if ( sty ) { |
1234 | setStyle ( sty ); | 1239 | setStyle ( sty ); |
1235 | 1240 | ||
1236 | if ( lastiface ) | 1241 | if ( lastiface ) |
1237 | lastiface-> release ( ); | 1242 | lastiface-> release ( ); |
1238 | lastiface = iface; | 1243 | lastiface = iface; |
1239 | 1244 | ||
1240 | if ( lastlib ) { | 1245 | if ( lastlib ) { |
1241 | lastlib-> unload ( ); | 1246 | lastlib-> unload ( ); |
1242 | delete lastlib; | 1247 | delete lastlib; |
1243 | } | 1248 | } |
1244 | lastlib = lib; | 1249 | lastlib = lib; |
1245 | } | 1250 | } |
1246 | else { | 1251 | else { |
1247 | if ( iface ) | 1252 | if ( iface ) |
1248 | iface-> release ( ); | 1253 | iface-> release ( ); |
1249 | delete lib; | 1254 | delete lib; |
1250 | 1255 | ||
1251 | setStyle ( new QPEStyle ( )); | 1256 | setStyle ( new QPEStyle ( )); |
1252 | } | 1257 | } |
1253 | } | 1258 | } |
1254 | #endif | 1259 | #endif |