X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Frs_eventhandler.cpp;h=a92775c000a6bc46ae54318b8e1bfa51cae9565c;hb=c715d05d11ffe2913fe3465ec43d456ee9b85964;hp=d12d76bab277ed44e100cd1a3aaed0725b2f15bc;hpb=937ade06241548bfbc7858705b3ce1c7778c3d88;p=architektonas diff --git a/src/base/rs_eventhandler.cpp b/src/base/rs_eventhandler.cpp index d12d76b..a92775c 100644 --- a/src/base/rs_eventhandler.cpp +++ b/src/base/rs_eventhandler.cpp @@ -132,7 +132,7 @@ void RS_EventHandler::mouseReleaseEvent(QMouseEvent * e) } else { - if (defaultAction != NULL) + if (defaultAction) defaultAction->mouseReleaseEvent(e); else e->ignore(); @@ -144,7 +144,7 @@ void RS_EventHandler::mouseReleaseEvent(QMouseEvent * e) */ void RS_EventHandler::mouseMoveEvent(QMouseEvent * e) { - if (actionIndex >= 0 && currentActions[actionIndex] != NULL + if (actionIndex >= 0 && currentActions[actionIndex] && !currentActions[actionIndex]->isFinished()) { currentActions[actionIndex]->mouseMoveEvent(e); @@ -152,7 +152,7 @@ void RS_EventHandler::mouseMoveEvent(QMouseEvent * e) } else { - if (defaultAction!=NULL) + if (defaultAction) { defaultAction->mouseMoveEvent(e); e->accept(); @@ -375,7 +375,7 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e) } else { - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->commandMessage("Expression Syntax Error"); } @@ -388,7 +388,7 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e) // send command event directly to current action: if (!e->isAccepted()) { - if (actionIndex >= 0 && currentActions[actionIndex] != NULL + if (actionIndex >= 0 && currentActions[actionIndex] && !currentActions[actionIndex]->isFinished()) { currentActions[actionIndex]->commandEvent(e); @@ -396,7 +396,7 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e) } else { - if (defaultAction != NULL) + if (defaultAction) defaultAction->commandEvent(e); } } @@ -462,14 +462,14 @@ void RS_EventHandler::setCurrentAction(RS_ActionInterface * action) { RS_DEBUG->print("RS_EventHandler::setCurrentAction"); - if (action == NULL) + if (!action) return; // Predecessor of the new action or NULL: RS_ActionInterface * predecessor = NULL; // Suspend current action: - if (actionIndex >= 0 && currentActions[actionIndex] != NULL + if (actionIndex >= 0 && currentActions[actionIndex] && !currentActions[actionIndex]->isFinished()) { predecessor = currentActions[actionIndex]; @@ -478,7 +478,7 @@ void RS_EventHandler::setCurrentAction(RS_ActionInterface * action) } else { - if (defaultAction != NULL) + if (defaultAction) { predecessor = defaultAction; predecessor->suspend(); @@ -570,7 +570,7 @@ void RS_EventHandler::killAllActions() */ bool RS_EventHandler::hasAction() { - if (actionIndex != -1 || defaultAction != NULL) + if (actionIndex != -1 || defaultAction) return true; return false;