summaryrefslogtreecommitdiff
authorzecke <zecke>2004-02-05 15:57:13 (UTC)
committer zecke <zecke>2004-02-05 15:57:13 (UTC)
commit823399a552c04821fb0b49d816d733fa21a12a21 (patch) (side-by-side diff)
treea5683ede5436c6b912a89d4ccc6cd63953214ea4
parent8cb0ae68f155c989cb9533c1f04d04ec64083708 (diff)
downloadopie-823399a552c04821fb0b49d816d733fa21a12a21.zip
opie-823399a552c04821fb0b49d816d733fa21a12a21.tar.gz
opie-823399a552c04821fb0b49d816d733fa21a12a21.tar.bz2
Stop trying to scale a null image
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/startmenu.cpp4
1 files changed, 3 insertions, 1 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
@@ -128,50 +128,52 @@ void StartMenu::itemSelected( int id )
appLnk->execute();
}
} else {
QString *tabName = tabNames.find( id );
if ( tabName ) {
emit tabSelected( *tabName );
}
}
}
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;
+ QImage img = Resource::loadImage( applnk->icon() );
+ if(!img.isNull() )
test.convertFromImage(
- Resource::loadImage( applnk->icon() ).smoothScale(
+ 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
if ( file == "." || file == ".." ) return;
Config cfg( dir.path() + "/" + file + "/.directory", Config::File );
if ( !cfg.isValid() ) return;
QString name = cfg.readEntry( "Name" );
QString icon = cfg.readEntry( "Icon" );
if ( !name || !icon ) return;