refs #576, fixed livery filtering and editing

* fixed selector by stripping extra info before selecting
* correct reset of filter UI
* return livery object directly from form if already valid DB object
This commit is contained in:
Klaus Basan
2016-02-01 03:15:20 +01:00
parent 2498a1ad71
commit daa3c9be81
5 changed files with 49 additions and 8 deletions

View File

@@ -175,8 +175,15 @@ namespace BlackMisc
bool CLivery::isValidCombinedCode(const QString &candidate)
{
if (candidate.isEmpty()) { return false; }
if (candidate.count('.') != 1) { return false; }
return candidate.length() > 2;
if (candidate.startsWith(colorLiveryMarker()))
{
return candidate.length() > colorLiveryMarker().length() + 1;
}
else
{
if (candidate.count('.') != 1) { return false; }
return candidate.length() > 2;
}
}
const QString &CLivery::standardLiveryMarker()