summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2005-06-03 08:54:10 +0000
committerlordjaxom <lordjaxom>2005-06-03 08:54:10 +0000
commit8912c967697854c1d651b4bc37ed6898737cfbd4 (patch)
treea3efcde11963c48248fe0cb84579d025dc16c7b7
parentc8187fca32a6f0ff69eff09a83011e9ce45a20f6 (diff)
downloadvdr-plugin-text2skin-8912c967697854c1d651b4bc37ed6898737cfbd4.tar.gz
vdr-plugin-text2skin-8912c967697854c1d651b4bc37ed6898737cfbd4.tar.bz2
- replaced loading in cBitmap::Available with a mere access/glob
-rw-r--r--bitmap.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/bitmap.c b/bitmap.c
index a6a5fc7..60f95d7 100644
--- a/bitmap.c
+++ b/bitmap.c
@@ -1,5 +1,5 @@
/*
- * $Id: bitmap.c,v 1.10 2005/01/28 21:26:34 lordjaxom Exp $
+ * $Id: bitmap.c,v 1.11 2005/06/03 08:54:10 lordjaxom Exp $
*/
#include "bitmap.h"
@@ -89,8 +89,15 @@ cText2SkinBitmap *cText2SkinBitmap::Load(const std::string &Filename, int Alpha,
bool cText2SkinBitmap::Available(const std::string &Filename, int Alpha, int height, int width,
int colors)
{
- cText2SkinBitmap *bmp = Load(Filename, Alpha, height, width, colors, true);
- return bmp != NULL;
+ if ((int)Filename.find('*') != -1) {
+ bool result = false;
+ glob_t gbuf;
+ if (glob(Filename.c_str(), 0, NULL, &gbuf) == 0)
+ result = true;
+ globfree(&gbuf);
+ return result;
+ } else
+ return access(Filename.c_str(), F_OK) == 0;
}
cText2SkinBitmap::cText2SkinBitmap(void) {