コード例 #1
0
ファイル: idle_mac.cpp プロジェクト: ChALkeR/vacuum-im
bool IdlePlatform::init()
{
  if (secondsIdle() == -1)
    return false;

  return true;
}
コード例 #2
0
ファイル: maemo6idle.cpp プロジェクト: CyberSys/qutim
void Maemo6Idle::timerEvent(QTimerEvent* ev)
{
	Q_UNUSED(ev);

	if (m_activity != MeeGo::QmActivity::Active)
	{
		m_idleSeconds += 60;
	}

	emit secondsIdle(m_idleSeconds);
}
コード例 #3
0
ファイル: maemo6idle.cpp プロジェクト: CyberSys/qutim
void Maemo6Idle::activityChanged (MeeGo::QmActivity::Activity activity)
{
	m_activity = activity;
	if (m_activity == MeeGo::QmActivity::Active)
	{
		m_idleSeconds = 0;
		idle_timer->stop();
	}
	else
	{
		m_idleSeconds = 0;
		idle_timer->start(60000,this);
	}
	emit secondsIdle(m_idleSeconds);
}
コード例 #4
0
void Idle::doCheck()
{
	int i;

	if(usePlatform()) // VOXOX -ASV- 08-07-2009 
		i = platform->secondsIdle();
	else {
		QPoint curMousePos = QCursor::pos();
		QDateTime curDateTime = QDateTime::currentDateTime();
		if(d->lastMousePos != curMousePos) {
			d->lastMousePos = curMousePos;
			d->idleSince = curDateTime;
		}
		i = d->idleSince.secsTo(curDateTime);
	}

	// set 'beginIdle' to the beginning of the idle time (by backtracking 'i' seconds from now)
	QDateTime beginIdle = QDateTime::currentDateTime().addSecs(-i);

	// set 't' to hold the number of seconds between 'beginIdle' and 'startTime'
	int t = beginIdle.secsTo(d->startTime);

	// beginIdle later than (or equal to) startTime?
	if(t <= 0) {
		// scoot ourselves up to the new idle start
		d->startTime = beginIdle;
	}
	// beginIdle earlier than startTime?
	else if(t > 0) {
		// do nothing
	}

	// how long have we been idle?
	int idleTime = d->startTime.secsTo(QDateTime::currentDateTime());

	secondsIdle(idleTime);
}
コード例 #5
0
ファイル: Idle.cpp プロジェクト: johnbolia/schat
void Idle::doCheck()
{
  emit secondsIdle(secondsIdle());
}
コード例 #6
0
ファイル: idle_x11.cpp プロジェクト: ziemniak/kadu
bool Idle::isActive()
{
	return (secondsIdle() == 0);
}