diff options
Diffstat (limited to 'src/statusbar/dolphinstatusbar.cpp')
| -rw-r--r-- | src/statusbar/dolphinstatusbar.cpp | 41 |
1 files changed, 22 insertions, 19 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; |
