Simplified logic a bit, made punctuation handling more correct
This commit is contained in:
parent
da5fb2d3e1
commit
ca033583a4
@ -307,12 +307,15 @@ transliterate( const QString& input )
|
|||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto transliterable = icu::UnicodeString( input.utf16() );
|
icu::UnicodeString transliterable( input.utf16() );
|
||||||
|
|
||||||
transliterator->transliterate( transliterable );
|
transliterator->transliterate( transliterable );
|
||||||
|
|
||||||
return QString::fromUtf16( transliterable.getTerminatedBuffer() );
|
return QString::fromUtf16( transliterable.getTerminatedBuffer() );
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static QString
|
||||||
|
transliterate( const QString& input )
|
||||||
|
{
|
||||||
|
return input;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -374,13 +377,8 @@ Config::setFullName( const QString& name )
|
|||||||
|
|
||||||
// Build login and hostname, if needed
|
// Build login and hostname, if needed
|
||||||
static QRegExp rx( "[^a-zA-Z0-9 ]", Qt::CaseInsensitive );
|
static QRegExp rx( "[^a-zA-Z0-9 ]", Qt::CaseInsensitive );
|
||||||
#ifdef HAVE_ICU
|
|
||||||
QString cleanName = transliterate(name);
|
QString cleanName = CalamaresUtils::removeDiacritics( transliterate( name ) ).replace( QRegExp( "[-']" ), "").replace( rx, " " ).toLower().simplified();
|
||||||
cleanName.replace("'", "");
|
|
||||||
#else
|
|
||||||
QString cleanName = name;
|
|
||||||
#endif
|
|
||||||
cleanName = CalamaresUtils::removeDiacritics( cleanName ).replace( rx, " " ).toLower().simplified();
|
|
||||||
|
|
||||||
|
|
||||||
QStringList cleanParts = cleanName.split( ' ' );
|
QStringList cleanParts = cleanName.split( ' ' );
|
||||||
|
Loading…
Reference in New Issue
Block a user