refs #571, allow to select distributor by key or alias

* removed redundant getId function
* functions for completer
This commit is contained in:
Klaus Basan
2016-01-12 01:16:44 +01:00
parent 0dda9024d1
commit 9f646f215c
6 changed files with 53 additions and 28 deletions

View File

@@ -16,9 +16,9 @@ namespace BlackMisc
{
CDistributor::CDistributor() { }
CDistributor::CDistributor(const QString &id)
CDistributor::CDistributor(const QString &key)
{
this->setDbKey(id);
this->setDbKey(key);
}
CDistributor::CDistributor(const QString &id, const QString &description, const QString &alias1, const QString &alias2) :
@@ -27,11 +27,11 @@ namespace BlackMisc
this->setDbKey(id);
}
bool CDistributor::matchesIdOrAlias(const QString &idOrAlias) const
bool CDistributor::matchesKeyOrAlias(const QString &keyOrAlias) const
{
QString s(idOrAlias.trimmed().toUpper());
QString s(keyOrAlias.trimmed().toUpper());
if (s.isEmpty()) { return false; }
return (getId() == s || getAlias1() == s || getAlias2() == s);
return (getDbKey() == s || getAlias1() == s || getAlias2() == s);
}
CVariant CDistributor::propertyByIndex(const CPropertyIndex &index) const