author | harlekin <harlekin> | 2002-02-23 10:05:09 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-02-23 10:05:09 (UTC) |
commit | cb8381a2969b3a51697ec2034a919fffa9a9c022 (patch) (unidiff) | |
tree | 5e6728d9e757c32884951bb3c2f9254f7ca057b7 | |
parent | 30ff9056e2632ce4c3cd8b3d0fbf94dcd6b5dafb (diff) | |
download | opie-cb8381a2969b3a51697ec2034a919fffa9a9c022.zip opie-cb8381a2969b3a51697ec2034a919fffa9a9c022.tar.gz opie-cb8381a2969b3a51697ec2034a919fffa9a9c022.tar.bz2 |
change to Documents tab, it now shows only existing files
-rw-r--r-- | core/launcher/launcherview.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index e8741a2..7b20fdc 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp | |||
@@ -554,49 +554,58 @@ void LauncherView::itemClicked( int btn, QIconViewItem *item ) | |||
554 | item->setSelected(FALSE); | 554 | item->setSelected(FALSE); |
555 | } | 555 | } |
556 | } | 556 | } |
557 | 557 | ||
558 | void LauncherView::itemPressed( int btn, QIconViewItem *item ) | 558 | void LauncherView::itemPressed( int btn, QIconViewItem *item ) |
559 | { | 559 | { |
560 | if ( item ) { | 560 | if ( item ) { |
561 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); | 561 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); |
562 | if ( btn == RightButton ) | 562 | if ( btn == RightButton ) |
563 | emit rightPressed( appLnk ); | 563 | emit rightPressed( appLnk ); |
564 | /* | 564 | /* |
565 | else if ( btn == LeftButton ) | 565 | else if ( btn == LeftButton ) |
566 | emit clicked( appLnk ); | 566 | emit clicked( appLnk ); |
567 | */ | 567 | */ |
568 | item->setSelected(FALSE); | 568 | item->setSelected(FALSE); |
569 | } | 569 | } |
570 | } | 570 | } |
571 | 571 | ||
572 | void LauncherView::internalPopulate( AppLnkSet *folder, const QString& typefilter ) | 572 | void LauncherView::internalPopulate( AppLnkSet *folder, const QString& typefilter ) |
573 | { | 573 | { |
574 | QListIterator<AppLnk> it( folder->children() ); | 574 | QListIterator<AppLnk> it( folder->children() ); |
575 | icons->setTypeFilter(typefilter,FALSE); | 575 | icons->setTypeFilter(typefilter,FALSE); |
576 | 576 | ||
577 | while ( it.current() ) { | 577 | while ( it.current() ) { |
578 | icons->addItem(*it,FALSE); | 578 | // show only the icons for existing files |
579 | if (!QFile(it.current()->file()).exists() ) | ||
580 | { | ||
581 | //maybe insert some .desktop file deletion code later | ||
582 | //maybe dir specific | ||
583 | } | ||
584 | else | ||
585 | { | ||
586 | icons->addItem(*it,FALSE); | ||
587 | } | ||
579 | ++it; | 588 | ++it; |
580 | } | 589 | } |
581 | 590 | ||
582 | icons->sort(); | 591 | icons->sort(); |
583 | } | 592 | } |
584 | 593 | ||
585 | bool LauncherView::removeLink(const QString& linkfile) | 594 | bool LauncherView::removeLink(const QString& linkfile) |
586 | { | 595 | { |
587 | return icons->removeLink(linkfile); | 596 | return icons->removeLink(linkfile); |
588 | } | 597 | } |
589 | 598 | ||
590 | void LauncherView::sort() | 599 | void LauncherView::sort() |
591 | { | 600 | { |
592 | icons->sort(); | 601 | icons->sort(); |
593 | } | 602 | } |
594 | 603 | ||
595 | void LauncherView::addItem(AppLnk* app, bool resort) | 604 | void LauncherView::addItem(AppLnk* app, bool resort) |
596 | { | 605 | { |
597 | icons->addItem(app,resort); | 606 | icons->addItem(app,resort); |
598 | } | 607 | } |
599 | 608 | ||
600 | void LauncherView::setFileSystems(const QList<FileSystem> &) | 609 | void LauncherView::setFileSystems(const QList<FileSystem> &) |
601 | { | 610 | { |
602 | // ### does nothing now... | 611 | // ### does nothing now... |