Add silent flag to ScoreElement::name2type
This commit is contained in:
parent
fa1cf0abe0
commit
37df9aa2cb
2 changed files with 4 additions and 3 deletions
|
@ -689,12 +689,13 @@ 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);
|
||||
}
|
||||
if (!silent)
|
||||
qDebug("unknown type <%s>", qPrintable(s.toString()));
|
||||
return ElementType::INVALID;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue