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