Fixed "beautify real name"

This commit is contained in:
Klaus Basan
2018-01-21 02:48:43 +01:00
parent 8eabd468af
commit 5e53f22ad7

View File

@@ -168,7 +168,10 @@ namespace BlackMisc
int lc = 0; int lc = 0;
for (const QChar ch : realName) for (const QChar ch : realName)
{ {
if (uc > 1 && lc > 1) { return newRealName; } // mixed case name, no need to beautify // Joe Doe -> valid
// jOE dOE -> invalid
// Joe McArthur -> valid
if (uc > 1 && lc > 2 && lc > uc) { return newRealName; } // mixed case name, no need to beautify
if (ch.isLower()) { lc++; continue; } if (ch.isLower()) { lc++; continue; }
if (ch.isUpper()) { uc++; continue;} if (ch.isUpper()) { uc++; continue;}
} }