mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #571, allow to select distributor by key or alias
* removed redundant getId function * functions for completer
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user