Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 27, 2011, 11:32:08 AM (13 years ago)
Author:
dafrick
Message:

Hopefully fixing two bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/modules/notifications/NotificationQueue.cc

    r7489 r7987  
    137137            GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() +  "\")");
    138138
     139        COUT(3) << "NotificationQueue '" << this->getName() << "' destroyed." << std::endl;
     140
    139141        this->OrxonoxClass::destroy();
    140142    }
     
    167169            while(it != this->ordering_.upper_bound(&this->timeLimit_))
    168170            {
    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();
    172173            }
    173174
     
    248249        if(GameMode::showsGraphics())
    249250            GUIManager::getInstance().getLuaState()->doString("NotificationLayer.pushNotification(\"" + this->getName() + "\", \"" + notification->getMessage() + "\")");
     251
     252        COUT(5) << "Notification \"" << notification->getMessage() << "\" pushed to NotificationQueue '" << this->getName() << "'" << endl;
    250253    }
    251254
     
    259262        // Get all the NotificationContainers that were sent the same time the NotificationContainer we want to pop was sent.
    260263        std::pair<std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator, std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator> iterators = this->ordering_.equal_range(container);
     264
    261265        // Iterate through all suspects and remove the container as soon as we find it.
    262266        for(std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator it = iterators.first; it != iterators.second; it++)
     
    264268            if(container == *it)
    265269            {
     270                COUT(5) << "Notification \"" << (*it)->notification->getMessage() << "\" popped from NotificationQueue '" << this->getName() << "'" << endl;
    266271                this->ordering_.erase(it);
    267272                break;
     
    290295        // Get the index at which the Notification is.
    291296        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
    292300        this->ordering_.erase(containerIterator);
    293301        this->notifications_.erase(it);
     
    310318    void NotificationQueue::clear(bool noGraphics)
    311319    {
     320        COUT(4) << "Clearing NotificationQueue " << this->getName() << "." << endl;
    312321        this->ordering_.clear();
    313322        // Delete all NotificationContainers in the list.
     
    372381    /**
    373382    @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.
    375384    @return
    376385        Returns the targets as a string.
Note: See TracChangeset for help on using the changeset viewer.