]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/statusbarspaceinfo.h
* Use Nepomuk for getting the meta data instead of KFileMetaInfo.
[dolphin.git] / src / statusbarspaceinfo.h
index eaecae8b4606a83c97a75d5ca659b8520eb1d6cf..06d0605381681f08b3c840d41d840588711d59f1 100644 (file)
 
 #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
 
@@ -44,27 +47,18 @@ public:
     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