]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinstatusbar.h
Forwardport 773570:
[dolphin.git] / src / dolphinstatusbar.h
index 445419c3fdc4cece814177b19262714e7b5a6b67..1a9aaa4c172c53ccd90709d8d0f103ceeba76712 100644 (file)
@@ -29,7 +29,6 @@ class StatusBarMessageLabel;
 class StatusBarSpaceInfo;
 class QProgressBar;
 class QLabel;
-class QTimer;
 
 /**
  * @brief Represents the statusbar of a Dolphin view.
@@ -37,7 +36,8 @@ class QTimer;
  * The statusbar allows to show messages and progress
  * information.
  */
-class DolphinStatusBar : public KHBox {
+class DolphinStatusBar : public KHBox
+{
     Q_OBJECT
 
 public:
@@ -53,7 +53,9 @@ public:
         Error
     };
 
-    DolphinStatusBar(DolphinView* parent = 0);
+    DolphinStatusBar(QWidget* parent,
+                     const KUrl& url);
+
     virtual ~DolphinStatusBar();
 
     /**
@@ -93,7 +95,10 @@ public:
      * operations.
      */
     void setProgress(int percent);
-    int progress() const { return m_progress; }
+    int progress() const
+    {
+        return m_progress;
+    }
 
     /**
      * Clears the message text of the status bar by replacing
@@ -108,7 +113,11 @@ public:
      * is cleared by DolphinStatusBar::clear().
      */
     void setDefaultText(const QString& text);
-    const QString& defaultText() const { return m_defaultText; }
+    const QString& defaultText() const;
+
+protected:
+    /** @see QWidget::resizeEvent() */
+    virtual void resizeEvent(QResizeEvent* event);
 
 private slots:
     void updateProgressInfo();
@@ -116,9 +125,16 @@ private slots:
     /**
      * Is invoked, when the URL of the DolphinView, where the
      * statusbar belongs too, has been changed. The space information
-     * is updated.
+     * content is updated.
+     */
+    void updateSpaceInfoContent(const KUrl& url);
+
+    /**
+     * Shows the space information if there is enough room to show it
+     * without the need to clip the status bar text. If the progress
+     * bar is shown, the space information won't be shown.
      */
-    void updateSpaceInfo(const KUrl& url);
+    void showSpaceInfo();
 
 private:
     StatusBarMessageLabel* m_messageLabel;
@@ -127,8 +143,6 @@ private:
     QLabel* m_progressText;
     QProgressBar* m_progressBar;
     int m_progress;
-
-    QString m_defaultText;
 };
 
 #endif