-rw-r--r-- | library/qpedecoration_qws.cpp | 8 |
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 | |||
@@ -467,101 +467,109 @@ public: | |||
467 | *iface = this; | 467 | *iface = this; |
468 | else if ( uuid == IID_WindowDecoration ) | 468 | else if ( uuid == IID_WindowDecoration ) |
469 | *iface = this; | 469 | *iface = this; |
470 | 470 | ||
471 | if ( *iface ) | 471 | if ( *iface ) |
472 | (*iface)->addRef(); | 472 | (*iface)->addRef(); |
473 | return QS_OK; | 473 | return QS_OK; |
474 | } | 474 | } |
475 | Q_REFCOUNT | 475 | Q_REFCOUNT |
476 | 476 | ||
477 | private: | 477 | private: |
478 | ulong ref; | 478 | ulong ref; |
479 | }; | 479 | }; |
480 | 480 | ||
481 | static WindowDecorationInterface *wdiface = 0; | 481 | static WindowDecorationInterface *wdiface = 0; |
482 | static QLibrary *wdlib = 0; | 482 | static QLibrary *wdlib = 0; |
483 | static QString libname; | 483 | static QString libname; |
484 | 484 | ||
485 | //=========================================================================== | 485 | //=========================================================================== |
486 | 486 | ||
487 | QPEDecoration::QPEDecoration() | 487 | QPEDecoration::QPEDecoration() |
488 | : QWSDefaultDecoration() | 488 | : QWSDefaultDecoration() |
489 | { | 489 | { |
490 | init ( libname ); | 490 | init ( libname ); |
491 | } | 491 | } |
492 | 492 | ||
493 | QPEDecoration::QPEDecoration( const QString &plugin ) | 493 | QPEDecoration::QPEDecoration( const QString &plugin ) |
494 | : QWSDefaultDecoration() | 494 | : QWSDefaultDecoration() |
495 | { | 495 | { |
496 | init ( plugin ); | 496 | init ( plugin ); |
497 | } | 497 | } |
498 | 498 | ||
499 | void QPEDecoration::init ( const QString &plugin ) | 499 | void 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 ); |
544 | } | 552 | } |
545 | 553 | ||
546 | QPEDecoration::~QPEDecoration() | 554 | QPEDecoration::~QPEDecoration() |
547 | { | 555 | { |
548 | delete qpeManager; | 556 | delete qpeManager; |
549 | } | 557 | } |
550 | 558 | ||
551 | const char **QPEDecoration::menuPixmap() | 559 | const char **QPEDecoration::menuPixmap() |
552 | { | 560 | { |
553 | return (const char **)0; | 561 | return (const char **)0; |
554 | } | 562 | } |
555 | 563 | ||
556 | const char **QPEDecoration::closePixmap() | 564 | const char **QPEDecoration::closePixmap() |
557 | { | 565 | { |
558 | return (const char **)qpe_close_xpm; | 566 | return (const char **)qpe_close_xpm; |
559 | } | 567 | } |
560 | 568 | ||
561 | const char **QPEDecoration::minimizePixmap() | 569 | const char **QPEDecoration::minimizePixmap() |
562 | { | 570 | { |
563 | return (const char **)qpe_accept_xpm; | 571 | return (const char **)qpe_accept_xpm; |
564 | } | 572 | } |
565 | 573 | ||
566 | const char **QPEDecoration::maximizePixmap() | 574 | const char **QPEDecoration::maximizePixmap() |
567 | { | 575 | { |