Ich habe dafür das Verzeichneis var/share/icons vorgesehen. Könnte man aber noch ändern wenns aufgenommen würde. Ich denke mal, dass Diskussionen über dieses Thema damit gelöst werden könnten.
Könnte man das aufnehmen??
Code: Alles auswählen
Index: src/driver/framebuffer.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/framebuffer.cpp,v
retrieving revision 1.54
diff -u -r1.54 framebuffer.cpp
--- a/src/driver/framebuffer.cpp 21 Apr 2005 10:07:36 -0000 1.54
+++ b/src/driver/framebuffer.cpp 18 Apr 2007 06:50:08 -0000
@@ -516,6 +516,20 @@
return true;
}
+const char *CFrameBuffer::getIconFilePath(const std::string & filename)
+{
+ std::string iconFilePath, stdIconPath = iconBasePath + filename, backupIconDir = "var/share/icons/";
+ std::string backupIconPath = backupIconDir + filename;
+
+ if ((access(backupIconPath.c_str(), 0 ) != -1)) {
+ iconFilePath = backupIconPath;
+ }
+ else {
+ iconFilePath = stdIconPath;
+ }
+ return iconFilePath.c_str();
+}
+
bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const int y, const unsigned char offset)
{
if (!getActive())
@@ -524,12 +538,13 @@
struct rawHeader header;
uint16_t width, height;
int fd;
+ const char * iconfile = getIconFilePath(filename);
- fd = open((iconBasePath + filename).c_str(), O_RDONLY);
+ fd = open(iconfile, O_RDONLY);
if (fd == -1)
{
- printf("error while loading icon: %s%s\n", iconBasePath.c_str(), filename.c_str());
+ printf("error while loading icon: %s\n", iconfile);
return false;
}
Index: src/driver/framebuffer.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/framebuffer.h,v
retrieving revision 1.38
diff -u -r1.38 framebuffer.h
--- a/src/driver/framebuffer.h 17 Mar 2004 18:44:44 -0000 1.38
+++ b/src/driver/framebuffer.h 18 Apr 2007 06:50:08 -0000
@@ -79,6 +79,7 @@
__u16 red[256], green[256], blue[256], trans[256];
void paletteFade(int i, __u32 rgb1, __u32 rgb2, int level);
+ const char * getIconFilePath(const std::string & filename);
int kd_mode;
struct vt_mode vt_mode;