- Timestamp:
- Feb 14, 2011, 11:02:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutoriallevel/src/modules/notifications/NotificationQueue.cc
r7489 r7894 159 159 { 160 160 this->tickTime_ += dt; // Add the time interval that has passed to the time counter. 161 if(this-> tickTime_ >= 1.0) // If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick.161 if(this->displayTime_ != INF && this->tickTime_ >= 1.0) // If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick. 162 162 { 163 163 this->timeLimit_.time = std::time(0)-this->displayTime_; // Container containig the current time. … … 187 187 std::multimap<std::time_t, Notification*>* notifications = new std::multimap<std::time_t, Notification*>; 188 188 // Get the Notifications sent in the interval from now to now minus the display time. 189 NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_); 189 if(this->displayTime_ == INF) 190 NotificationManager::getInstance().getNewestNotifications(this, notifications, this->getMaxSize()); 191 else 192 NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_); 190 193 191 194 if(!notifications->empty()) … … 355 358 Sets the maximum number of seconds a Notification is displayed. 356 359 @param time 357 The number of seconds the Notifications is displayed. 358 @return 359 Returns true if successful. 360 */ 361 void NotificationQueue::setDisplayTime(unsigned int time) 360 The number of seconds a Notification is displayed. 361 */ 362 void NotificationQueue::setDisplayTime(int time) 362 363 { 363 364 if(this->displayTime_ == time)
Note: See TracChangeset
for help on using the changeset viewer.