Get map properties from TiledScene #140

Open
obeezzy wants to merge 50 commits from obeezzy/get-map-properties into master
obeezzy commented 2017-12-29 08:23:28 +00:00 (Migrated from github.com)
No description provided.
kenvandine commented 2017-12-29 13:46:01 +00:00 (Migrated from github.com)

Could you please rebase the last commit on master?

Could you please rebase the last commit on master?
bjorn (Migrated from github.com) reviewed 2018-01-01 14:35:01 +00:00
@ -148,3 +148,3 @@
return QVariant::fromValue(m_layer->isVisible());
return m_properties.value(name);
return m_properties.value(name, defaultValue);
bjorn (Migrated from github.com) commented 2018-01-01 14:35:01 +00:00

I would suggest to do the contains check once and do case-insensitive comparison.

if (!m_properties.contains(name)) {
    if (name.compare("opacity", Qt::CaseInsensitive) == 0)
        return QVariant::fromValue(m_layer->opacity());
    ...
}

(this especially affects TiledObject::getProperty)

Though, I have to say that I don't understand why a case-insensitive check is used in the first place, but the code was already like that.

I would suggest to do the contains check once and do case-insensitive comparison. ```c++ if (!m_properties.contains(name)) { if (name.compare("opacity", Qt::CaseInsensitive) == 0) return QVariant::fromValue(m_layer->opacity()); ... } ``` (this especially affects `TiledObject::getProperty`) Though, I have to say that I don't understand why a case-insensitive check is used in the first place, but the code was already like that.
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mdkcore/Bacon2D!140
No description provided.