superkaramba
disksensor.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef DISKSENSOR_H
00011 #define DISKSENSOR_H
00012 #include "sensor.h"
00013 #include <tqmap.h>
00014 #include <tqstring.h>
00015 #include <tqtextcodec.h>
00016 #include <tqregexp.h>
00017 #include <tqstringlist.h>
00018 #include <kprocess.h>
00019 class DiskSensor : public Sensor
00020 {
00021 Q_OBJECT
00022
00023 public:
00024 DiskSensor(int msec );
00025 ~DiskSensor();
00026 void update();
00027 void setMaxValue( SensorParams *sp );
00028
00029 private:
00030 long getFreeSpace(TQString mntPt) const;
00031 long getUsedSpace(TQString mntPt) const;
00032 long getTotalSpace(TQString mntPt) const;
00033 int getPercentUsed(TQString mntPt) const;
00034 int getPercentFree(TQString mntPt) const;
00035
00036 KShellProcess ksp;
00037 TQString sensorResult;
00038
00039 TQMap<TQString,TQString> mntMap;
00040 TQStringList stringList;
00041
00042 int init;
00043
00044 private slots:
00045 void receivedStdout(TDEProcess *, char *buffer, int);
00046 void processExited(TDEProcess *);
00047
00048 signals:
00049 void initComplete();
00050
00051 };
00052 #endif // DISKSENSOR_H