author | harlekin <harlekin> | 2002-02-23 10:05:09 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-02-23 10:05:09 (UTC) |
commit | cb8381a2969b3a51697ec2034a919fffa9a9c022 (patch) (side-by-side diff) | |
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 @@ -482,122 +482,131 @@ void LauncherView::updateTools() Categories cats( 0 ); cats.load( categoryFileName() ); QArray<int> vl( 0 ); catmb->setCategories( vl, "Document View", tr("Document View") ); catmb->setRemoveCategoryEdit( TRUE ); catmb->setAllCategories( TRUE ); connect(typemb, SIGNAL(selected(const QString&)), this, SLOT(showType(const QString&))); connect(catmb, SIGNAL(signalSelected(int)), this, SLOT(showCategory(int))); } void LauncherView::sortBy(int s) { icons->setSortMethod((LauncherIconView::SortMethod)s); } void LauncherView::showType(const QString& t) { if ( t == tr("All") ) { icons->setTypeFilter("",TRUE); } else { icons->setTypeFilter(t+"/*",TRUE); } } void LauncherView::showCategory( int c ) { icons->setCategoryFilter( c, TRUE ); } void LauncherView::resizeEvent(QResizeEvent *e) { QVBox::resizeEvent( e ); if ( e->size().width() != e->oldSize().width() ) sort(); } void LauncherView::populate( AppLnkSet *folder, const QString& typefilter ) { icons->clear(); internalPopulate( folder, typefilter ); } void LauncherView::selectionChanged() { QIconViewItem* item = icons->currentItem(); if ( item && item->isSelected() ) { AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); if ( icons->inKeyEvent() ) // not for mouse press emit clicked( appLnk ); item->setSelected(FALSE); } } void LauncherView::returnPressed( QIconViewItem *item ) { if ( item ) { AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); emit clicked( appLnk ); } } void LauncherView::itemClicked( int btn, QIconViewItem *item ) { if ( item ) { AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); if ( btn == LeftButton ) { // Make sure it's the item we execute that gets highlighted icons->setCurrentItem( item ); emit clicked( appLnk ); } item->setSelected(FALSE); } } void LauncherView::itemPressed( int btn, QIconViewItem *item ) { if ( item ) { AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); if ( btn == RightButton ) emit rightPressed( appLnk ); /* else if ( btn == LeftButton ) emit clicked( appLnk ); */ item->setSelected(FALSE); } } void LauncherView::internalPopulate( AppLnkSet *folder, const QString& typefilter ) { QListIterator<AppLnk> it( folder->children() ); icons->setTypeFilter(typefilter,FALSE); while ( it.current() ) { - icons->addItem(*it,FALSE); + // show only the icons for existing files + if (!QFile(it.current()->file()).exists() ) + { + //maybe insert some .desktop file deletion code later + //maybe dir specific + } + else + { + icons->addItem(*it,FALSE); + } ++it; } icons->sort(); } bool LauncherView::removeLink(const QString& linkfile) { return icons->removeLink(linkfile); } void LauncherView::sort() { icons->sort(); } void LauncherView::addItem(AppLnk* app, bool resort) { icons->addItem(app,resort); } void LauncherView::setFileSystems(const QList<FileSystem> &) { // ### does nothing now... } |