예제 #1
0
  virtual void bufferize(const T& msg)
  {
    boost::mutex::scoped_lock lock_bufferize( mutex_ );
    typename std::list<T>::iterator it;
    removeOld();
    buffer_.push_back(msg);

  }
예제 #2
0
	void Chat::logic()
	{
		// Remove old messages
		for ( message_list::iterator iter = _messages.begin(); iter != _messages.end(); ++iter )
			if ( removeOld(*iter) )
			{
				delete *iter;
				(*iter) = NULL;
			}
		
		_messages.erase(std::remove_if(_messages.begin(), _messages.end(), removeOld), _messages.end());
	}
예제 #3
0
/*!
    The application \a app temporarily requests \a mode.
*/
void QtopiaPowerConstraintManager::setConstraint(QtopiaApplication::PowerConstraint mode, const QString &app)
{
    removeOld(app);
    switch(mode) {
        case QtopiaApplication::Disable:
            sStatus[0].append(app);
            break;
        case QtopiaApplication::DisableLightOff:
            sStatus[1].append(app);
            break;
        case QtopiaApplication::DisableSuspend:
            sStatus[2].append(app);
            break;
        case QtopiaApplication::Enable:
            // need to reset the screen saver timer, and this is how you do that!
            g_qtopiaPowerManager->setDefaultIntervals();
            break;
        default:
            qWarning("Unrecognized temp power setting.  Ignored");
            return;
    }
    updateAll();
}
예제 #4
0
/*!
  The application \a app has been terminated.
  Any power constraint applied by this application will
  be removed.
*/
void QtopiaPowerConstraintManager::applicationTerminated(const QString &app)
{
    if ( removeOld(app) )
        updateAll();
}