X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/8eb9b508ca87fb1d634d8b8ba62c054ed04466d2..85241a924:/src/statusbar/statusbarspaceinfo.h diff --git a/src/statusbar/statusbarspaceinfo.h b/src/statusbar/statusbarspaceinfo.h index 0a563ad13..0b0d787dd 100644 --- a/src/statusbar/statusbarspaceinfo.h +++ b/src/statusbar/statusbarspaceinfo.h @@ -20,16 +20,15 @@ #ifndef STATUSBARSPACEINFO_H #define STATUSBARSPACEINFO_H -#include +#include -#include -#include -#include - -#include +#include class QHideEvent; class QShowEvent; +class QMouseEvent; + +class SpaceInfoObserver; /** * @short Shows the available space for the volume represented @@ -40,24 +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: - /** Refreshes the space information for the current set URL. */ - void refresh(); + void slotValuesChanged(); private: - quint64 m_kBSize; - KUrl m_url; - QTimer* m_timer; + QScopedPointer m_observer; + QUrl m_url; + bool m_ready; + bool m_shown; }; #endif