]> 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 5a11c0005b88ea5f748b7493b1fdce5afe00ab7a..06d0605381681f08b3c840d41d840588711d59f1 100644 (file)
 
 #include <kurl.h>
 
-#include <QtGui/QColor>
-#include <QtGui/QKeyEvent>
-#include <QtGui/QWidget>
+#include <QColor>
+#include <QKeyEvent>
+#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 QWidget
+class StatusBarSpaceInfo : public KCapacityBar
 {
     Q_OBJECT
 
@@ -41,38 +45,25 @@ public:
     virtual ~StatusBarSpaceInfo();
 
     void setUrl(const KUrl& url);
-    const KUrl& url() const
-    {
-        return m_url;
-    }
+    const KUrl& url() const;
 
 protected:
-    /** @see QWidget::paintEvent() */
-    virtual void paintEvent(QPaintEvent* event);
+    void showEvent(QShowEvent* event);
+    void hideEvent(QHideEvent* event);
 
 private slots:
-    void slotFoundMountPoint(const QString& mountPoint,
-                             quint64 kBSize,
-                             quint64 kBUsed,
-                             quint64 kBAvailable);
-    void showResult();
-
-    /** Refreshs the space information for the current set URL. */
+    /** Refreshes the space information for the current set URL. */
     void refresh();
 
 private:
-    /**
-     * Returns a color for the progress bar by respecting
-     * the given background color \a bgColor. It is assured
-     * that enough contrast is given to have a visual indication.
-     */
-    QColor progressColor(const QColor& bgColor) const;
-
-private:
-    KUrl m_url;
-    bool m_gettingSize;
     quint64 m_kBSize;
-    quint64 m_kBAvailable;
+    KUrl m_url;
+    QTimer* m_timer;
 };
 
+inline const KUrl& StatusBarSpaceInfo::url() const
+{
+    return m_url;
+}
+
 #endif