Add internalUpdate for sync opreation 42/113242/1 accepted/tizen_3.0_ivi accepted/tizen/3.0/ivi/20170209.040219 submit/tizen_3.0/20170207.033810
authorSangjung Woo <sangjung.woo@samsung.com>
Tue, 7 Feb 2017 01:48:58 +0000 (10:48 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Tue, 7 Feb 2017 01:48:58 +0000 (10:48 +0900)
When the value of AMB object is updated, its related callback functions
also are called. However, there is a case that the value of AMB object
should be updated _internally_ without calling the callback functions.
In order to support this function, internalUpdate is newly added and its
value is always false except be set in the code.

Change-Id: I241f4859546db7436902f19bbb251e072f4f5dbc
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
lib/abstractpropertytype.h
plugins/common/dbusplugin.cpp

index 21f3d64..b85924e 100644 (file)
@@ -95,7 +95,7 @@ public:
 
        AbstractPropertyType(std::string property)
                : name(property), timestamp(amb::currentTime()), sequence(-1), zone(Zone::None), priority(Normal),
-                 valueQuality(amb::Quality::UncertainInitialValue)
+                 internalUpdate(false), valueQuality(amb::Quality::UncertainInitialValue)
        {
 
        }
@@ -238,6 +238,12 @@ public:
         */
        Priority priority;
 
+    /*!
+     * \brief internalUpdate is used to update the property value of AMB internally
+     * without calling its related callback functions.  Default value is false.
+     */
+       bool internalUpdate;
+
        /*!
         * \brief valueQuality is used to indicate the quality of the value
         * Each AMB property is given a default value.  valueQuality is a way to describe whether the value
index e56b403..ec32bad 100644 (file)
@@ -88,9 +88,11 @@ void DBusSink::propertyChanged(AbstractPropertyType *value)
                        VariantType* prop = i;
                        mTime = value->timestamp;
                        prop->updateValue(value);
-                       updateValue(prop);
+                       if (!value->internalUpdate)
+                               updateValue(prop);
                }
        }
+       value->internalUpdate = false;
 }
 
 const string DBusSink::uuid()