MythTV master
fillutil.cpp
Go to the documentation of this file.
1// Qt headers
2#include <QDir>
3#include <QFile>
4
5// MythTV headers
7
8// filldata headers
9#include "fillutil.h"
10
11bool dash_open(QFile &file, const QString &filename, int m, FILE *handle)
12{
13 bool retval = false;
14 if (filename == "-")
15 {
16 if (handle == nullptr)
17 {
18 handle = stdout;
19 if (m & QIODevice::ReadOnly)
20 {
21 handle = stdin;
22 }
23 }
24 retval = file.open( handle, (QIODevice::OpenMode)m );
25 }
26 else
27 {
28 file.setFileName(filename);
29 retval = file.open( (QIODevice::OpenMode)m );
30 }
31
32 return retval;
33}
34
36{
37 QString fileprefix = GetConfDir();
38
39 QDir dir(fileprefix);
40 if (!dir.exists())
41 dir.mkdir(fileprefix);
42
43 fileprefix += "/channels";
44
45 dir.setPath(fileprefix);;
46 if (!dir.exists())
47 dir.mkdir(fileprefix);
48
49 return fileprefix;
50}
bool dash_open(QFile &file, const QString &filename, int m, FILE *handle)
Definition: fillutil.cpp:11
QString SetupIconCacheDirectory(void)
Definition: fillutil.cpp:35
QString GetConfDir(void)
Definition: mythdirs.cpp:263
int FILE
Definition: mythburn.py:138