diff options
Diffstat (limited to 'src/statusbar')
| -rw-r--r-- | src/statusbar/dolphinstatusbar.cpp | 41 | ||||
| -rw-r--r-- | src/statusbar/dolphinstatusbar.h | 4 |
2 files changed, 24 insertions, 21 deletions
diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp index c36651e0b..79f2de2c4 100644 --- a/src/statusbar/dolphinstatusbar.cpp +++ b/src/statusbar/dolphinstatusbar.cpp @@ -191,6 +191,9 @@ QString DolphinStatusBar::progressText() const void DolphinStatusBar::setProgress(int percent) { + // show a busy indicator if a value < 0 is provided: + m_progressBar->setMaximum((percent < 0) ? 0 : 100); + if (percent < 0) { percent = 0; } else if (percent > 100) { @@ -206,7 +209,7 @@ void DolphinStatusBar::setProgress(int percent) m_progressBar->setValue(m_progress); if (!m_progressBar->isVisible() || (percent == 100)) { - QTimer::singleShot(300, this, SLOT(updateProgressInfo())); + updateProgressInfo(); } const QString& defaultText = m_messageLabel->defaultText(); @@ -252,24 +255,6 @@ void DolphinStatusBar::resizeEvent(QResizeEvent* event) QMetaObject::invokeMethod(this, "assureVisibleText", Qt::QueuedConnection); } -void DolphinStatusBar::updateProgressInfo() -{ - const bool isErrorShown = (m_messageLabel->type() == Error); - if (m_progress < 100) { - // show the progress information and hide the extensions - setExtensionsVisible(false); - if (!isErrorShown) { - m_progressText->show(); - m_progressBar->show(); - } - } else { - // hide the progress information and show the extensions - m_progressText->hide(); - m_progressBar->hide(); - assureVisibleText(); - } -} - void DolphinStatusBar::updateSpaceInfoContent(const KUrl& url) { m_spaceInfo->setUrl(url); @@ -322,6 +307,24 @@ void DolphinStatusBar::showZoomSliderToolTip(int zoomLevel) QApplication::sendEvent(m_zoomSlider, &toolTipEvent); } +void DolphinStatusBar::updateProgressInfo() +{ + const bool isErrorShown = (m_messageLabel->type() == Error); + if (m_progress < 100) { + // show the progress information and hide the extensions + setExtensionsVisible(false); + if (!isErrorShown) { + m_progressText->show(); + m_progressBar->show(); + } + } else { + // hide the progress information and show the extensions + m_progressText->hide(); + m_progressBar->hide(); + assureVisibleText(); + } +} + void DolphinStatusBar::setExtensionsVisible(bool visible) { bool spaceInfoVisible = visible; diff --git a/src/statusbar/dolphinstatusbar.h b/src/statusbar/dolphinstatusbar.h index a07313bab..2fed4788d 100644 --- a/src/statusbar/dolphinstatusbar.h +++ b/src/statusbar/dolphinstatusbar.h @@ -127,8 +127,6 @@ protected: virtual void resizeEvent(QResizeEvent* event); private slots: - void updateProgressInfo(); - /** * Is invoked, when the URL of the DolphinView, where the * statusbar belongs too, has been changed. The space information @@ -153,6 +151,8 @@ private slots: void showZoomSliderToolTip(int zoomLevel); private: + void updateProgressInfo(); + /** * Makes the space information widget and zoom slider widget * visible, if \a visible is true and the settings allow to show |
