Add silent flag to ScoreElement::name2type

This commit is contained in:
Dmitri Ovodok 2018-07-06 19:59:39 +03:00
parent fa1cf0abe0
commit 37df9aa2cb
2 changed files with 4 additions and 3 deletions

View file

@ -689,13 +689,14 @@ QString ScoreElement::userName() const
// name2type
//---------------------------------------------------------
ElementType ScoreElement::name2type(const QStringRef& s)
ElementType ScoreElement::name2type(const QStringRef& s, bool silent)
{
for (int i = 0; i < int(ElementType::MAXTYPE); ++i) {
if (s == elementNames[i].name)
return ElementType(i);
}
qDebug("unknown type <%s>", qPrintable(s.toString()));
if (!silent)
qDebug("unknown type <%s>", qPrintable(s.toString()));
return ElementType::INVALID;
}

View file

@ -191,7 +191,7 @@ class ScoreElement {
virtual QString userName() const;
virtual ElementType type() const = 0;
static ElementType name2type(const QStringRef&);
static ElementType name2type(const QStringRef&, bool silent = false);
static const char* name(ElementType);
virtual QVariant getProperty(Pid) const = 0;