summaryrefslogtreecommitdiff
path: root/library/applnk.cpp
Unidiff
Diffstat (limited to 'library/applnk.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/applnk.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp
index 4adf1bd..8763eb2 100644
--- a/library/applnk.cpp
+++ b/library/applnk.cpp
@@ -445,49 +445,49 @@ AppLnk& AppLnk::operator=(const AppLnk &copy)
445 mComment = copy.mComment; 445 mComment = copy.mComment;
446 mFile = copy.mFile; 446 mFile = copy.mFile;
447 mLinkFile = copy.mLinkFile; 447 mLinkFile = copy.mLinkFile;
448 mIconFile = copy.mIconFile; 448 mIconFile = copy.mIconFile;
449 mMimeTypes = copy.mMimeTypes; 449 mMimeTypes = copy.mMimeTypes;
450 mMimeTypeIcons = copy.mMimeTypeIcons; 450 mMimeTypeIcons = copy.mMimeTypeIcons;
451 mId = 0; 451 mId = 0;
452 d = new AppLnkPrivate(); 452 d = new AppLnkPrivate();
453 d->mCat = copy.d->mCat; 453 d->mCat = copy.d->mCat;
454 d->mCatList = copy.d->mCatList; 454 d->mCatList = copy.d->mCatList;
455 d->mPixmaps = copy.d->mPixmaps; 455 d->mPixmaps = copy.d->mPixmaps;
456 456
457 return *this; 457 return *this;
458} 458}
459/*! 459/*!
460 protected internally to share code 460 protected internally to share code
461 should I document that at all? 461 should I document that at all?
462 I don't know the TT style for that 462 I don't know the TT style for that
463*/ 463*/
464const QPixmap& AppLnk::pixmap( int pos, int size ) const { 464const QPixmap& AppLnk::pixmap( int pos, int size ) const {
465 if ( d->mPixmaps[pos].isNull() ) { 465 if ( d->mPixmaps[pos].isNull() ) {
466 AppLnk* that = (AppLnk*)this; 466 AppLnk* that = (AppLnk*)this;
467 if ( mIconFile.isEmpty() ) { 467 if ( mIconFile.isEmpty() ) {
468 MimeType mt(type()); 468 MimeType mt(type());
469 that->d->mPixmaps[pos] = mt.pixmap(); 469 that->d->mPixmaps[pos] = pos ? mt.bigPixmap() : mt.pixmap();
470 if ( that->d->mPixmaps[pos].isNull() ) 470 if ( that->d->mPixmaps[pos].isNull() )
471 that->d->mPixmaps[pos].convertFromImage( 471 that->d->mPixmaps[pos].convertFromImage(
472 Resource::loadImage("UnknownDocument") 472 Resource::loadImage("UnknownDocument")
473 .smoothScale( size, size ) ); 473 .smoothScale( size, size ) );
474 return that->d->mPixmaps[pos]; 474 return that->d->mPixmaps[pos];
475 } 475 }
476 QImage unscaledIcon = Resource::loadImage( that->mIconFile ); 476 QImage unscaledIcon = Resource::loadImage( that->mIconFile );
477 if ( unscaledIcon.isNull() ) { 477 if ( unscaledIcon.isNull() ) {
478 // qDebug( "Cannot find icon: %s", that->mIconFile.latin1() ); 478 // qDebug( "Cannot find icon: %s", that->mIconFile.latin1() );
479 that->d->mPixmaps[pos].convertFromImage( 479 that->d->mPixmaps[pos].convertFromImage(
480 Resource::loadImage("UnknownDocument") 480 Resource::loadImage("UnknownDocument")
481 .smoothScale( size, size ) ); 481 .smoothScale( size, size ) );
482 } else { 482 } else {
483 that->d->mPixmaps[0].convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) ); 483 that->d->mPixmaps[0].convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) );
484 that->d->mPixmaps[1].convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) ); 484 that->d->mPixmaps[1].convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) );
485 } 485 }
486 return that->d->mPixmaps[pos]; 486 return that->d->mPixmaps[pos];
487 } 487 }
488 return d->mPixmaps[pos]; 488 return d->mPixmaps[pos];
489} 489}
490 490
491/*! 491/*!
492 Returns a small pixmap associated with the application. 492 Returns a small pixmap associated with the application.
493 493