summaryrefslogtreecommitdiff
path: root/library/qpedecoration_qws.cpp
authoreilers <eilers>2003-11-03 16:52:18 (UTC)
committer eilers <eilers>2003-11-03 16:52:18 (UTC)
commitd34dc773591a2d467c68875a68a671d6a809f861 (patch) (unidiff)
treeb57e5ae15c51e3d87ca95d57aedfd1ca3db57bfe /library/qpedecoration_qws.cpp
parentce84f2d8bdd65c438821f0457cdad6bbbfa73380 (diff)
downloadopie-d34dc773591a2d467c68875a68a671d6a809f861.zip
opie-d34dc773591a2d467c68875a68a671d6a809f861.tar.gz
opie-d34dc773591a2d467c68875a68a671d6a809f861.tar.bz2
Porting Opie to MacOS-X.
The base system and all platform independent applications and platforms should work. Please see $OPIEDIR/development/macosx for details
Diffstat (limited to 'library/qpedecoration_qws.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpedecoration_qws.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp
index 933542d..bac1a75 100644
--- a/library/qpedecoration_qws.cpp
+++ b/library/qpedecoration_qws.cpp
@@ -491,53 +491,61 @@ QPEDecoration::QPEDecoration()
491} 491}
492 492
493QPEDecoration::QPEDecoration( const QString &plugin ) 493QPEDecoration::QPEDecoration( const QString &plugin )
494 : QWSDefaultDecoration() 494 : QWSDefaultDecoration()
495{ 495{
496 init ( plugin ); 496 init ( plugin );
497} 497}
498 498
499void QPEDecoration::init ( const QString &plugin ) 499void QPEDecoration::init ( const QString &plugin )
500{ 500{
501 libname = plugin; 501 libname = plugin;
502 502
503 if ( wdlib ) { 503 if ( wdlib ) {
504 wdiface->release(); 504 wdiface->release();
505 wdlib->unload(); 505 wdlib->unload();
506 delete wdlib; 506 delete wdlib;
507 wdlib = 0; 507 wdlib = 0;
508 } else { 508 } else {
509 delete wdiface; 509 delete wdiface;
510 } 510 }
511 511
512 WindowDecorationInterface *iface = 0; 512 WindowDecorationInterface *iface = 0;
513 QString path = QPEApplication::qpeDir() + "/plugins/decorations/"; 513 QString path = QPEApplication::qpeDir() + "/plugins/decorations/";
514 514
515#ifdef Q_OS_MACX
516 if ( plugin.find( ".dylib" ) > 0 ) {
517#else
515 if ( plugin.find( ".so" ) > 0 ) { 518 if ( plugin.find( ".so" ) > 0 ) {
519#endif
516 // full library name supplied 520 // full library name supplied
517 path += plugin; 521 path += plugin;
518 } else { 522 } else {
523#ifdef Q_OS_MACX
524 path += "lib" + plugin.lower() + ".dylib"; // compatibility
525#else
519 path += "lib" + plugin.lower() + ".so"; // compatibility 526 path += "lib" + plugin.lower() + ".so"; // compatibility
527#endif
520 } 528 }
521 529
522 QLibrary *lib = new QLibrary( path ); 530 QLibrary *lib = new QLibrary( path );
523 if ( lib->queryInterface( IID_WindowDecoration, (QUnknownInterface**)&iface ) == QS_OK && iface ) { 531 if ( lib->queryInterface( IID_WindowDecoration, (QUnknownInterface**)&iface ) == QS_OK && iface ) {
524 wdiface = iface; 532 wdiface = iface;
525 wdlib = lib; 533 wdlib = lib;
526 } else { 534 } else {
527 delete lib; 535 delete lib;
528 wdiface = new DefaultWindowDecoration; 536 wdiface = new DefaultWindowDecoration;
529 } 537 }
530 538
531 helpFile = QString(qApp->argv()[0]) + ".html"; 539 helpFile = QString(qApp->argv()[0]) + ".html";
532 QStringList helpPath = Global::helpPath(); 540 QStringList helpPath = Global::helpPath();
533 helpExists = FALSE; 541 helpExists = FALSE;
534 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) { 542 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) {
535 helpExists = QFile::exists( *it + "/" + helpFile ); 543 helpExists = QFile::exists( *it + "/" + helpFile );
536 //qDebug ( "Checking %s/%s for help: %d", (*it).latin1(), helpFile.latin1(),helpExists); 544 //qDebug ( "Checking %s/%s for help: %d", (*it).latin1(), helpFile.latin1(),helpExists);
537 } 545 }
538 qpeManager = new QPEManager( this ); 546 qpeManager = new QPEManager( this );
539 547
540 // Qtopia 1.5 compatibility 548 // Qtopia 1.5 compatibility
541 imageOk = *okImage ( 15 ); 549 imageOk = *okImage ( 15 );
542 imageClose = *closeImage ( 15 ); 550 imageClose = *closeImage ( 15 );
543 imageHelp = *helpImage ( 15 ); 551 imageHelp = *helpImage ( 15 );