fix: Show default names in Companion if switch/source names only spaces (#1524)
This commit is contained in:
@@ -176,7 +176,7 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
|
||||
else if (isStick(&genAryIdx))
|
||||
result = QString(generalSettings->stickName[genAryIdx]);
|
||||
}
|
||||
if (result.isEmpty())
|
||||
if (result.trimmed().isEmpty())
|
||||
result = Boards::getAnalogInputName(board, index);
|
||||
return result;
|
||||
|
||||
@@ -191,7 +191,7 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
|
||||
|
||||
case SOURCE_TYPE_SWITCH:
|
||||
if (generalSettings)
|
||||
result = QString(generalSettings->switchName[index]);
|
||||
result = QString(generalSettings->switchName[index]).trimmed();
|
||||
if (result.isEmpty())
|
||||
result = Boards::getSwitchInfo(board, index).name;
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user