! * set the default locale of the application to the locale specified in the application settings for the number format and options. */
| 2565 | * set the default locale of the application to the locale specified in the application settings for the number format and options. |
| 2566 | */ |
| 2567 | void MainWin::updateLocale() { |
| 2568 | // language used for the number format |
| 2569 | const auto group = Settings::group(QStringLiteral("Settings_General")); |
| 2570 | auto language = static_cast<QLocale::Language>(group.readEntry(QLatin1String("NumberFormat"), static_cast<int>(QLocale::Language::AnyLanguage))); |
| 2571 | QLocale newLocale(language == QLocale::AnyLanguage ? m_defaultSystemLocale : language); |
| 2572 | |
| 2573 | // number options |
| 2574 | auto numberOptions = static_cast<QLocale::NumberOptions>(group.readEntry(QLatin1String("NumberOptions"), static_cast<int>(QLocale::DefaultNumberOptions))); |
| 2575 | newLocale.setNumberOptions(numberOptions); |
| 2576 | QLocale::setDefault(newLocale); |
| 2577 | } |
| 2578 | |
| 2579 | /*! |
| 2580 | * used to migrate application settings if there were changes between the releases. |
no test coverage detected