make epixmap load images relative to enigma2 DATADIR
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 3 Oct 2005 19:12:05 +0000 (19:12 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 3 Oct 2005 19:12:05 +0000 (19:12 +0000)
lib/gui/epixmap.cpp

index dc99853..ca3e456 100644 (file)
@@ -14,8 +14,12 @@ void ePixmap::setPixmap(gPixmap *pixmap)
 
 void ePixmap::setPixmapFromFile(const char *filename)
 {
-       loadPNG(m_pixmap, filename);
-       
+       // use direct filename for absolute path or relative to enigma2 DATADIR otherwise
+       if (filename[0] == '/')
+               loadPNG(m_pixmap, filename);
+       else
+               loadPNG(m_pixmap, strcat(DATADIR "/enigma2/", filename));
+               
                // TODO
        getDesktop()->makeCompatiblePixmap(*m_pixmap);
        event(evtChangedPixmap);