- Timestamp:
- Sep 24, 2010, 4:01:04 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/notifications/NotificationQueue.cc
r7488 r7489 90 90 this->create(); // Creates the NotificationQueue in lua. 91 91 92 // register the NotificationQueue as NotificationListener with the NotificationManager.92 // Register the NotificationQueue as NotificationListener with the NotificationManager. 93 93 bool listenerRegistered = NotificationManager::getInstance().registerListener(this); 94 94 if(!listenerRegistered) // If the registration has failed. … … 96 96 this->registered_ = false; 97 97 // Remove the NotificationQueue in lua. 98 GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() + "\")"); 98 if(GameMode::showsGraphics()) 99 GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() + "\")"); 99 100 NotificationManager::getInstance().unregisterQueue(this); 100 101 COUT(1) << "Error: NotificationQueue '" << this->getName() << "' could not be registered." << std::endl; … … 210 211 void NotificationQueue::update(Notification* notification, const std::time_t & time) 211 212 { 213 assert(notification); 214 212 215 this->push(notification, time); 213 216 … … 226 229 void NotificationQueue::push(Notification* notification, const std::time_t & time) 227 230 { 231 assert(notification); 232 228 233 NotificationContainer* container = new NotificationContainer; 229 234 container->notification = notification; … … 254 259 // Get all the NotificationContainers that were sent the same time the NotificationContainer we want to pop was sent. 255 260 std::pair<std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator, std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator> iterators = this->ordering_.equal_range(container); 256 // Iterate th ourgh all suspects and remove the container as soon as we find it.261 // Iterate through all suspects and remove the container as soon as we find it. 257 262 for(std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator it = iterators.first; it != iterators.second; it++) 258 263 { … … 311 316 312 317 this->notifications_.clear(); 313 314 318 this->size_ = 0; 315 319
Note: See TracChangeset
for help on using the changeset viewer.