diff options
author | anbr <vdr07@deltab.de> | 2010-12-21 20:36:58 +0100 |
---|---|---|
committer | anbr <vdr07@deltab.de> | 2010-12-21 20:36:58 +0100 |
commit | 10a33e14d6338ff004410413f6fe52810be43f67 (patch) | |
tree | 6f71b062e9235be1383a9e6c536fea336d400e6c /imagelist-item.c | |
download | vdr-plugin-dvdswitch-10a33e14d6338ff004410413f6fe52810be43f67.tar.gz vdr-plugin-dvdswitch-10a33e14d6338ff004410413f6fe52810be43f67.tar.bz2 |
release 0.1.0 from http://www.schmidtie.de/download/vdr-dvdswitch-0.1.0.tar.bz20.1.0
Diffstat (limited to 'imagelist-item.c')
-rw-r--r-- | imagelist-item.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/imagelist-item.c b/imagelist-item.c new file mode 100644 index 0000000..95a2cb2 --- /dev/null +++ b/imagelist-item.c @@ -0,0 +1,57 @@ +#include "imagelist-item.h" + +cImageListItem::cImageListItem(char *lname, char *sname, eFileInfo type, char *value, bool hide) +{ + LName = NULL; + SName = NULL; + Value = 0; + SString = NULL; + + Edit(lname, sname, type, value, hide); + + Debug(); +} + +cImageListItem::~ cImageListItem(void) +{ + free(LName); + free(SName); + free(Value); + free(SString); +} + +void cImageListItem::Edit(char *lname, char *sname, eFileInfo type, char *value, bool hide) +{ + DEBUG("New/Edit ImageListItem"); + Debug(); + + free(LName); + free(SName); + free(Value); + + LName = lname ? strdup(lname) : NULL; + SName = sname ? strdup(sname) : NULL; + + if(type == tFile && value && value[0] != '.') + asprintf(&Value, ".%s", value); + else + Value = value ? strdup(value) : NULL; + + fType = type; + HideExt = hide; + + MakeSetupString(); + + Debug(); +} + +void cImageListItem::Debug(void) +{ + DEBUG("Items:"); + DEBUG(" LongName: %s", LName); + DEBUG(" ShortName: %s", SName); + DEBUG(" FileType: %i", (int)fType); + DEBUG(" Value: %s", Value); + DEBUG(" Hide: %s", HideExt ? "TRUE" : "FALSE"); + DEBUG(" SaveString: %s", SString); +} |