limit subtask list
[Sak.git] / backupper.h
bloba4a7d5890103dc491dcb7a11d023c40e866b95a9
1 #ifndef BACKUPPER_H_
2 #define BACKUPPER_H_
4 #include <QMap>
5 #include <QList>
6 #include <QDir>
7 #include <QDateTime>
9 const char BACKUPDATEFORMAT [] = "ddMMyyyyhhmmss";
11 class Backupper
13 public:
14 static const int m_nCyclicBackups = 5;
15 static const char m_format [14];
16 QMap<QString, QMap<QDateTime, QString> > m_cyclicBackups;
17 QDir m_dir;
19 Backupper();
20 void doCyclicBackup();
24 class Incremental
26 public:
27 struct Hit {
28 Hit(const QString& t="", const QString& st="", int d=0)
29 : task(t)
30 , subtask(st)
31 , duration(d) {}
32 QString task, subtask;
33 int duration;
35 QMap<QDateTime, Hit > foundPieces; // to be merged
36 QMap<QDateTime, Hit > addedPieces; // to be removed
37 QDateTime lastTimeStamp;
38 QList<QString> foundFiles;
39 QList<QString> addedFiles;
40 QDir m_dir;
41 Incremental();
42 // write a piece to file
43 void writePiece(const QString& task, const QString& subTask, const QDateTime& now, int value);
44 // add a piece to the list of found pieces
45 void addPiece(const QString& task, const QString& subTask, const QDateTime& now, int value);
46 void clearAddedPieces();
47 void clearMergedPieces();
50 #endif