- Timestamp:
- Aug 11, 2010, 8:55:13 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/questsystem/notifications/NotificationQueue.cc
r6502 r7163 34 34 #include "NotificationQueue.h" 35 35 36 #include <sstream> 37 36 #include "util/Convert.h" 38 37 #include "core/CoreIncludes.h" 39 38 #include "core/XMLPort.h" … … 56 55 NotificationQueue::NotificationQueue(BaseObject* creator) : OverlayGroup(creator) 57 56 { 57 this->registered_ = false; 58 58 59 RegisterObject(NotificationQueue); 59 60 this->initialize(); … … 68 69 this->targets_.clear(); 69 70 this->clear(); 71 72 if(this->registered_) 73 NotificationManager::getInstance().unregisterListener(this); 70 74 } 71 75 … … 81 85 82 86 NotificationManager::getInstance().registerListener(this); 87 this->registered_ = true; 83 88 } 84 89 … … 118 123 XMLPortParam(NotificationQueue, "position", setPosition, getPosition, xmlElement, mode); 119 124 120 COUT(3) << "NotificationQueue created." << std::endl;125 COUT(3) << "NotificationQueue '" << this->getName() << "' created." << std::endl; 121 126 } 122 127 … … 173 178 delete notifications; 174 179 175 COUT( 3) << "NotificationQueueupdated." << std::endl;180 COUT(4) << "NotificationQueue '" << this->getName() << "' updated." << std::endl; 176 181 } 177 182 … … 196 201 } 197 202 198 COUT( 3) << "NotificationQueueupdated. A new Notifications has been added." << std::endl;203 COUT(4) << "NotificationQueue '" << this->getName() << "' updated. A new Notifications has been added." << std::endl; 199 204 } 200 205 … … 397 402 std::string timeString = std::ctime(&time); 398 403 timeString.erase(timeString.length()-1); 399 std::ostringstream stream; 400 stream << reinterpret_cast<unsigned long>(notification); 401 const std::string& addressString = stream.str(); 404 const std::string& addressString = multi_cast<std::string>(reinterpret_cast<unsigned long>(notification)); 402 405 container->name = "NotificationOverlay(" + timeString + ")&" + addressString; 403 406 … … 422 425 if(this->size_ == 0) //!< You cannot remove anything if the queue is empty. 423 426 return false; 427 428 // Unregister the NotificationQueue with the NotificationManager. 429 NotificationManager::getInstance().unregisterNotification(container->notification, this); 424 430 425 431 this->removeElement(container->overlay); … … 443 449 { 444 450 this->removeContainer(*it); 445 it = this->containers_.begin(); //TODO: Needed?451 it = this->containers_.begin(); 446 452 } 447 453 }
Note: See TracChangeset
for help on using the changeset viewer.