Changeset 11071 for code/trunk/src/libraries/core/input/InputBuffer.cc
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/input/InputBuffer.cc
r9667 r11071 75 75 InputBuffer::~InputBuffer() 76 76 { 77 for (std::list<BaseInputBufferListenerTuple*>::const_iterator it = this->listeners_.begin(); 78 it != this->listeners_.end(); ++it) 79 delete *it; 77 for (BaseInputBufferListenerTuple* listener : this->listeners_) 78 delete listener; 80 79 } 81 80 … … 110 109 void InputBuffer::insert(const std::string& input, bool update) 111 110 { 112 for ( unsigned int i = 0; i < input.size(); ++i)113 { 114 this->insert(input [i], false);111 for (const char& inputChar : input) 112 { 113 this->insert(inputChar, false); 115 114 116 115 if (update) 117 this->updated(input [i], false);116 this->updated(inputChar, false); 118 117 } 119 118 … … 170 169 void InputBuffer::updated() 171 170 { 172 for ( std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)173 { 174 if ( (*it)->bListenToAllChanges_)175 (*it)->callFunction();171 for (BaseInputBufferListenerTuple* listener : this->listeners_) 172 { 173 if (listener->bListenToAllChanges_) 174 listener->callFunction(); 176 175 } 177 176 } … … 179 178 void InputBuffer::updated(const char& update, bool bSingleInput) 180 179 { 181 for ( std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)182 { 183 if ((! (*it)->trueKeyFalseChar_) && ((*it)->bListenToAllChanges_ || ((*it)->char_ == update)) && (!(*it)->bOnlySingleInput_ || bSingleInput))184 (*it)->callFunction();180 for (BaseInputBufferListenerTuple* listener : this->listeners_) 181 { 182 if ((!listener->trueKeyFalseChar_) && (listener->bListenToAllChanges_ || (listener->char_ == update)) && (!listener->bOnlySingleInput_ || bSingleInput)) 183 listener->callFunction(); 185 184 } 186 185 } … … 201 200 return; 202 201 203 for ( std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)204 { 205 if ( (*it)->trueKeyFalseChar_ && ((*it)->key_ == evt.getKeyCode()))206 (*it)->callFunction();202 for (BaseInputBufferListenerTuple* listener : this->listeners_) 203 { 204 if (listener->trueKeyFalseChar_ && (listener->key_ == evt.getKeyCode())) 205 listener->callFunction(); 207 206 } 208 207
Note: See TracChangeset
for help on using the changeset viewer.