-rw-r--r-- | core/launcher/launcher.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index bf2287d..6afbcd8 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -651,96 +651,106 @@ void Launcher::typeAdded( const QString& type, const QString& name, | |||
651 | tabs->view( type )->setSortEnabled( FALSE ); | 651 | tabs->view( type )->setSortEnabled( FALSE ); |
652 | } | 652 | } |
653 | 653 | ||
654 | void Launcher::typeRemoved( const QString& type ) | 654 | void Launcher::typeRemoved( const QString& type ) |
655 | { | 655 | { |
656 | tabs->view( type )->removeAllItems(); | 656 | tabs->view( type )->removeAllItems(); |
657 | tabs->deleteView( type ); | 657 | tabs->deleteView( type ); |
658 | ids.remove( type ); | 658 | ids.remove( type ); |
659 | /* this will be called in applicationScanningProgress with value 100! */ | 659 | /* this will be called in applicationScanningProgress with value 100! */ |
660 | // tb->refreshStartMenu(); | 660 | // tb->refreshStartMenu(); |
661 | } | 661 | } |
662 | 662 | ||
663 | void Launcher::applicationAdded( const QString& type, const AppLnk& app ) | 663 | void Launcher::applicationAdded( const QString& type, const AppLnk& app ) |
664 | { | 664 | { |
665 | if ( app.type() == "Separator" ) // No tr | 665 | if ( app.type() == "Separator" ) // No tr |
666 | return; | 666 | return; |
667 | 667 | ||
668 | LauncherView *view = tabs->view( type ); | 668 | LauncherView *view = tabs->view( type ); |
669 | if ( view ) | 669 | if ( view ) |
670 | view->addItem( new AppLnk( app ), FALSE ); | 670 | view->addItem( new AppLnk( app ), FALSE ); |
671 | else | 671 | else |
672 | qWarning("addAppLnk: No view for type %s. Can't add app %s!", | 672 | qWarning("addAppLnk: No view for type %s. Can't add app %s!", |
673 | type.latin1(),app.name().latin1() ); | 673 | type.latin1(),app.name().latin1() ); |
674 | 674 | ||
675 | MimeType::registerApp( app ); | 675 | MimeType::registerApp( app ); |
676 | } | 676 | } |
677 | 677 | ||
678 | void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) | 678 | void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) |
679 | { | 679 | { |
680 | LauncherView *view = tabs->view( type ); | 680 | LauncherView *view = tabs->view( type ); |
681 | if ( view ) | 681 | if ( view ) |
682 | view->removeLink( app.linkFile() ); | 682 | view->removeLink( app.linkFile() ); |
683 | else | 683 | else |
684 | owarn << "removeAppLnk: No view for " << type << "!" << oendl; | 684 | owarn << "removeAppLnk: No view for " << type << "!" << oendl; |
685 | } | 685 | } |
686 | 686 | ||
687 | void Launcher::allApplicationsRemoved() | 687 | void Launcher::allApplicationsRemoved() |
688 | { | 688 | { |
689 | MimeType::clear(); | 689 | MimeType::clear(); |
690 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) | 690 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) |
691 | tabs->view( (*it) )->removeAllItems(); | 691 | tabs->view( (*it) )->removeAllItems(); |
692 | } | 692 | } |
693 | 693 | ||
694 | void Launcher::documentAdded( const DocLnk& doc ) | 694 | void Launcher::documentAdded( const DocLnk& doc ) |
695 | { | 695 | { |
696 | tabs->docView()->addItem( new DocLnk( doc ), FALSE ); | 696 | tabs->docView()->addItem( new DocLnk( doc ), FALSE ); |
697 | } | 697 | } |
698 | 698 | ||
699 | void Launcher::aboutToAddBegin() | ||
700 | { | ||
701 | tabs->docView()->setUpdatesEnabled( false ); | ||
702 | } | ||
703 | |||
704 | void Launcher::aboutToAddEnd() | ||
705 | { | ||
706 | tabs->docView()->setUpdatesEnabled( true ); | ||
707 | } | ||
708 | |||
699 | void Launcher::showLoadingDocs() | 709 | void Launcher::showLoadingDocs() |
700 | { | 710 | { |
701 | tabs->docView()->hide(); | 711 | tabs->docView()->hide(); |
702 | } | 712 | } |
703 | 713 | ||
704 | void Launcher::showDocTab() | 714 | void Launcher::showDocTab() |
705 | { | 715 | { |
706 | if ( tabs->categoryBar->currentView() == tabs->docView() ) | 716 | if ( tabs->categoryBar->currentView() == tabs->docView() ) |
707 | tabs->docView()->show(); | 717 | tabs->docView()->show(); |
708 | } | 718 | } |
709 | 719 | ||
710 | void Launcher::documentRemoved( const DocLnk& doc ) | 720 | void Launcher::documentRemoved( const DocLnk& doc ) |
711 | { | 721 | { |
712 | tabs->docView()->removeLink( doc.linkFile() ); | 722 | tabs->docView()->removeLink( doc.linkFile() ); |
713 | } | 723 | } |
714 | 724 | ||
715 | void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) | 725 | void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) |
716 | { | 726 | { |
717 | documentRemoved( oldDoc ); | 727 | documentRemoved( oldDoc ); |
718 | documentAdded( newDoc ); | 728 | documentAdded( newDoc ); |
719 | } | 729 | } |
720 | 730 | ||
721 | void Launcher::allDocumentsRemoved() | 731 | void Launcher::allDocumentsRemoved() |
722 | { | 732 | { |
723 | tabs->docView()->removeAllItems(); | 733 | tabs->docView()->removeAllItems(); |
724 | } | 734 | } |
725 | 735 | ||
726 | void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) | 736 | void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) |
727 | { | 737 | { |
728 | tb->setApplicationState( name, state ); | 738 | tb->setApplicationState( name, state ); |
729 | } | 739 | } |
730 | 740 | ||
731 | void Launcher::applicationScanningProgress( int percent ) | 741 | void Launcher::applicationScanningProgress( int percent ) |
732 | { | 742 | { |
733 | switch ( percent ) { | 743 | switch ( percent ) { |
734 | case 0: { | 744 | case 0: { |
735 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { | 745 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { |
736 | tabs->view( (*it) )->setUpdatesEnabled( FALSE ); | 746 | tabs->view( (*it) )->setUpdatesEnabled( FALSE ); |
737 | tabs->view( (*it) )->setSortEnabled( FALSE ); | 747 | tabs->view( (*it) )->setSortEnabled( FALSE ); |
738 | } | 748 | } |
739 | break; | 749 | break; |
740 | } | 750 | } |
741 | case 100: { | 751 | case 100: { |
742 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { | 752 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { |
743 | tabs->view( (*it) )->setUpdatesEnabled( TRUE ); | 753 | tabs->view( (*it) )->setUpdatesEnabled( TRUE ); |
744 | tabs->view( (*it) )->setSortEnabled( TRUE ); | 754 | tabs->view( (*it) )->setSortEnabled( TRUE ); |
745 | } | 755 | } |
746 | tb->refreshStartMenu(); | 756 | tb->refreshStartMenu(); |