source: src-qt4/life-preserver/LPWatcher.h @ 220bbd4

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since 220bbd4 was 220bbd4, checked in by Ken Moore <ken@…>, 16 months ago

Get the scrub/resilvering detection working for LPTray/LPWatcher. This is properly set for running/started/finished processes.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#ifndef _LP_WATCHER_H
2#define _LP_WATCHER_H
3
4#include <QObject>
5#include <QFileSystemWatcher>
6#include <QStringList>
7#include <QString>
8#include <QHash>
9#include <QTimer>
10#include <QFile>
11#include <QTextStream>
12#include <QDebug>
13
14#include "LPBackend.h"
15
16class LPWatcher : public QObject{
17        Q_OBJECT
18public:
19        LPWatcher();
20        ~LPWatcher();
21
22        QStringList getMessages(QString type, QStringList msgList);
23        QStringList getAllCurrentMessages();
24        bool isRunning();
25        bool hasError();
26
27public slots:
28        void start();
29        void stop();
30
31private:
32        //Internal paths for the lpreserver output files
33        QString FILE_LOG, FILE_ERROR, FILE_REPLICATION;
34        //Internal message Logs
35        QHash<unsigned int,QString> LOGS;
36        //File system watcher
37        QFileSystemWatcher *watcher;
38        QTimer *timer;
39        int sysCheckTime;
40        QFile *logfile, *repfile;
41        QTextStream *LFSTREAM, *RFSTREAM;
42        //Replication size variables
43        QString repTotK, lastSize;
44
45        void readLogFile(bool quiet = false);
46        void readReplicationFile(bool quiet = false);
47
48        void startRepFileWatcher();
49        void stopRepFileWatcher();
50
51        double displayToDoubleK(QString); // string->double conversion
52
53private slots:
54        void fileChanged(QString); //file system watcher saw a change
55        void checkPoolStatus(); //check for serious system errors
56
57signals:
58        void MessageAvailable(QString type);
59        void StatusUpdated();
60};
61
62#endif
Note: See TracBrowser for help on using the repository browser.