-rw-r--r-- | noncore/settings/networksettings2/networksettings2/netnode.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp index 4a2440a..110786a 100644 --- a/noncore/settings/networksettings2/networksettings2/netnode.cpp +++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp @@ -1,14 +1,17 @@ #include <time.h> #include <qpe/qpeapplication.h> +#include <qpe/resource.h> + + #include <qpainter.h> #include <qbitmap.h> #include <qtextstream.h> #include <qpixmap.h> #include "resources.h" #include "netnode.h" #include "asdevice.h" #include "asline.h" #include "asconnection.h" #include "asfullsetup.h" @@ -244,24 +247,27 @@ static char * State2PixmapTbl[] = { "disabled", // disabled "off", // off "disconnected", // available "connected" // up }; QPixmap NodeCollection::devicePixmap( void ) { QPixmap pm = NSResources->getPixmap( getToplevel()->nextNode()->pixmapName()+"-large"); QPixmap Mini = NSResources->getPixmap( device()->netNode()->pixmapName() ); + if( pm.isNull() || Mini.isNull() ) + return Resource::loadPixmap("Unknown"); + QPainter painter( &pm ); painter.drawPixmap( pm.width()-Mini.width(), pm.height()-Mini.height(), Mini ); pm.setMask( pm.createHeuristicMask( TRUE ) ); return pm; } QPixmap NodeCollection::statePixmap( State_t S) { return NSResources->getPixmap( State2PixmapTbl[S] ); } |