NOISSUE do not propagate instance change events when nothing actually changed

This commit is contained in:
Petr Mrázek 2015-05-02 12:11:33 +02:00
parent fb3c9efc8a
commit bb01c91469

View File

@ -117,6 +117,9 @@ void BaseInstance::setFlags(const InstanceFlags &flags)
void BaseInstance::setFlag(const BaseInstance::InstanceFlag flag)
{
// nothing to set?
if(flag & m_flags)
return;
m_flags |= flag;
emit flagsChanged();
emit propertiesChanged(this);
@ -124,6 +127,9 @@ void BaseInstance::setFlag(const BaseInstance::InstanceFlag flag)
void BaseInstance::unsetFlag(const BaseInstance::InstanceFlag flag)
{
// nothing to unset?
if(!(flag & m_flags))
return;
m_flags &= ~flag;
emit flagsChanged();
emit propertiesChanged(this);