mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-09 16:28:54 +01:00
Fix incorrect playlist column filesize for streams
This commit is contained in:
parent
a68d856074
commit
05b168aa04
@ -189,14 +189,18 @@ QString PlaylistDelegateBase::displayText(const QVariant &value, const QLocale&)
|
|||||||
if (v > 0) text = QString::number(v);
|
if (v > 0) text = QString::number(v);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case QMetaType::Long:
|
||||||
|
case QMetaType::LongLong: {
|
||||||
|
qint64 v = value.toLongLong();
|
||||||
|
if (v > 0) text = QString::number(v);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case QMetaType::Float:
|
case QMetaType::Float:
|
||||||
case QMetaType::Double: {
|
case QMetaType::Double: {
|
||||||
double v = value.toDouble();
|
double v = value.toDouble();
|
||||||
if (v > 0) text = QString::number(v);
|
if (v > 0) text = QString::number(v);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
text = value.toString();
|
text = value.toString();
|
||||||
break;
|
break;
|
||||||
@ -316,9 +320,9 @@ QString LengthItemDelegate::displayText(const QVariant &value, const QLocale&) c
|
|||||||
QString SizeItemDelegate::displayText(const QVariant &value, const QLocale&) const {
|
QString SizeItemDelegate::displayText(const QVariant &value, const QLocale&) const {
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
int bytes = value.toInt(&ok);
|
qint64 bytes = value.toLongLong(&ok);
|
||||||
|
|
||||||
if (ok) return Utilities::PrettySize(bytes);
|
if (ok && bytes > 0) return Utilities::PrettySize(static_cast<quint64>(bytes));
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user