[users] Name cleanup after transliteration

This commit is contained in:
Artem Grinev 2020-11-04 03:24:58 +03:00
parent aa5ef7a6b8
commit f20d0a7593

View File

@ -372,14 +372,13 @@ Config::setFullName( const QString& name )
emit fullNameChanged( name ); emit fullNameChanged( name );
// Build login and hostname, if needed // Build login and hostname, if needed
QString cleanName = CalamaresUtils::removeDiacritics( name ).toLower().simplified(); static QRegExp rx( "[^a-zA-Z0-9 ]", Qt::CaseInsensitive );
#ifdef HAVE_ICU #ifdef HAVE_ICU
cleanName = transliterate(cleanName); QString cleanName = transliterate(name);
#else #else
QRegExp rx( "[^a-zA-Z0-9 ]", Qt::CaseInsensitive ); QString cleanName = name;
cleanName.replace( rx, " " );
#endif #endif
cleanName = CalamaresUtils::removeDiacritics( cleanName ).replace( rx, " " ).toLower().simplified();
QStringList cleanParts = cleanName.split( ' ' ); QStringList cleanParts = cleanName.split( ' ' );