summaryrefslogtreecommitdiffstats
path: root/logic/BaseInstance.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-05-02 12:11:33 +0200
committerPetr Mrázek <peterix@gmail.com>2015-05-02 12:11:33 +0200
commitbb01c91469e3c5cbb250ce47c2d40f00f8be0c0a (patch)
tree5c7df25badb6b9d20d969b0a822165332be399da /logic/BaseInstance.cpp
parentfb3c9efc8a08b5148cb56cdde7a9998508962a5a (diff)
downloadMultiMC-bb01c91469e3c5cbb250ce47c2d40f00f8be0c0a.tar
MultiMC-bb01c91469e3c5cbb250ce47c2d40f00f8be0c0a.tar.gz
MultiMC-bb01c91469e3c5cbb250ce47c2d40f00f8be0c0a.tar.lz
MultiMC-bb01c91469e3c5cbb250ce47c2d40f00f8be0c0a.tar.xz
MultiMC-bb01c91469e3c5cbb250ce47c2d40f00f8be0c0a.zip
NOISSUE do not propagate instance change events when nothing actually changed
Diffstat (limited to 'logic/BaseInstance.cpp')
-rw-r--r--logic/BaseInstance.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/logic/BaseInstance.cpp b/logic/BaseInstance.cpp
index 1c6d3e4b..e048f475 100644
--- a/logic/BaseInstance.cpp
+++ b/logic/BaseInstance.cpp
@@ -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);