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 typedef vector<Source> SourceList;
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:
66 
67  QString m_logged_in;
68  QString m_lastdduserid;
69  QString m_graboptions;
70  int m_raw_lineup {0};
71  uint m_maxDays {0};
72 
73  bool m_interrupted {false};
74  bool m_endofdata {false};
75  bool m_refresh_tba {true};
76  bool m_dd_grab_all {false};
77  bool m_dddataretrieved {false};
78  bool m_need_post_grab_proc {true};
79  bool m_only_update_channels {false};
80  bool m_channel_update_run {false};
81  bool m_no_allatonce {false};
82 
83  private:
84  QMap<uint,bool> m_refresh_day;
85  bool m_refresh_all {false};
86  mutable QStringList m_fatalErrors;
87 };
88 
89 #endif // _FILLDATA_H_
QStringList m_fatalErrors
Definition: filldata.h:86
QString password
Definition: filldata.h:32
vector< int > dd_dups
Definition: filldata.h:38
QString xmltvgrabber_prefmethod
Definition: filldata.h:37
bool updateLastRunStart()
Definition: filldata.cpp:48
FillData()
Definition: filldata.h:45
unsigned int uint
Definition: compat.h:140
QString m_lastdduserid
Definition: filldata.h:68
XMLTVParser m_xmltv_parser
Definition: filldata.h:65
QString m_logged_in
Definition: filldata.h:67
vector< Source > SourceList
Definition: filldata.h:40
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
ChannelData m_chan_data
Definition: filldata.h:64
QMap< uint, bool > m_refresh_day
Definition: filldata.h:84
QString userid
Definition: filldata.h:31
bool updateLastRunStatus(QString &status)
Definition: filldata.cpp:57
ProgramData m_prog_data
Definition: filldata.h:63
QString m_graboptions
Definition: filldata.h:69