MythTV  master
fillutil.cpp
Go to the documentation of this file.
1 // Qt headers
2 #include <QDir>
3 #include <QFile>
4 
5 // MythTV headers
6 #include "libmythbase/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.setPath(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:256
SetupIconCacheDirectory
QString SetupIconCacheDirectory(void)
Definition: fillutil.cpp:35
hardwareprofile.distros.mythtv_data.main.stdout
stdout
Definition: main.py:87
build_compdb.filename
filename
Definition: build_compdb.py:21
fillutil.h