MythTV  master
hardwareprofile.h
Go to the documentation of this file.
1 #ifndef HARDWAREPROFILE_H_
2 #define HARDWAREPROFILE_H_
3 
4 // QT headers
5 #include <QObject>
6 #include <QString>
7 #include <QDateTime>
8 
9 // MythDB headers
10 #include "mythbaseexp.h"
11 #include "housekeeper.h"
12 
13 extern const QString SMOLT_SERVER_LOCATION;
14 extern const QString SMOLT_TOKEN;
15 
16 class MBASE_PUBLIC HardwareProfile : public QObject
17 {
18  Q_OBJECT
19 
20  public:
22  ~HardwareProfile(void) = default;
23 
24  void Enable(void);
25  void Disable(void);
26 
27  void GenerateUUIDs(void);
28 
29  QString GetPrivateUUIDFromFile(void) const;
30  bool WritePrivateUUIDToFile(const QString &uuid);
31  QString GetPublicUUIDFromFile(void) const;
32  QString GetAdminPasswordFromFile(void) const;
33 
34  bool NeedsUpdate(void) const;
35  bool SubmitProfile(bool updateTime=true);
36  bool DeleteProfile(void);
37 
38  QString GetPublicUUID(void) const { return m_publicuuid; };
39  QString GetPrivateUUID(void) const { return m_uuid; };
40  QDateTime GetLastUpdate(void) const { return m_lastUpdate; };
41  QString GetProfileURL(void) const;
42  QString GetHardwareProfile(void) const;
43 
44  private:
45  bool m_enabled {false};
46  QString m_uuid;
47  QString m_publicuuid;
48  QDateTime m_lastUpdate;
50 };
51 
53 {
54  public:
55  HardwareProfileTask(void) : PeriodicHouseKeeperTask("HardwareProfiler",
56  2592000, // 30 days in seconds
57  0.96667f, // up to one day early
58  1.03333f, // up to one day late
59  86400, // retry daily on error
61  bool DoCheckRun(QDateTime now) override; // HouseKeeperTask
62  bool DoRun(void) override; // HouseKeeperTask
63  private:
64 
65 };
66 
67 #endif
QString GetPublicUUID(void) const
QDateTime m_lastUpdate
bool DoCheckRun(QDateTime now) override
QDateTime GetLastUpdate(void) const
QString m_hardwareProfile
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15
task is queued when HouseKeeper is started
Definition: housekeeper.h:35
Modified HouseKeeperTask for tasks to be run at a regular interval.
Definition: housekeeper.h:84
const QString SMOLT_SERVER_LOCATION
const QString SMOLT_TOKEN
QString GetPrivateUUID(void) const
task should only run once per machine e.g.
Definition: housekeeper.h:27
virtual bool DoRun(void)
Definition: housekeeper.h:66