* \brief Slot assigned to save button click.
*/
void ConfigTab::saveSettings() {
- const char* langs[5] = {"en", "cs", "ro", "pl", "lt"};
+ const char* langs[] = {"en", "cs", "ro", "pl", "lt"};
+ const unsigned langSize = sizeof(langs) / sizeof(char *);
QSettings settings("config/global.ini", QSettings::IniFormat);
- if(langs) {
- settings.setValue("lang", langs[langToSave]);
- settings.sync();
- }
+ settings.setValue("lang", langs[langToSave % langSize]);
+ settings.sync();
}
/**