]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinstatusbar.cpp
remove kde4_automoc()
[dolphin.git] / src / dolphinstatusbar.cpp
index 26a373875ebb82f34d5a73b4ee2aacd3c8752ead..edf242e669bc6c48340e27c587441dab8d319140 100644 (file)
 #include "statusbarmessagelabel.h"
 #include "statusbarspaceinfo.h"
 
-#include <QLabel>
-#include <QProgressBar>
-#include <QTimer>
+#include <QtGui/QLabel>
+#include <QtGui/QProgressBar>
+#include <QtCore/QTimer>
 
 #include <kiconloader.h>
 #include <kvbox.h>
 
-DolphinStatusBar::DolphinStatusBar(DolphinView* parent) :
+DolphinStatusBar::DolphinStatusBar(QWidget* parent, const KUrl& url) :
     KHBox(parent),
     m_messageLabel(0),
     m_spaceInfo(0),
@@ -43,7 +43,7 @@ DolphinStatusBar::DolphinStatusBar(DolphinView* parent) :
     m_messageLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
 
     m_spaceInfo = new StatusBarSpaceInfo(this);
-    m_spaceInfo->setUrl(parent->url());
+    m_spaceInfo->setUrl(url);
 
     m_progressText = new QLabel(this);
     m_progressText->hide();
@@ -65,8 +65,7 @@ DolphinStatusBar::DolphinStatusBar(DolphinView* parent) :
 
 
 DolphinStatusBar::~DolphinStatusBar()
-{
-}
+{}
 
 void DolphinStatusBar::setMessage(const QString& msg,
                                   Type type)
@@ -105,8 +104,7 @@ void DolphinStatusBar::setProgress(int percent)
 {
     if (percent < 0) {
         percent = 0;
-    }
-    else if (percent > 100) {
+    } else if (percent > 100) {
         percent = 100;
     }
 
@@ -125,9 +123,8 @@ void DolphinStatusBar::setProgress(int percent)
     const QString& defaultText = m_messageLabel->defaultText();
     const QString msg(m_messageLabel->text());
     if ((percent == 0) && !msg.isEmpty()) {
-        setMessage(QString::null, Default);
-    }
-    else if ((percent == 100) && (msg != defaultText)) {
+        setMessage(QString(), Default);
+    } else if ((percent == 100) && (msg != defaultText)) {
         setMessage(defaultText, Default);
     }
 }
@@ -163,8 +160,7 @@ void DolphinStatusBar::updateProgressInfo()
             m_progressText->show();
             m_progressBar->show();
         }
-    }
-    else {
+    } else {
         // hide the progress information and show the space information
         m_progressText->hide();
         m_progressBar->hide();
@@ -191,8 +187,7 @@ void DolphinStatusBar::showSpaceInfo()
         if (isProgressBarVisible || (widthGap > 0)) {
             m_spaceInfo->hide();
         }
-    }
-    else if (widthGap + m_spaceInfo->width() <= 0) {
+    } else if (widthGap + m_spaceInfo->width() <= 0) {
         m_spaceInfo->show();
     }
 }