mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-23 08:15:13 +03:00
Fixes #2432 - Perhaps some chars missing?
This commit is contained in:
parent
6d5ed8409c
commit
aac7384414
1 changed files with 29 additions and 1 deletions
|
@ -1394,6 +1394,34 @@ bool ModelData::isempty()
|
|||
return !used;
|
||||
}
|
||||
|
||||
QString removeAccents(const QString & str)
|
||||
{
|
||||
QString result = str;
|
||||
|
||||
// UTF-8 ASCII Table
|
||||
const QString tA[] = { "á", "â", "ã", "à" };
|
||||
const QString tE[] = { "é", "è", "ê", "ě" };
|
||||
const QString tI[] = { "í" };
|
||||
const QString tO[] = { "ó", "ô", "õ", "ö" };
|
||||
const QString tU[] = { "ú", "ü" };
|
||||
const QString tC[] = { "ç" };
|
||||
const QString tY[] = { "ý" };
|
||||
const QString tS[] = { "š" };
|
||||
const QString tR[] = { "ř" };
|
||||
|
||||
for (unsigned int i = 0; i < DIM(tA); i++) result.replace(tA[i], "a");
|
||||
for (unsigned int i = 0; i < DIM(tE); i++) result.replace(tE[i], "e");
|
||||
for (unsigned int i = 0; i < DIM(tI); i++) result.replace(tI[i], "i");
|
||||
for (unsigned int i = 0; i < DIM(tO); i++) result.replace(tO[i], "o");
|
||||
for (unsigned int i = 0; i < DIM(tU); i++) result.replace(tU[i], "u");
|
||||
for (unsigned int i = 0; i < DIM(tC); i++) result.replace(tC[i], "c");
|
||||
for (unsigned int i = 0; i < DIM(tY); i++) result.replace(tY[i], "y");
|
||||
for (unsigned int i = 0; i < DIM(tS); i++) result.replace(tS[i], "s");
|
||||
for (unsigned int i = 0; i < DIM(tR); i++) result.replace(tR[i], "r");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void ModelData::setDefaultInputs(const GeneralSettings & settings)
|
||||
{
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
|
@ -1403,7 +1431,7 @@ void ModelData::setDefaultInputs(const GeneralSettings & settings)
|
|||
expo->mode = INPUT_MODE_BOTH;
|
||||
expo->srcRaw = settings.getDefaultSource(i);
|
||||
expo->weight = 100;
|
||||
strncpy(inputNames[i], expo->srcRaw.toString(this).toLatin1().constData(), sizeof(inputNames[i])-1);
|
||||
strncpy(inputNames[i], removeAccents(expo->srcRaw.toString(this)).toLatin1().constData(), sizeof(inputNames[i])-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue