-rw-r--r-- | libopie2/opiecore/opluginloader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opiecore/opluginloader.cpp b/libopie2/opiecore/opluginloader.cpp index 2a6e369..d33eac6 100644 --- a/libopie2/opiecore/opluginloader.cpp +++ b/libopie2/opiecore/opluginloader.cpp | |||
@@ -444,65 +444,65 @@ QUnknownInterface* OGenericPluginLoader::load( const OPluginItem& item, const QU | |||
444 | iface = 0; | 444 | iface = 0; |
445 | 445 | ||
446 | setSafeMode(); | 446 | setSafeMode(); |
447 | 447 | ||
448 | return iface; | 448 | return iface; |
449 | } | 449 | } |
450 | 450 | ||
451 | /** | 451 | /** |
452 | * @internal and reads in the safe mode | 452 | * @internal and reads in the safe mode |
453 | */ | 453 | */ |
454 | void OGenericPluginLoader::readConfig() { | 454 | void OGenericPluginLoader::readConfig() { |
455 | 455 | ||
456 | 456 | ||
457 | /* read the config for SafeMode */ | 457 | /* read the config for SafeMode */ |
458 | OConfig conf( m_dir + "-odpplugins" ); | 458 | OConfig conf( m_dir + "-odpplugins" ); |
459 | conf.setGroup( "General" ); | 459 | conf.setGroup( "General" ); |
460 | m_isSafeMode = conf.readBoolEntry( "SafeMode", false ); | 460 | m_isSafeMode = conf.readBoolEntry( "SafeMode", false ); |
461 | } | 461 | } |
462 | 462 | ||
463 | /** | 463 | /** |
464 | * @internal Enter or leave SafeMode | 464 | * @internal Enter or leave SafeMode |
465 | */ | 465 | */ |
466 | void OGenericPluginLoader::setSafeMode(const QString& str, bool b) { | 466 | void OGenericPluginLoader::setSafeMode(const QString& str, bool b) { |
467 | OConfig conf( m_dir + "-odpplugins" ); | 467 | OConfig conf( m_dir + "-odpplugins" ); |
468 | conf.setGroup( "General" ); | 468 | conf.setGroup( "General" ); |
469 | conf.writeEntry( "SafeMode", b ); | 469 | conf.writeEntry( "SafeMode", b ); |
470 | conf.writeEntry( "CrashedPlugin", str ); | 470 | conf.writeEntry( "CrashedPlugin", str ); |
471 | } | 471 | } |
472 | 472 | ||
473 | /** | 473 | /** |
474 | * @internal | 474 | * @internal |
475 | * | 475 | * |
476 | * Set the List of Plugin Dirs to lst. Currently only QPEApplication::qpeDir()+"/plugins/"+mytype | 476 | * Set the List of Plugin Dirs to lst. Currently only QPEApplication::qpeDir()+"plugins/"+mytype |
477 | * is used as plugin dir | 477 | * is used as plugin dir |
478 | */ | 478 | */ |
479 | void OGenericPluginLoader::setPluginDirs( const QStringList& lst ) { | 479 | void OGenericPluginLoader::setPluginDirs( const QStringList& lst ) { |
480 | m_plugDirs = lst; | 480 | m_plugDirs = lst; |
481 | } | 481 | } |
482 | 482 | ||
483 | /** | 483 | /** |
484 | * | 484 | * |
485 | * @internal | 485 | * @internal |
486 | * Set the Plugin Dir to str. Str will be the only element in the list of plugin dirs | 486 | * Set the Plugin Dir to str. Str will be the only element in the list of plugin dirs |
487 | */ | 487 | */ |
488 | void OGenericPluginLoader::setPluginDir( const QString& str) { | 488 | void OGenericPluginLoader::setPluginDir( const QString& str) { |
489 | m_plugDirs.clear(); | 489 | m_plugDirs.clear(); |
490 | m_plugDirs.append( str ); | 490 | m_plugDirs.append( str ); |
491 | } | 491 | } |
492 | 492 | ||
493 | 493 | ||
494 | /** | 494 | /** |
495 | * @internal | 495 | * @internal |
496 | */ | 496 | */ |
497 | bool OGenericPluginLoader::isSorted()const{ | 497 | bool OGenericPluginLoader::isSorted()const{ |
498 | return m_isSorted; | 498 | return m_isSorted; |
499 | } | 499 | } |
500 | 500 | ||
501 | /* | 501 | /* |
502 | * make libfoo.so.1.0.0 -> foo on UNIX | 502 | * make libfoo.so.1.0.0 -> foo on UNIX |
503 | * make libfoo.dylib -> foo on MAC OS X Unix | 503 | * make libfoo.dylib -> foo on MAC OS X Unix |
504 | * windows is obviously missing | 504 | * windows is obviously missing |
505 | */ | 505 | */ |
506 | /** | 506 | /** |
507 | * @internal | 507 | * @internal |
508 | */ | 508 | */ |
@@ -609,65 +609,65 @@ QStringList OGenericPluginLoader::languageList() { | |||
609 | QString str = ::getenv( "LANG" ); | 609 | QString str = ::getenv( "LANG" ); |
610 | m_languages += str; | 610 | m_languages += str; |
611 | int pos = str.find( '@' ); | 611 | int pos = str.find( '@' ); |
612 | if( pos > 0 ) | 612 | if( pos > 0 ) |
613 | m_languages += str.left( pos ); | 613 | m_languages += str.left( pos ); |
614 | 614 | ||
615 | 615 | ||
616 | pos = str.find( '.' ); | 616 | pos = str.find( '.' ); |
617 | if ( pos > 0 ) | 617 | if ( pos > 0 ) |
618 | m_languages += str.left( pos ); | 618 | m_languages += str.left( pos ); |
619 | 619 | ||
620 | int n_pos = str.find( '_' ); | 620 | int n_pos = str.find( '_' ); |
621 | if ( n_pos > 0 ) | 621 | if ( n_pos > 0 ) |
622 | m_languages += str.left( n_pos ); | 622 | m_languages += str.left( n_pos ); |
623 | 623 | ||
624 | } | 624 | } |
625 | return m_languages; | 625 | return m_languages; |
626 | } | 626 | } |
627 | 627 | ||
628 | /** | 628 | /** |
629 | * @internal | 629 | * @internal |
630 | * Tries to install languages using the languageList for the type | 630 | * Tries to install languages using the languageList for the type |
631 | */ | 631 | */ |
632 | void OGenericPluginLoader::installTranslators(const QString& type) { | 632 | void OGenericPluginLoader::installTranslators(const QString& type) { |
633 | QStringList lst = languageList(); | 633 | QStringList lst = languageList(); |
634 | 634 | ||
635 | /* | 635 | /* |
636 | * for each language and maybe later for each language dir... | 636 | * for each language and maybe later for each language dir... |
637 | * try to load a Translator | 637 | * try to load a Translator |
638 | */ | 638 | */ |
639 | for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { | 639 | for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { |
640 | QTranslator* trans = new QTranslator( qApp ); | 640 | QTranslator* trans = new QTranslator( qApp ); |
641 | QString tfn = QPEApplication::qpeDir()+"/i18n/" + *it + "/lib" + type + ".qm" ; | 641 | QString tfn = QPEApplication::qpeDir()+"i18n/" + *it + "/lib" + type + ".qm" ; |
642 | 642 | ||
643 | /* | 643 | /* |
644 | * If loaded then install else clean up and don't leak | 644 | * If loaded then install else clean up and don't leak |
645 | */ | 645 | */ |
646 | if ( trans->load( tfn ) ) | 646 | if ( trans->load( tfn ) ) |
647 | qApp->installTranslator( trans ); | 647 | qApp->installTranslator( trans ); |
648 | else | 648 | else |
649 | delete trans; | 649 | delete trans; |
650 | } | 650 | } |
651 | } | 651 | } |
652 | 652 | ||
653 | /** | 653 | /** |
654 | * \brief Simple c'tor. | 654 | * \brief Simple c'tor. |
655 | * | 655 | * |
656 | * Simple C'tor same as the one of the base class. Additional this | 656 | * Simple C'tor same as the one of the base class. Additional this |
657 | * class can cast for you if you nee it. | 657 | * class can cast for you if you nee it. |
658 | * | 658 | * |
659 | * | 659 | * |
660 | * @param name The name of your plugin class | 660 | * @param name The name of your plugin class |
661 | * @param sorted If plugins are sorted | 661 | * @param sorted If plugins are sorted |
662 | * | 662 | * |
663 | * @see OGenericPluginLoader | 663 | * @see OGenericPluginLoader |
664 | */ | 664 | */ |
665 | OPluginLoader::OPluginLoader( const QString& name, bool sorted ) | 665 | OPluginLoader::OPluginLoader( const QString& name, bool sorted ) |
666 | : OGenericPluginLoader( name, sorted ) | 666 | : OGenericPluginLoader( name, sorted ) |
667 | { | 667 | { |
668 | } | 668 | } |
669 | 669 | ||
670 | /** | 670 | /** |
671 | * d'tor | 671 | * d'tor |
672 | * @see OGenericPluginLoader::~OGenericPluginLoader | 672 | * @see OGenericPluginLoader::~OGenericPluginLoader |
673 | */ | 673 | */ |