QTfrontend/util/frontlibpoller.cpp
author unc0rr
Sun, 25 Nov 2012 22:17:11 +0400
branchflibqtfrontend
changeset 8103 c247346d296f
parent 8100 0e6fadf81a2c
permissions -rw-r--r--
Convert HWTeam to be a wrapper to flib_team
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8092
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
     1
#include <QTimerEvent>
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
     2
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
     3
#include "frontlibpoller.h"
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
     4
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
     5
FrontLibPoller::FrontLibPoller(void (*poll)(void * data), void *data, QObject *parent) :
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
     6
    QObject(parent)
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
     7
{
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
     8
    m_poll = poll;
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
     9
    m_data = data;
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    10
8100
0e6fadf81a2c - frontlib loads team config via physfs
unc0rr
parents: 8092
diff changeset
    11
    if(m_data)
0e6fadf81a2c - frontlib loads team config via physfs
unc0rr
parents: 8092
diff changeset
    12
        m_timer.start(50, this);
8092
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    13
}
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    14
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    15
void FrontLibPoller::timerEvent(QTimerEvent *event)
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    16
{
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    17
    if(event->timerId() == m_timer.timerId())
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    18
        m_poll(m_data);
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    19
    else
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    20
        QObject::timerEvent(event);
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    21
}