-rw-r--r-- | library/applnk.cpp | 84 |
1 files changed, 43 insertions, 41 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp index 80f2c62..c82d3b9 100644 --- a/library/applnk.cpp +++ b/library/applnk.cpp | |||
@@ -462,24 +462,26 @@ 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 | QImage unscaledIcon = Resource::loadImage( that->mIconFile ); | 473 | |
474 | if ( unscaledIcon.isNull() ) { | 474 | QImage unscaledIcon = Resource::loadImage( that->mIconFile ); |
475 | // qDebug( "Cannot find icon: %s", that->mIconFile.latin1() ); | 475 | if ( unscaledIcon.isNull() ) { |
476 | that->d->mPixmaps[pos].convertFromImage( | 476 | // qDebug( "Cannot find icon: %s", that->mIconFile.latin1() ); |
477 | Resource::loadImage("UnknownDocument") | 477 | that->d->mPixmaps[pos].convertFromImage( |
478 | .smoothScale( size, size ) ); | 478 | Resource::loadImage("UnknownDocument") |
479 | } else { | 479 | .smoothScale( size, size ) ); |
480 | that->d->mPixmaps[0].convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) ); | 480 | } else { |
481 | that->d->mPixmaps[1].convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) ); | 481 | that->d->mPixmaps[0].convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) ); |
482 | } | 482 | that->d->mPixmaps[1].convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) ); |
483 | return that->d->mPixmaps[pos]; | 483 | } |
484 | return that->d->mPixmaps[pos]; | ||
484 | } | 485 | } |
486 | |||
485 | return d->mPixmaps[pos]; | 487 | return d->mPixmaps[pos]; |
@@ -986,9 +988,9 @@ public : | |||
986 | AppLnkImagePrivate( const QString & ImageName ) { | 988 | AppLnkImagePrivate( const QString & ImageName ) { |
987 | IconName = ImageName; | 989 | IconName = ImageName; |
988 | Small = 0; | 990 | Small = 0; |
989 | Big = 0; | 991 | Big = 0; |
990 | } | 992 | } |
991 | ~AppLnkImagePrivate( ) { | 993 | ~AppLnkImagePrivate( ) { |
992 | if ( Small ) delete Small; | 994 | if ( Small ) delete Small; |
993 | if ( Big ) delete Big; | 995 | if ( Big ) delete Big; |
994 | } | 996 | } |
@@ -996,9 +998,9 @@ public : | |||
996 | inline QPixmap * small( void ) { | 998 | inline QPixmap * small( void ) { |
997 | if( ! Small ) { | 999 | if( ! Small ) { |
998 | QImage unscaledIcon = Resource::loadImage( IconName ); | 1000 | QImage unscaledIcon = Resource::loadImage( IconName ); |
999 | // works as long as smallSize remains static | 1001 | // works as long as smallSize remains static |
1000 | Small = new QPixmap(); | 1002 | Small = new QPixmap(); |
1001 | Small->convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) ); | 1003 | Small->convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) ); |
1002 | } | 1004 | } |
1003 | return Small; | 1005 | return Small; |
1004 | } | 1006 | } |
@@ -1006,9 +1008,9 @@ public : | |||
1006 | inline QPixmap * big( void ) { | 1008 | inline QPixmap * big( void ) { |
1007 | if( ! Big ) { | 1009 | if( ! Big ) { |
1008 | QImage unscaledIcon = Resource::loadImage( IconName ); | 1010 | QImage unscaledIcon = Resource::loadImage( IconName ); |
1009 | // works as long as bigSize remains static | 1011 | // works as long as bigSize remains static |
1010 | Big = new QPixmap(); | 1012 | Big = new QPixmap(); |
1011 | Big->convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) ); | 1013 | Big->convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) ); |
1012 | } | 1014 | } |
1013 | return Big; | 1015 | return Big; |
1014 | } | 1016 | } |
@@ -1127,3 +1129,3 @@ void AppLnkSet::findChildren(const QString &dr, const QString& typ, const QStrin | |||
1127 | if ( !typ.isEmpty() ) { | 1129 | if ( !typ.isEmpty() ) { |
1128 | d->typPix.insert( typ, | 1130 | d->typPix.insert( typ, |
1129 | new AppLnkImagePrivate( config.readEntry( "Icon", "AppsIcon" ) ) | 1131 | new AppLnkImagePrivate( config.readEntry( "Icon", "AppsIcon" ) ) |