diff --git a/src/gui/model/tangible.hpp b/src/gui/model/tangible.hpp index b7dd6204a..8efb5cf5d 100644 --- a/src/gui/model/tangible.hpp +++ b/src/gui/model/tangible.hpp @@ -100,7 +100,7 @@ namespace model { void markMsg (string m) { this->doMsg(m); } void markErr (string e) { this->doErr(e); } void markFlash() { this->doFlash();} - void mark(GenNode const& n) { this->doMark(n);} + void mark(GenNode const&); protected: virtual void doReset() =0; @@ -115,6 +115,24 @@ namespace model { private: }; + + + /** generic handler for all incoming "state mark" messages */ + inline void + Tangible::mark (GenNode const& stateMark) + { + if (stateMark.idi.getSym() == "Flash") + this->doFlash(); + else + if (stateMark.idi.getSym() == "Error") + this->doErr (stateMark.data.get()); + else + if (stateMark.idi.getSym() == "Message") + this->doMsg (stateMark.data.get()); + else + this->doMark(stateMark); + } + }} // namespace gui::model diff --git a/src/lib/diff/gen-node.hpp b/src/lib/diff/gen-node.hpp index cfccf8a3c..e75b266e5 100644 --- a/src/lib/diff/gen-node.hpp +++ b/src/lib/diff/gen-node.hpp @@ -284,8 +284,8 @@ namespace diff{ bool contains (X const& elm) const; - bool matches (GenNode const& o) const { return this->matches(o.idi); } ///< @note \em not comparing payload data. Use equality for that… - bool matches (ID const& id) const { return idi == id; } + bool matches (GenNode const& o) const { return this->matches(o.idi); } ///< @note _not_ comparing payload data. Use equality for that… + bool matches (ID const& id) const { return idi == id; } bool matches (int number) const { return data.matchNum(number);} bool matches (int64_t number) const { return data.matchNum(number);} bool matches (short number) const { return data.matchNum(number);}