00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 #ifndef DISKSENSOR_H
00011 #define DISKSENSOR_H
00012 #include "sensor.h"
00013 #include <qmap.h>
00014 #include <qstring.h>
00015 #include <qtextcodec.h>
00016 #include <qregexp.h>
00017 #include <qstringlist.h>
00018 #include <kprocess.h>
00019 class DiskSensor :  public Sensor
00020 {
00021 Q_OBJECT
00022 public:
00023   DiskSensor(int msec );
00024   ~DiskSensor();
00025   void update();
00026   void setMaxValue( SensorParams *sp );
00027 
00028 
00029 private:
00030   int getFreeSpace(QString mntPt) const;
00031   int getUsedSpace(QString mntPt) const;
00032   int getTotalSpace(QString mntPt) const;
00033   int getPercentUsed(QString mntPt) const;
00034   int getPercentFree(QString mntPt) const;
00035 
00036   KShellProcess ksp;
00037   QString sensorResult;
00038 
00039 QMap<QString,QString> mntMap;
00040 QStringList stringList;
00041 
00042 
00043 private slots:
00044 void receivedStdout(KProcess *, char *buffer, int);
00045 void processExited(KProcess *);
00046 
00047 
00048 };
00049 #endif // DISKSENSOR_H