mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
1) Make sure that size qprogressbar is really updated after each change
2) Get rid of flicker when after changing partition new size is smaller than used space on old one - in this case setMaximum calls reset() 3) User proper value for comparison when checking if progressbar should be changed BUG: 163343 svn path=/trunk/KDE/kdebase/apps/; revision=818066
This commit is contained in:
parent
4a91b1c563
commit
13b2fc5570
1 changed files with 7 additions and 6 deletions
|
@ -66,17 +66,19 @@ void StatusBarSpaceInfo::slotFoundMountPoint(const QString& mountPoint,
|
|||
quint64 kBUsed,
|
||||
quint64 kBAvailable)
|
||||
{
|
||||
Q_UNUSED(kBSize);
|
||||
Q_UNUSED(mountPoint);
|
||||
|
||||
m_gettingSize = false;
|
||||
m_foundMountPoint = true;
|
||||
const bool valuesChanged = (kBUsed != static_cast<quint64>(value())) ||
|
||||
(kBAvailable != static_cast<quint64>(maximum()));
|
||||
(kBSize != static_cast<quint64>(maximum()));
|
||||
if (valuesChanged) {
|
||||
m_text = i18nc("@info:status Free disk space", "%1 free", KIO::convertSize(kBAvailable * 1024));
|
||||
setUpdatesEnabled(false);
|
||||
setMaximum(kBSize);
|
||||
setValue(kBUsed);
|
||||
setUpdatesEnabled(true);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,9 +90,8 @@ void StatusBarSpaceInfo::slotDiskFreeSpaceDone()
|
|||
|
||||
m_gettingSize = false;
|
||||
m_text = i18nc("@info:status", "Unknown size");
|
||||
setMinimum(0);
|
||||
setMaximum(0);
|
||||
setValue(0);
|
||||
update();
|
||||
}
|
||||
|
||||
void StatusBarSpaceInfo::refresh()
|
||||
|
@ -98,6 +99,7 @@ void StatusBarSpaceInfo::refresh()
|
|||
// KDiskFreeSpace is for local paths only
|
||||
if (!m_url.isLocalFile()) {
|
||||
m_text = i18nc("@info:status", "Unknown size");
|
||||
setValue(0);
|
||||
update();
|
||||
return;
|
||||
}
|
||||
|
@ -133,9 +135,8 @@ void StatusBarSpaceInfo::showGettingSizeInfo()
|
|||
{
|
||||
if (m_gettingSize) {
|
||||
m_text = i18nc("@info:status", "Getting size...");
|
||||
update();
|
||||
setMinimum(0);
|
||||
setMaximum(0);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue