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