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  vector<int> dd_dups;
39 };
40 using SourceList = vector<Source>;
41 
42 class FillData
43 {
44  public:
46  {
47  SetRefresh(1, true);
48  }
49 
50  void SetRefresh(int day, bool set);
51 
52  bool GrabDataFromFile(int id, QString &filename);
53  bool GrabData(const Source& source, int offset);
54  bool Run(SourceList &sourcelist);
55 
56  enum
57  {
58  kRefreshClear = 0xFFFF0,
59  kRefreshAll = 0xFFFF1,
60  };
61 
62  public:
65 
66  QString m_grabOptions;
67  uint m_maxDays {0};
68 
69  bool m_interrupted {false};
70  bool m_endOfData {false};
71  bool m_refreshTba {true};
72  bool m_needPostGrabProc {true};
73  bool m_onlyUpdateChannels {false};
74  bool m_channelUpdateRun {false};
75  bool m_noAllAtOnce {false};
76 
77  private:
78  QMap<uint,bool> m_refreshDay;
79  bool m_refreshAll {false};
80  mutable QStringList m_fatalErrors;
81 };
82 
83 #endif // _FILLDATA_H_
vector< Source > SourceList
Definition: filldata.h:40
QStringList m_fatalErrors
Definition: filldata.h:80
QString password
Definition: filldata.h:32
vector< int > dd_dups
Definition: filldata.h:38
QMap< uint, bool > m_refreshDay
Definition: filldata.h:78
XMLTVParser m_xmltvParser
Definition: filldata.h:64
QString xmltvgrabber_prefmethod
Definition: filldata.h:37
bool updateLastRunStart()
Definition: filldata.cpp:48
FillData()
Definition: filldata.h:45
QString m_grabOptions
Definition: filldata.h:66
ChannelData m_chanData
Definition: filldata.h:63
unsigned int uint
Definition: compat.h:140
QString lineupid
Definition: filldata.h:33
bool updateNextScheduledRun()
Definition: filldata.cpp:64
QString name
Definition: filldata.h:29
QString xmltvgrabber
Definition: filldata.h:30
bool updateLastRunEnd()
Definition: filldata.cpp:40
QString userid
Definition: filldata.h:31
bool updateLastRunStatus(QString &status)
Definition: filldata.cpp:57