| 197 | } |
| 198 | |
| 199 | void State::ScopedBinding::init( const State &s, bool bind ) |
| 200 | { |
| 201 | if( !bind ) |
| 202 | { |
| 203 | return; |
| 204 | } |
| 205 | |
| 206 | m_savedComponents.reserve( s.m_implementation->m_components.size() ); |
| 207 | |
| 208 | for( Implementation::ComponentMap::const_iterator it=s.m_implementation->m_components.begin(); it!=s.m_implementation->m_components.end(); it++ ) |
| 209 | { |
| 210 | Implementation::ComponentMap::iterator cIt = m_currentState.m_implementation->m_components.find( it->first ); |
| 211 | if( !cIt->second.override ) |
| 212 | { |
| 213 | m_savedComponents.push_back( cIt->second.component ); |
| 214 | it->second.component->bind(); |
| 215 | cIt->second = it->second; |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | State::ScopedBinding::~ScopedBinding() |
| 221 | { |