MythTV  master
filldata.h
Go to the documentation of this file.
1 #ifndef FILLDATA_H
2 #define FILLDATA_H
3 
4 // C++ headers
5 #include <vector>
6 using namespace std;
7 
8 // Qt headers
9 #include <QString>
10 
11 // libmythtv headers
12 #include "programdata.h"
13 
14 // filldata headers
15 #include "channeldata.h"
16 #include "xmltvparser.h"
17 
18 #define REFRESH_MAX 21
19 
20 // helper functions to update mfdb status fields in settings
21 bool updateLastRunEnd();
22 bool updateLastRunStart();
23 bool updateLastRunStatus(QString &status);
25 
26 struct Source
27 {
28  int id {0};
29  QString name;
30  QString xmltvgrabber;
31  QString userid;
32  QString password;
33  QString lineupid;
34  bool xmltvgrabber_baseline {false};
35  bool xmltvgrabber_manualconfig {false};
36  bool xmltvgrabber_cache {false};
38 };
39 using SourceList = vector<Source>;
40 
41 class FillData
42 {
43  public:
45  {
46  SetRefresh(1, true);
47  }
48 
49  void SetRefresh(int day, bool set);
50 
51  bool GrabDataFromFile(int id, const QString &filename);
52  bool GrabData(const Source& source, int offset);
53  bool Run(SourceList &sourcelist);
54 
55  enum
56  {
57  kRefreshClear = 0xFFFF0,
58  kRefreshAll = 0xFFFF1,
59  };
60 
61  public:
64 
65  QString m_grabOptions;
66  uint m_maxDays {0};
67 
68  bool m_interrupted {false};
69  bool m_endOfData {false};
70  bool m_refreshTba {true};
71  bool m_needPostGrabProc {true};
72  bool m_onlyUpdateChannels {false};
73  bool m_channelUpdateRun {false};
74  bool m_noAllAtOnce {false};
75 
76  private:
77  QMap<uint,bool> m_refreshDay;
78  bool m_refreshAll {false};
79  mutable QStringList m_fatalErrors;
80 };
81 
82 #endif // FILLDATA_H
Source::lineupid
QString lineupid
Definition: filldata.h:33
FillData::m_fatalErrors
QStringList m_fatalErrors
Definition: filldata.h:79
SourceList
vector< Source > SourceList
Definition: filldata.h:39
ChannelData
Definition: channeldata.h:13
programdata.h
FillData::FillData
FillData()
Definition: filldata.h:44
updateLastRunEnd
bool updateLastRunEnd()
Definition: filldata.cpp:40
FillData::m_grabOptions
QString m_grabOptions
Definition: filldata.h:65
Source::xmltvgrabber_prefmethod
QString xmltvgrabber_prefmethod
Definition: filldata.h:37
Source
Definition: channelsettings.cpp:69
xmltvparser.h
Source::userid
QString userid
Definition: filldata.h:31
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:640
updateNextScheduledRun
bool updateNextScheduledRun()
Definition: filldata.cpp:64
FillData::m_chanData
ChannelData m_chanData
Definition: filldata.h:62
uint
unsigned int uint
Definition: compat.h:140
Source::name
QString name
Definition: filldata.h:29
XMLTVParser
Definition: xmltvparser.h:17
FillData
Definition: filldata.h:42
updateLastRunStart
bool updateLastRunStart()
Definition: filldata.cpp:48
channeldata.h
Source::password
QString password
Definition: filldata.h:32
updateLastRunStatus
bool updateLastRunStatus(QString &status)
Definition: filldata.cpp:57
FillData::m_xmltvParser
XMLTVParser m_xmltvParser
Definition: filldata.h:63
FillData::m_refreshDay
QMap< uint, bool > m_refreshDay
Definition: filldata.h:77
Source::xmltvgrabber
QString xmltvgrabber
Definition: filldata.h:30