Changeset View
Changeset View
Standalone View
Standalone View
src/widgetfactory.cpp
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 110 | else if (prop == QLatin1String("tags")) { | |||
---|---|---|---|---|---|
114 | std::sort(tags.begin(), tags.end(), [&](const QString& s1, const QString& s2){ return coll.compare(s1, s2) < 0; }); | 114 | std::sort(tags.begin(), tags.end(), [&](const QString& s1, const QString& s2){ return coll.compare(s1, s2) < 0; }); | ||
115 | widget = createTagWidget( tags, parent ); | 115 | widget = createTagWidget( tags, parent ); | ||
116 | } | 116 | } | ||
117 | else { | 117 | else { | ||
118 | KFormat form; | 118 | KFormat form; | ||
119 | // vHanda: FIXME: Add links! Take m_noLinks into consideration | 119 | // vHanda: FIXME: Add links! Take m_noLinks into consideration | ||
120 | QString valueString; | 120 | QString valueString; | ||
121 | 121 | | |||
122 | if (prop == QLatin1String("duration")) { | 122 | if (prop == QLatin1String("duration")) { | ||
123 | valueString = form.formatDuration(value.toInt() * 1000); | 123 | valueString = form.formatDuration(value.toInt() * 1000); | ||
124 | } else if (prop == QLatin1String("bitRate")) { | 124 | } else if (prop == QLatin1String("bitRate")) { | ||
125 | valueString = i18nc("@label bitrate (per second)", "%1/s", form.formatByteSize(value.toInt(), 0, KFormat::MetricBinaryDialect)); | 125 | valueString = i18nc("@label bitrate (per second)", "%1/s", form.formatByteSize(value.toInt(), 0, KFormat::MetricBinaryDialect)); | ||
elvisangelaccio: Please use `QLatin1String` for comparisons. | |||||
elvisangelaccio: This should go in another commit. | |||||
126 | } else if (prop == QLatin1String("sampleRate")) { | ||||
This could show "48,0 kHz". Is that what we want? Also, please add spaces before/after the division operator. elvisangelaccio: This could show "48,0 kHz". Is that what we want?
Also, please add spaces before/after the… | |||||
127 | valueString = i18nc("@label samplerate in kilohertz", "%1 kHz", QLocale().toString(value.toDouble() / 1000)); | ||||
Please only one change per commit. I meant to use QLatin1String only for the new sampleRate prop. I just fixed these 2 on master, please rebase this patch on top of it. elvisangelaccio: Please only one change per commit. I meant to use QLatin1String only for the new `sampleRate`… | |||||
Okay, sorry. I thought to fix everything while I'm at it. Will rebase and also make a new commit for the bitrate tonight. astippich: Okay, sorry. I thought to fix everything while I'm at it. Will rebase and also make a new… | |||||
126 | } else if (prop == QLatin1String("releaseYear")) { | 128 | } else if (prop == QLatin1String("releaseYear")) { | ||
127 | valueString = value.toString(); | 129 | valueString = value.toString(); | ||
128 | } else if (prop == QLatin1String("originUrl")) { | 130 | } else if (prop == QLatin1String("originUrl")) { | ||
129 | if (m_noLinks) { | 131 | if (m_noLinks) { | ||
130 | valueString = value.toString(); | 132 | valueString = value.toString(); | ||
131 | } else { | 133 | } else { | ||
132 | valueString = QStringLiteral("<a href=\"%1\">%1</a>").arg(value.toString()); | 134 | valueString = QStringLiteral("<a href=\"%1\">%1</a>").arg(value.toString()); | ||
133 | } | 135 | } | ||
▲ Show 20 Lines • Show All 196 Lines • Show Last 20 Lines |
Please use QLatin1String for comparisons.