]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/statusbar/statusbarspaceinfo.h
Port away from QLinkedList
[dolphin.git] / src / statusbar / statusbarspaceinfo.h
index 48313a81c595375dea1b53d5ba289f65d1e56305..0b0d787dd4f76e18daf1930653dd602989986feb 100644 (file)
 #ifndef STATUSBARSPACEINFO_H
 #define STATUSBARSPACEINFO_H
 
-#include <QUrl>
-
+#include <KCapacityBar>
 
-#include <kcapacitybar.h>
+#include <QUrl>
 
 class QHideEvent;
 class QShowEvent;
+class QMouseEvent;
 
 class SpaceInfoObserver;
 
@@ -39,15 +39,22 @@ class StatusBarSpaceInfo : public KCapacityBar
     Q_OBJECT
 
 public:
-    explicit StatusBarSpaceInfo(QWidget* parent = 0);
-    virtual ~StatusBarSpaceInfo();
+    explicit StatusBarSpaceInfo(QWidget* parent = nullptr);
+    ~StatusBarSpaceInfo() override;
 
+    /**
+     * Use this to set the widget visibility as it can hide itself
+     */
+    void setShown(bool);
     void setUrl(const QUrl& url);
     QUrl url() const;
 
+    void update();
+
 protected:
-    void showEvent(QShowEvent* event);
-    void hideEvent(QHideEvent* event);
+    void showEvent(QShowEvent* event) override;
+    void hideEvent(QHideEvent* event) override;
+    void mousePressEvent(QMouseEvent* event) override;
 
 private slots:
     void slotValuesChanged();
@@ -55,6 +62,8 @@ private slots:
 private:
     QScopedPointer<SpaceInfoObserver> m_observer;
     QUrl m_url;
+    bool m_ready;
+    bool m_shown;
 };
 
 #endif