summaryrefslogtreecommitdiff
path: root/core/launcher/startmenu.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/startmenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/startmenu.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp
index f17c7f8..b84eed8 100644
--- a/core/launcher/startmenu.cpp
+++ b/core/launcher/startmenu.cpp
@@ -139,30 +139,32 @@ void StartMenu::createAppEntry( QPopupMenu *menu, QDir dir, QString file )
{
if ( file.right(8) == ".desktop" ) {
AppLnk* applnk = new AppLnk( dir.path() + "/" + file );
if ( !applnk->isValid() ) {
delete applnk;
return;
}
if ( applnk->type() == "Separator" ) { // No tr
menu->insertSeparator();
delete applnk;
} else {
- QPixmap test;
- test.convertFromImage(
- Resource::loadImage( applnk->icon() ).smoothScale(
- AppLnk::smallIconSize(), AppLnk::smallIconSize() ), 0 );
-
- menu->insertItem( test, applnk->name(),
+ QPixmap test;
+ QImage img = Resource::loadImage( applnk->icon() );
+ if(!img.isNull() )
+ test.convertFromImage(
+ img.smoothScale(
+ AppLnk::smallIconSize(), AppLnk::smallIconSize() ), 0 );
+
+ menu->insertItem( test, applnk->name(),
currentItem + APPLNK_ID_OFFSET );
appLnks.insert( currentItem + APPLNK_ID_OFFSET, applnk );
currentItem++;
}
}
}
void StartMenu::createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool lot )
{
// do some sanity checks and collect information