#include <QColor>
#include <QKeyEvent>
-#include <QProgressBar>
#include <QString>
+#include <kcapacitybar.h>
+
class KDiskFreeSp;
+class QHideEvent;
+class QShowEvent;
/**
* @short Shows the available space for the volume represented
* by the given URL as part of the status bar.
*/
-class StatusBarSpaceInfo : public QProgressBar
+class StatusBarSpaceInfo : public KCapacityBar
{
Q_OBJECT
void setUrl(const KUrl& url);
const KUrl& url() const;
- /** @see QProgressBar::text() */
- virtual QString text() const;
+protected:
+ void showEvent(QShowEvent* event);
+ void hideEvent(QHideEvent* event);
private slots:
- void slotFoundMountPoint(const QString& mountPoint,
- quint64 kBSize,
- quint64 kBUsed,
- quint64 kBAvailable);
-
- void slotDiskFreeSpaceDone();
-
/** Refreshes the space information for the current set URL. */
void refresh();
- void showGettingSizeInfo();
-
private:
- bool m_gettingSize;
- bool m_foundMountPoint;
+ quint64 m_kBSize;
KUrl m_url;
- QString m_text;
+ QTimer* m_timer;
};
inline const KUrl& StatusBarSpaceInfo::url() const