]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/statusbar/statusbarspaceinfo.h
Merge branch 'release/20.04'
[dolphin.git] / src / statusbar / statusbarspaceinfo.h
index 1065d9f4554bd5a70d136c172e7eb494f954dfbb..0b0d787dd4f76e18daf1930653dd602989986feb 100644 (file)
 #ifndef STATUSBARSPACEINFO_H
 #define STATUSBARSPACEINFO_H
 
-#include <KUrl>
+#include <KCapacityBar>
 
-#include <QColor>
-#include <QKeyEvent>
-#include <QString>
-
-#include <kcapacitybar.h>
+#include <QUrl>
 
 class QHideEvent;
 class QShowEvent;
+class QMouseEvent;
 
 class SpaceInfoObserver;
 
@@ -42,22 +39,31 @@ 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 setUrl(const KUrl& url);
-    KUrl 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();
 
 private:
     QScopedPointer<SpaceInfoObserver> m_observer;
-    KUrl m_url;
+    QUrl m_url;
+    bool m_ready;
+    bool m_shown;
 };
 
 #endif