Changeset 7987
- Timestamp:
- Feb 27, 2011, 11:32:08 AM (14 years ago)
- Location:
- code/branches/usability/src/modules/notifications
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/src/modules/notifications/NotificationManager.cc
r7552 r7987 103 103 { 104 104 // Destroys all NotificationQueues that have been registered with the NotificationManager. 105 for(std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.begin(); it != this->queues_.end(); it++) 105 std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.begin(); 106 while(it != this->queues_.end()) 107 { 106 108 it->second->destroy(true); 109 it = this->queues_.begin(); 110 } 107 111 108 112 this->queues_.clear(); … … 298 302 } 299 303 304 COUT(4) << "NotificationListener '" << identifier << "' unregistered with the NotificationManager." << std::endl; 305 300 306 // Remove the NotificationListener from the list of NotificationListeners. 301 307 this->listenerList_.erase(listener); 302 308 // Remove the Notifications list that was associated with the input NotificationListener. 303 309 this->notificationLists_.erase(identifier); 304 305 COUT(4) << "NotificationListener unregistered with the NotificationManager." << std::endl;306 310 } 307 311 … … 361 365 bool NotificationManager::registerQueue(NotificationQueue* queue) 362 366 { 367 COUT(4) << "NotificationQueue '" << queue->getName() << "' registered with the NotificationManager." << std::endl; 363 368 return this->queues_.insert(std::pair<const std::string, NotificationQueue*>(queue->getName(), queue)).second; 364 369 } … … 372 377 void NotificationManager::unregisterQueue(NotificationQueue* queue) 373 378 { 379 COUT(4) << "NotificationQueue '" << queue->getName() << "' unregistered with the NotificationManager." << std::endl; 374 380 this->queues_.erase(queue->getName()); 375 381 } -
code/branches/usability/src/modules/notifications/NotificationQueue.cc
r7489 r7987 137 137 GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() + "\")"); 138 138 139 COUT(3) << "NotificationQueue '" << this->getName() << "' destroyed." << std::endl; 140 139 141 this->OrxonoxClass::destroy(); 140 142 } … … 167 169 while(it != this->ordering_.upper_bound(&this->timeLimit_)) 168 170 { 169 std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator temp = it; 170 it++; 171 this->remove(temp); // Remove the Notifications that have expired. 171 this->remove(it); // Remove the Notifications that have expired. 172 it = this->ordering_.begin(); 172 173 } 173 174 … … 248 249 if(GameMode::showsGraphics()) 249 250 GUIManager::getInstance().getLuaState()->doString("NotificationLayer.pushNotification(\"" + this->getName() + "\", \"" + notification->getMessage() + "\")"); 251 252 COUT(5) << "Notification \"" << notification->getMessage() << "\" pushed to NotificationQueue '" << this->getName() << "'" << endl; 250 253 } 251 254 … … 259 262 // Get all the NotificationContainers that were sent the same time the NotificationContainer we want to pop was sent. 260 263 std::pair<std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator, std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator> iterators = this->ordering_.equal_range(container); 264 261 265 // Iterate through all suspects and remove the container as soon as we find it. 262 266 for(std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator it = iterators.first; it != iterators.second; it++) … … 264 268 if(container == *it) 265 269 { 270 COUT(5) << "Notification \"" << (*it)->notification->getMessage() << "\" popped from NotificationQueue '" << this->getName() << "'" << endl; 266 271 this->ordering_.erase(it); 267 272 break; … … 290 295 // Get the index at which the Notification is. 291 296 std::vector<NotificationContainer*>::difference_type index = it - this->notifications_.begin (); 297 298 COUT(5) << "Notification \"" << (*it)->notification->getMessage() << "\" removed from NotificationQueue '" << this->getName() << "'" << endl; 299 292 300 this->ordering_.erase(containerIterator); 293 301 this->notifications_.erase(it); … … 310 318 void NotificationQueue::clear(bool noGraphics) 311 319 { 320 COUT(4) << "Clearing NotificationQueue " << this->getName() << "." << endl; 312 321 this->ordering_.clear(); 313 322 // Delete all NotificationContainers in the list. … … 372 381 /** 373 382 @brief 374 Produces all targets of the NotificationQueue concatinated as string, with kommas (',') as seperators.383 Produces all targets of the NotificationQueue concatinated as string, with commas (',') as seperators. 375 384 @return 376 385 Returns the targets as a string.
Note: See TracChangeset
for help on using the changeset viewer.