]> cloud.milkyroute.net Git - dolphin.git/blob - src/statusbar/spaceinfoobserver.h
Output of licensedigger + manual cleanup afterwards.
[dolphin.git] / src / statusbar / spaceinfoobserver.h
1 /*
2 * SPDX-FileCopyrightText: 2014 Frank Reininghaus <frank78ac@googlemail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #ifndef SPACEINFOOBSERVER_H
8 #define SPACEINFOOBSERVER_H
9
10 #include <KIO/Job>
11
12 #include <QObject>
13
14 class QUrl;
15 class MountPointObserver;
16
17 class SpaceInfoObserver : public QObject
18 {
19 Q_OBJECT
20
21 public:
22 explicit SpaceInfoObserver(const QUrl& url, QObject* parent = nullptr);
23 ~SpaceInfoObserver() override;
24
25 quint64 size() const;
26 quint64 available() const;
27
28 void setUrl(const QUrl& url);
29
30 public slots:
31 void update();
32
33 signals:
34 /**
35 * This signal is emitted when the size or available space changes.
36 */
37 void valuesChanged();
38
39 private slots:
40 void spaceInfoChanged(quint64 size, quint64 available);
41
42 private:
43 MountPointObserver* m_mountPointObserver;
44
45 bool m_hasData;
46 quint64 m_dataSize;
47 quint64 m_dataAvailable;
48 };
49
50 #endif