00001 #ifndef HOUSEKEEPER_H_ 00002 #define HOUSEKEEPER_H_ 00003 00004 class QSqlDatabase; 00005 00006 #include <qmutex.h> 00007 #include <qobject.h> 00008 #include <qfile.h> 00009 #include <qtextstream.h> 00010 #include <qprocess.h> 00011 00012 using namespace std; 00013 00014 class HouseKeeper 00015 { 00016 public: 00017 HouseKeeper(bool runthread, bool master); 00018 ~HouseKeeper(); 00019 00020 00021 protected: 00022 void RunHouseKeeping(void); 00023 static void *doHouseKeepingThread(void *param); 00024 00025 void RunMFD(void); 00026 static void *runMFDThread(void *param); 00027 00028 private: 00029 00030 bool wantToRun(const QString &dbTag, int period, int minhour, int maxhour); 00031 void updateLastrun(const QString &dbTag); 00032 QDateTime getLastRun(const QString &dbTag); 00033 void flushLogs(); 00034 void runFillDatabase(); 00035 void CleanupMyOldRecordings(void); 00036 void CleanupAllOldInUsePrograms(void); 00037 void CleanupOrphanedLivetvChains(void); 00038 void CleanupRecordedTables(void); 00039 void CleanupProgramListings(void); 00040 void RunStartupTasks(void); 00041 bool threadrunning; 00042 bool filldbRunning; 00043 bool isMaster; 00044 }; 00045 00046 #endif
1.5.5