Changeset View
Changeset View
Standalone View
Standalone View
runners/converter/converterrunner.cpp
Show First 20 Lines • Show All 207 Lines • ▼ Show 20 Line(s) | 206 | if (!unit2.isEmpty()) { | |||
---|---|---|---|---|---|
208 | if (!u.isNull() && u.isValid()) { | 208 | if (!u.isNull() && u.isValid()) { | ||
209 | units.append(u); | 209 | units.append(u); | ||
210 | config().writeEntry(category.name(), u.symbol()); | 210 | config().writeEntry(category.name(), u.symbol()); | ||
211 | } else { | 211 | } else { | ||
212 | const QStringList unitStrings = category.allUnits(); | 212 | const QStringList unitStrings = category.allUnits(); | ||
213 | QList<KUnitConversion::Unit> matchingUnits; | 213 | QList<KUnitConversion::Unit> matchingUnits; | ||
214 | foreach (const QString& s, unitStrings) { | 214 | foreach (const QString& s, unitStrings) { | ||
215 | if (s.startsWith(unit2, Qt::CaseInsensitive)) { | 215 | if (s.startsWith(unit2, Qt::CaseInsensitive)) { | ||
216 | matchingUnits << category.unit(s); | 216 | u = category.unit(s); | ||
217 | if (!matchingUnits.contains(u)) { | ||||
218 | matchingUnits << u; | ||||
219 | } | ||||
217 | } | 220 | } | ||
218 | } | 221 | } | ||
219 | units = matchingUnits; | 222 | units = matchingUnits; | ||
220 | if (units.count() == 1) { | 223 | if (units.count() == 1) { | ||
221 | config().writeEntry(category.name(), units[0].symbol()); | 224 | config().writeEntry(category.name(), units[0].symbol()); | ||
222 | } | 225 | } | ||
223 | } | 226 | } | ||
224 | } else { | 227 | } else { | ||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |