]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/statusbar/statusbarspaceinfo.h
Add disk usage statistics menu to SpaceInfo widget in the status bar:
[dolphin.git] / src / statusbar / statusbarspaceinfo.h
index 7650c357fea395badc7e62646d96e11adb968a1b..2ba7cbf0b25488a843faf6a00a4ff8aa999beb12 100644 (file)
 #ifndef STATUSBARSPACEINFO_H
 #define STATUSBARSPACEINFO_H
 
-#include <kurl.h>
+#include <QUrl>
 
-#include <QColor>
-#include <QKeyEvent>
-#include <QString>
 
 #include <kcapacitybar.h>
 
 class QHideEvent;
 class QShowEvent;
+class QMouseEvent;
+
+class SpaceInfoObserver;
 
 /**
  * @short Shows the available space for the volume represented
@@ -43,21 +43,20 @@ public:
     explicit StatusBarSpaceInfo(QWidget* parent = 0);
     virtual ~StatusBarSpaceInfo();
 
-    void setUrl(const KUrl& url);
-    KUrl url() const;
+    void setUrl(const QUrl& url);
+    QUrl url() const;
 
 protected:
-    void showEvent(QShowEvent* event);
-    void hideEvent(QHideEvent* event);
+    void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
+    void hideEvent(QHideEvent* event) Q_DECL_OVERRIDE;
+    void mousePressEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
 
 private slots:
-    /** Refreshes the space information for the current set URL. */
-    void refresh();
+    void slotValuesChanged();
 
 private:
-    quint64 m_kBSize;
-    KUrl m_url;
-    QTimer* m_timer;
+    QScopedPointer<SpaceInfoObserver> m_observer;
+    QUrl m_url;
 };
 
 #endif