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 }
dash_open
bool dash_open(QFile &file, const QString &filename, int m, FILE *handle)
Definition: fillutil.cpp:11
build_compdb.file
file
Definition: build_compdb.py:55
mythdirs.h
mythburn.FILE
int FILE
Definition: mythburn.py:139
GetConfDir
QString GetConfDir(void)
Definition: mythdirs.cpp:224
SetupIconCacheDirectory
QString SetupIconCacheDirectory(void)
Definition: fillutil.cpp:35
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:640
hardwareprofile.distros.mythtv_data.main.stdout
stdout
Definition: main.py:87
dir
QDir dir
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1177
fillutil.h