MCPcopy Create free account
hub / github.com/KDE/labplot / updateLocale

Method updateLocale

src/frontend/MainWin.cpp:2567–2577  ·  view source on GitHub ↗

! * set the default locale of the application to the locale specified in the application settings for the number format and options. */

Source from the content-addressed store, hash-verified

2565 * set the default locale of the application to the locale specified in the application settings for the number format and options.
2566 */
2567void 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.

Callers 1

handleSettingsChangesMethod · 0.45

Calls 1

groupFunction · 0.85

Tested by

no test coverage detected