From f20d0a7593344fac924827e10c2ac16a947f9707 Mon Sep 17 00:00:00 2001 From: Artem Grinev Date: Wed, 4 Nov 2020 03:24:58 +0300 Subject: [PATCH] [users] Name cleanup after transliteration --- src/modules/users/Config.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/modules/users/Config.cpp b/src/modules/users/Config.cpp index d657a0f2d..6a2709e9e 100644 --- a/src/modules/users/Config.cpp +++ b/src/modules/users/Config.cpp @@ -372,14 +372,13 @@ Config::setFullName( const QString& name ) emit fullNameChanged( name ); // 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 - cleanName = transliterate(cleanName); + QString cleanName = transliterate(name); #else - QRegExp rx( "[^a-zA-Z0-9 ]", Qt::CaseInsensitive ); - cleanName.replace( rx, " " ); + QString cleanName = name; #endif + cleanName = CalamaresUtils::removeDiacritics( cleanName ).replace( rx, " " ).toLower().simplified(); QStringList cleanParts = cleanName.split( ' ' );