00001
00002 #include <qfile.h>
00003 #include <qdir.h>
00004
00005
00006 #include "mythcontext.h"
00007
00008
00009 #include "fillutil.h"
00010
00011 bool dash_open(QFile &file, const QString &filename, int m, FILE *handle)
00012 {
00013 bool retval = false;
00014 if (filename == "-")
00015 {
00016 if (handle == NULL)
00017 {
00018 handle = stdout;
00019 if (m & IO_ReadOnly)
00020 {
00021 handle = stdin;
00022 }
00023 }
00024 retval = file.open(m, handle);
00025 }
00026 else
00027 {
00028 file.setName(filename);
00029 retval = file.open(m);
00030 }
00031
00032 return retval;
00033 }
00034
00035 QString SetupIconCacheDirectory(void)
00036 {
00037 QString fileprefix = MythContext::GetConfDir();
00038
00039 QDir dir(fileprefix);
00040 if (!dir.exists())
00041 dir.mkdir(fileprefix);
00042
00043 fileprefix += "/channels";
00044
00045 dir = QDir(fileprefix);
00046 if (!dir.exists())
00047 dir.mkdir(fileprefix);
00048
00049 return fileprefix;
00050 }