Changeset View
Changeset View
Standalone View
Standalone View
kcms/formats/kcmformats.cpp
Show First 20 Lines • Show All 309 Lines • ▼ Show 20 Line(s) | |||||
310 | { | 310 | { | ||
311 | const bool useDetailed = m_ui->checkDetailed->isChecked(); | 311 | const bool useDetailed = m_ui->checkDetailed->isChecked(); | ||
312 | 312 | | |||
313 | QLocale nloc; | 313 | QLocale nloc; | ||
314 | QLocale tloc; | 314 | QLocale tloc; | ||
315 | QLocale cloc; | 315 | QLocale cloc; | ||
316 | QLocale mloc; | 316 | QLocale mloc; | ||
317 | 317 | | |||
318 | QString str; | ||||
319 | QString glob = m_ui->comboGlobal->currentData().toString(); | ||||
320 | | ||||
318 | if (useDetailed) { | 321 | if (useDetailed) { | ||
319 | nloc = QLocale(m_ui->comboNumbers->currentData().toString()); | 322 | str = m_ui->comboNumbers->currentData().toString(); | ||
davidedmundson: I don't understand, why is this sometimes empty? | |||||
Sorry for delayed reply. In KCMFormats::initCombo we add locales to combo boxes. McPain: Sorry for delayed reply.
In KCMFormats::initCombo we add locales to combo boxes.
First we add… | |||||
320 | tloc = QLocale(m_ui->comboTime->currentData().toString()); | 323 | nloc = str.isEmpty() ? QLocale(glob) : QLocale(str); | ||
321 | cloc = QLocale(m_ui->comboCurrency->currentData().toString()); | 324 | | ||
322 | mloc = QLocale(m_ui->comboMeasurement->currentData().toString()); | 325 | str = m_ui->comboTime->currentData().toString(); | ||
323 | } else { | 326 | tloc = str.isEmpty() ? QLocale(glob) : QLocale(str); | ||
324 | nloc = QLocale(m_ui->comboGlobal->currentData().toString()); | 327 | | ||
325 | tloc = QLocale(m_ui->comboGlobal->currentData().toString()); | 328 | str = m_ui->comboCurrency->currentData().toString(); | ||
326 | cloc = QLocale(m_ui->comboGlobal->currentData().toString()); | 329 | cloc = str.isEmpty() ? QLocale(glob) : QLocale(str); | ||
327 | mloc = QLocale(m_ui->comboGlobal->currentData().toString()); | 330 | | ||
331 | str = m_ui->comboMeasurement->currentData().toString(); | ||||
332 | mloc = str.isEmpty() ? QLocale(glob) : QLocale(str); | ||||
333 | } else { | ||||
334 | nloc = QLocale(glob); | ||||
335 | tloc = QLocale(glob); | ||||
336 | cloc = QLocale(glob); | ||||
337 | mloc = QLocale(glob); | ||||
328 | } | 338 | } | ||
329 | 339 | | |||
330 | const QString numberExample = nloc.toString(1000.01); | 340 | const QString numberExample = nloc.toString(1000.01); | ||
331 | const QString timeExample = i18n("%1 (long format)", tloc.toString(QDateTime::currentDateTime())) + QStringLiteral("\n") + | 341 | const QString timeExample = i18n("%1 (long format)", tloc.toString(QDateTime::currentDateTime())) + QStringLiteral("\n") + | ||
332 | i18n("%1 (short format)", tloc.toString(QDateTime::currentDateTime(), QLocale::ShortFormat)); | 342 | i18n("%1 (short format)", tloc.toString(QDateTime::currentDateTime(), QLocale::ShortFormat)); | ||
333 | const QString currencyExample = cloc.toCurrencyString(24.00); | 343 | const QString currencyExample = cloc.toCurrencyString(24.00); | ||
334 | 344 | | |||
335 | QString measurementSetting; | 345 | QString measurementSetting; | ||
Show All 15 Lines |
I don't understand, why is this sometimes empty?