-rw-r--r-- | library/applnk.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp index 80f2c62..c82d3b9 100644 --- a/library/applnk.cpp +++ b/library/applnk.cpp | |||
@@ -449,60 +449,62 @@ AppLnk& AppLnk::operator=(const AppLnk ©) | |||
449 | d = new AppLnkPrivate(); | 449 | d = new AppLnkPrivate(); |
450 | d->mCat = copy.d->mCat; | 450 | d->mCat = copy.d->mCat; |
451 | d->mCatList = copy.d->mCatList; | 451 | d->mCatList = copy.d->mCatList; |
452 | d->mPixmaps = copy.d->mPixmaps; | 452 | d->mPixmaps = copy.d->mPixmaps; |
453 | 453 | ||
454 | return *this; | 454 | return *this; |
455 | } | 455 | } |
456 | /*! | 456 | /*! |
457 | protected internally to share code | 457 | protected internally to share code |
458 | should I document that at all? | 458 | should I document that at all? |
459 | I don't know the TT style for that | 459 | I don't know the TT style for that |
460 | */ | 460 | */ |
461 | const QPixmap& AppLnk::pixmap( int pos, int size ) const { | 461 | const QPixmap& AppLnk::pixmap( int pos, int size ) const { |
462 | if ( d->mPixmaps[pos].isNull() ) { | 462 | if ( d->mPixmaps[pos].isNull() ) { |
463 | AppLnk* that = (AppLnk*)this; | 463 | AppLnk* that = (AppLnk*)this; |
464 | if ( mIconFile.isEmpty() ) { | 464 | if ( mIconFile.isEmpty() ) { |
465 | MimeType mt(type()); | 465 | MimeType mt(type()); |
466 | that->d->mPixmaps[pos] = pos ? mt.bigPixmap() : mt.pixmap(); | 466 | that->d->mPixmaps[pos] = pos ? mt.bigPixmap() : mt.pixmap(); |
467 | if ( that->d->mPixmaps[pos].isNull() ) | 467 | if ( that->d->mPixmaps[pos].isNull() ) |
468 | that->d->mPixmaps[pos].convertFromImage( | 468 | that->d->mPixmaps[pos].convertFromImage( |
469 | Resource::loadImage("UnknownDocument") | 469 | Resource::loadImage("UnknownDocument") |
470 | .smoothScale( size, size ) ); | 470 | .smoothScale( size, size ) ); |
471 | return that->d->mPixmaps[pos]; | 471 | return that->d->mPixmaps[pos]; |
472 | } | 472 | } |
473 | |||
473 | QImage unscaledIcon = Resource::loadImage( that->mIconFile ); | 474 | QImage unscaledIcon = Resource::loadImage( that->mIconFile ); |
474 | if ( unscaledIcon.isNull() ) { | 475 | if ( unscaledIcon.isNull() ) { |
475 | // qDebug( "Cannot find icon: %s", that->mIconFile.latin1() ); | 476 | // qDebug( "Cannot find icon: %s", that->mIconFile.latin1() ); |
476 | that->d->mPixmaps[pos].convertFromImage( | 477 | that->d->mPixmaps[pos].convertFromImage( |
477 | Resource::loadImage("UnknownDocument") | 478 | Resource::loadImage("UnknownDocument") |
478 | .smoothScale( size, size ) ); | 479 | .smoothScale( size, size ) ); |
479 | } else { | 480 | } else { |
480 | that->d->mPixmaps[0].convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) ); | 481 | that->d->mPixmaps[0].convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) ); |
481 | that->d->mPixmaps[1].convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) ); | 482 | that->d->mPixmaps[1].convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) ); |
482 | } | 483 | } |
483 | return that->d->mPixmaps[pos]; | 484 | return that->d->mPixmaps[pos]; |
484 | } | 485 | } |
486 | |||
485 | return d->mPixmaps[pos]; | 487 | return d->mPixmaps[pos]; |
486 | } | 488 | } |
487 | 489 | ||
488 | /*! | 490 | /*! |
489 | Returns a small pixmap associated with the application. | 491 | Returns a small pixmap associated with the application. |
490 | 492 | ||
491 | \sa bigPixmap() setIcon() | 493 | \sa bigPixmap() setIcon() |
492 | */ | 494 | */ |
493 | const QPixmap& AppLnk::pixmap() const | 495 | const QPixmap& AppLnk::pixmap() const |
494 | { | 496 | { |
495 | if ( d->mPixmaps[0].isNull() ) { | 497 | if ( d->mPixmaps[0].isNull() ) { |
496 | return pixmap(AppLnkPrivate::Normal, smallSize ); | 498 | return pixmap(AppLnkPrivate::Normal, smallSize ); |
497 | } | 499 | } |
498 | return d->mPixmaps[0]; | 500 | return d->mPixmaps[0]; |
499 | } | 501 | } |
500 | 502 | ||
501 | /*! | 503 | /*! |
502 | Returns a large pixmap associated with the application. | 504 | Returns a large pixmap associated with the application. |
503 | 505 | ||
504 | \sa pixmap() setIcon() | 506 | \sa pixmap() setIcon() |
505 | */ | 507 | */ |
506 | const QPixmap& AppLnk::bigPixmap() const | 508 | const QPixmap& AppLnk::bigPixmap() const |
507 | { | 509 | { |
508 | if ( d->mPixmaps[1].isNull() ) { | 510 | if ( d->mPixmaps[1].isNull() ) { |