]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/statusbar/spaceinfoobserver.h
Fix up 2f208662cbd604f879027d3cd633a5ce59182a4f
[dolphin.git] / src / statusbar / spaceinfoobserver.h
index d2fb6ebf31ad88ae7b233ebffb00c1ef48db4359..f46c6cd6f61e16c9788fe125fb8068a4b13531dd 100644 (file)
@@ -1,28 +1,15 @@
-/***************************************************************************
- *   Copyright (C) 2014 by Frank Reininghaus <frank78ac@googlemail.com>    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2014 Frank Reininghaus <frank78ac@googlemail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #ifndef SPACEINFOOBSERVER_H
 #define SPACEINFOOBSERVER_H
 
 #include <QObject>
 
-class KUrl;
+class QUrl;
 class MountPointObserver;
 
 class SpaceInfoObserver : public QObject
@@ -30,22 +17,32 @@ class SpaceInfoObserver : public QObject
     Q_OBJECT
 
 public:
-    explicit SpaceInfoObserver(const KUrl& url, QObject* parent = 0);
-    virtual ~SpaceInfoObserver();
+    explicit SpaceInfoObserver(const QUrl &url, QObject *parent = nullptr);
+    ~SpaceInfoObserver() override;
 
     quint64 size() const;
     quint64 available() const;
 
-    void setUrl(const KUrl& url);
+    void setUrl(const QUrl &url);
 
-signals:
+public Q_SLOTS:
+    void update();
+
+Q_SIGNALS:
     /**
-     * This signal is emitted if the information that size() and/or available() will  return has changed.
+     * This signal is emitted when the size or available space changes.
      */
     void valuesChanged();
 
+private Q_SLOTS:
+    void spaceInfoChanged(quint64 size, quint64 available);
+
 private:
-    MountPointObserver* m_mountPointObserver;
+    MountPointObserver *m_mountPointObserver;
+
+    bool m_hasData;
+    quint64 m_dataSize;
+    quint64 m_dataAvailable;
 };
 
 #endif