]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/statusbar/dolphinstatusbar.h
Output of licensedigger + manual cleanup afterwards.
[dolphin.git] / src / statusbar / dolphinstatusbar.h
index 4d6dbb20fb2b526f397d547621388333448995e9..b34f802036508147cde3617fafd85fa16262779f 100644 (file)
@@ -1,21 +1,8 @@
-/***************************************************************************
- *   Copyright (C) 2006-2012 by Peter Penz <peter.penz19@gmail.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: 2006-2012 Peter Penz <peter.penz19@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #ifndef DOLPHINSTATUSBAR_H
 #define DOLPHINSTATUSBAR_H
 #include <QTime>
 #include <QWidget>
 
-class KUrl;
+class QUrl;
 class StatusBarSpaceInfo;
 class QLabel;
 class QProgressBar;
 class QToolButton;
 class QSlider;
 class QTimer;
+class KSqueezedTextLabel;
 
 /**
  * @brief Represents the statusbar of a Dolphin view.
@@ -42,8 +30,8 @@ class DolphinStatusBar : public QWidget
     Q_OBJECT
 
 public:
-    DolphinStatusBar(QWidget* parent);
-    virtual ~DolphinStatusBar();
+    explicit DolphinStatusBar(QWidget* parent);
+    ~DolphinStatusBar() override;
 
     QString text() const;
 
@@ -66,8 +54,7 @@ public:
 
     /**
      * Replaces the text set by setText() by the text that
-     * has been set by setDefaultText(). It is assured that the previous
-     * text will be shown for at least 1 second. DolphinStatusBar::text()
+     * has been set by setDefaultText(). DolphinStatusBar::text()
      * will return an empty string after the reset has been done.
      */
     void resetToDefaultText();
@@ -79,7 +66,7 @@ public:
     void setDefaultText(const QString& text);
     QString defaultText() const;
 
-    KUrl url() const;
+    QUrl url() const;
     int zoomLevel() const;
 
     /**
@@ -87,9 +74,14 @@ public:
      */
     void readSettings();
 
+    /**
+     * Refreshes the disk space information.
+     */
+    void updateSpaceInfo();
+
 public slots:
     void setText(const QString& text);
-    void setUrl(const KUrl& url);
+    void setUrl(const QUrl& url);
     void setZoomLevel(int zoomLevel);
 
 signals:
@@ -101,8 +93,7 @@ signals:
     void zoomLevelChanged(int zoomLevel);
 
 protected:
-    virtual void contextMenuEvent(QContextMenuEvent* event);
-    virtual bool eventFilter(QObject* obj, QEvent* event);
+    void contextMenuEvent(QContextMenuEvent* event) override;
 
 private slots:
     void showZoomSliderToolTip(int zoomLevel);
@@ -114,14 +105,6 @@ private slots:
      */
     void updateLabelText();
 
-    /**
-     * Is invoked by m_resetToDefaultTextTimer and clears
-     * m_text so that the default text will be shown. This
-     * prevents that information-messages will be cleared
-     * too fast.
-     */
-    void slotResetToDefaultText();
-
     /**
      * Updates the text of the zoom slider tooltip to show
      * the currently used size.
@@ -140,7 +123,7 @@ private:
 private:
     QString m_text;
     QString m_defaultText;
-    QLabel* m_label;
+    KSqueezedTextLabel* m_label;
     StatusBarSpaceInfo* m_spaceInfo;
 
     QSlider* m_zoomSlider;
@@ -151,7 +134,7 @@ private:
     int m_progress;
     QTimer* m_showProgressBarTimer;
 
-    QTimer* m_resetToDefaultTextTimer;
+    QTimer* m_delayUpdateTimer;
     QTime m_textTimestamp;
 };