summaryrefslogtreecommitdiff
path: root/core/launcher/launcherview.cpp
Unidiff
Diffstat (limited to 'core/launcher/launcherview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index fa46543..6e63fca 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -469,63 +469,62 @@ void LauncherIconView::hideOrShowItems(bool resort)
469 links.append(item->takeAppLnk()); 469 links.append(item->takeAppLnk());
470 item = (LauncherItem*)item->nextItem(); 470 item = (LauncherItem*)item->nextItem();
471 } 471 }
472 viewport()->setUpdatesEnabled( FALSE ); 472 viewport()->setUpdatesEnabled( FALSE );
473 clear(); 473 clear();
474 QListIterator<AppLnk> it(links); 474 QListIterator<AppLnk> it(links);
475 AppLnk* l; 475 AppLnk* l;
476 while ((l=it.current())) { 476 while ((l=it.current())) {
477 addItem(l,FALSE); 477 addItem(l,FALSE);
478 ++it; 478 ++it;
479 } 479 }
480 viewport()->setUpdatesEnabled( TRUE ); 480 viewport()->setUpdatesEnabled( TRUE );
481 if ( resort && !autoArrange() ) 481 if ( resort && !autoArrange() )
482 sort(); 482 sort();
483} 483}
484 484
485bool LauncherIconView::removeLink(const QString& linkfile) 485bool LauncherIconView::removeLink(const QString& linkfile)
486{ 486{
487 LauncherItem* item = (LauncherItem*)firstItem(); 487 LauncherItem* item = (LauncherItem*)firstItem();
488 AppLnk* l; 488 AppLnk* l;
489 bool did = FALSE; 489 bool did = FALSE;
490 DocLnk dl(linkfile); 490 DocLnk dl(linkfile);
491 while (item) { 491 while (item) {
492 l = item->appLnk(); 492 l = item->appLnk();
493 if ( l->linkFileKnown() && l->linkFile() == linkfile 493 if ( ( l->linkFileKnown() && ( l->linkFile() == linkfile ))
494 || l->fileKnown() && ( 494 || ( l->fileKnown() && ( l->file() == linkfile ))
495 l->file() == linkfile 495 || ( dl.fileKnown() && l->fileKnown() && ( dl.file() == l->file() )) ) {
496 || dl.isValid() && dl.file() == l->file() ) ) {
497 delete item; 496 delete item;
498 did = TRUE; 497 did = TRUE;
499 } 498 }
500 item = (LauncherItem*)item->nextItem(); 499 item = (LauncherItem*)item->nextItem();
501 } 500 }
502 QListIterator<AppLnk> it(hidden); 501 QListIterator<AppLnk> it(hidden);
503 while ((l=it.current())) { 502 while ((l=it.current())) {
504 ++it; 503 ++it;
505 if ( l->linkFileKnown() && l->linkFile() == linkfile 504 if ( ( l->linkFileKnown() && ( l->linkFile() == linkfile ))
506 || l->file() == linkfile 505 || ( l->file() == linkfile )
507 || dl.isValid() && dl.file() == l->file() ) { 506 || ( dl.fileKnown() && ( dl.file() == l->file() )) ) {
508 hidden.removeRef(l); 507 hidden.removeRef(l);
509 did = TRUE; 508 did = TRUE;
510 } 509 }
511 } 510 }
512 return did; 511 return did;
513} 512}
514 513
515static QString docLinkInfo(const Categories& cats, DocLnk* doc) 514static QString docLinkInfo(const Categories& cats, DocLnk* doc)
516{ 515{
517 QString contents; 516 QString contents;
518 517
519 QFileInfo fi( doc->file() ); 518 QFileInfo fi( doc->file() );
520 if ( !fi.exists() ) 519 if ( !fi.exists() )
521 return contents; 520 return contents;
522 521
523 if ( doc->linkFileKnown() ) { 522 if ( doc->linkFileKnown() ) {
524 QString lfn = doc->linkFile(); 523 QString lfn = doc->linkFile();
525 QFile f( lfn ); 524 QFile f( lfn );
526 if ( f.open( IO_ReadOnly ) ) { 525 if ( f.open( IO_ReadOnly ) ) {
527 QTextStream ts( &f ); 526 QTextStream ts( &f );
528 ts.setEncoding( QTextStream::UnicodeUTF8 ); 527 ts.setEncoding( QTextStream::UnicodeUTF8 );
529 contents += ts.read(); 528 contents += ts.read();
530 f.close(); 529 f.close();
531 goto calcsize; 530 goto calcsize;