MythTV  master
fillutil.cpp
Go to the documentation of this file.
1 // Qt headers
2 #include <QFile>
3 #include <QDir>
4 
5 // libmyth headers
6 #include "mythdirs.h"
7 
8 // filldata headers
9 #include "fillutil.h"
10 
11 bool 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 = QDir(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 GetConfDir(void)
Definition: mythdirs.cpp:224
QString SetupIconCacheDirectory(void)
Definition: fillutil.cpp:35
int FILE
Definition: mythburn.py:110