From 072205626caec16f3028a9b698e792e525848581 Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Sat, 8 Feb 2014 02:05:33 +0100 Subject: Cache results of GUIObject::isConditionTrue() Signed-off-by: Vojtech Bocek Change-Id: Ia50f7c365b2dc0a65ee046bb42972e3594264878 --- gui/action.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'gui/action.cpp') diff --git a/gui/action.cpp b/gui/action.cpp index 951feb114..66ee5d6f0 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -144,16 +144,13 @@ int GUIAction::NotifyKey(int key) return 0; } -int GUIAction::NotifyVarChange(std::string varName, std::string value) +int GUIAction::NotifyVarChange(const std::string& varName, const std::string& value) { + GUIObject::NotifyVarChange(varName, value); + if (varName.empty() && !isConditionValid() && !mKey && !mActionW) doActions(); - - // This handles notifying the condition system of page start - if (varName.empty() && isConditionValid()) - NotifyPageSet(); - - if ((varName.empty() || IsConditionVariable(varName)) && isConditionValid() && isConditionTrue()) + else if((varName.empty() || IsConditionVariable(varName)) && isConditionValid() && isConditionTrue()) doActions(); return 0; -- cgit v1.2.3