summaryrefslogtreecommitdiff
path: root/library/qpedecoration_qws.cpp
Unidiff
Diffstat (limited to 'library/qpedecoration_qws.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpedecoration_qws.cpp41
1 files changed, 17 insertions, 24 deletions
diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp
index 6221f5b..5e0c32a 100644
--- a/library/qpedecoration_qws.cpp
+++ b/library/qpedecoration_qws.cpp
@@ -480,40 +480,26 @@ private:
480 480
481static WindowDecorationInterface *wdiface = 0; 481static WindowDecorationInterface *wdiface = 0;
482static QLibrary *wdlib = 0; 482static QLibrary *wdlib = 0;
483static QString libname;
483 484
484//=========================================================================== 485//===========================================================================
485 486
486QPEDecoration::QPEDecoration() 487QPEDecoration::QPEDecoration()
487 : QWSDefaultDecoration() 488 : QWSDefaultDecoration()
488{ 489{
489 if ( wdlib ) { 490 init ( libname );
490 wdiface->release();
491 wdlib->unload();
492 delete wdlib;
493 wdlib = 0;
494 } else {
495 delete wdiface;
496 }
497 wdiface = new DefaultWindowDecoration;
498
499 helpFile = QString(qApp->argv()[0]) + ".html";
500 QStringList helpPath = Global::helpPath();
501 helpExists = FALSE;
502 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) {
503 helpExists = QFile::exists( *it + "/" + helpFile );
504 qDebug ( "Checking %s/%s for help: %d", (*it).latin1(), helpFile.latin1(),helpExists);
505 }
506 qpeManager = new QPEManager( this );
507
508 // for backward compatibility:
509 imageOk = *okImage ( 15 );
510 imageClose = *closeImage ( 15 );
511 imageHelp = *helpImage ( 15 );
512} 491}
513 492
514QPEDecoration::QPEDecoration( const QString &plugin ) 493QPEDecoration::QPEDecoration( const QString &plugin )
515 : QWSDefaultDecoration() 494 : QWSDefaultDecoration()
516{ 495{
496 init ( plugin );
497}
498
499void QPEDecoration::init ( const QString &plugin )
500{
501 libname = plugin;
502
517 if ( wdlib ) { 503 if ( wdlib ) {
518 wdiface->release(); 504 wdiface->release();
519 wdlib->unload(); 505 wdlib->unload();
@@ -522,6 +508,7 @@ QPEDecoration::QPEDecoration( const QString &plugin )
522 } else { 508 } else {
523 delete wdiface; 509 delete wdiface;
524 } 510 }
511
525 WindowDecorationInterface *iface = 0; 512 WindowDecorationInterface *iface = 0;
526 QString path = QPEApplication::qpeDir() + "/plugins/decorations"; 513 QString path = QPEApplication::qpeDir() + "/plugins/decorations";
527 QLibrary *lib = new QLibrary( path + "/" + plugin ); 514 QLibrary *lib = new QLibrary( path + "/" + plugin );
@@ -538,8 +525,14 @@ QPEDecoration::QPEDecoration( const QString &plugin )
538 helpExists = FALSE; 525 helpExists = FALSE;
539 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) { 526 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) {
540 helpExists = QFile::exists( *it + "/" + helpFile ); 527 helpExists = QFile::exists( *it + "/" + helpFile );
541 qDebug ( "Checking %s/%s for help: %d", (*it).latin1(), helpFile.latin1(),helpExists); } 528 //qDebug ( "Checking %s/%s for help: %d", (*it).latin1(), helpFile.latin1(),helpExists);
529 }
542 qpeManager = new QPEManager( this ); 530 qpeManager = new QPEManager( this );
531
532 // Qtopia 1.5 compatibility
533 imageOk = *okImage ( 15 );
534 imageClose = *closeImage ( 15 );
535 imageHelp = *helpImage ( 15 );
543} 536}
544 537
545QPEDecoration::~QPEDecoration() 538QPEDecoration::~QPEDecoration()