QTfrontend/util/frontlibpoller.cpp
author unc0rr
Thu, 22 Nov 2012 23:19:01 +0400
branchflibqtfrontend
changeset 8094 6c5b4e69f03d
parent 8092 08960209db8c
child 8100 0e6fadf81a2c
permissions -rw-r--r--
Fix some frontlib bugs
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
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    11
    m_timer.start(50, this);
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    12
}
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    13
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    14
void FrontLibPoller::timerEvent(QTimerEvent *event)
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    15
{
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    16
    if(event->timerId() == m_timer.timerId())
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    17
        m_poll(m_data);
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    18
    else
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    19
        QObject::timerEvent(event);
08960209db8c Try to use map preview facilities:
unc0rr
parents:
diff changeset
    20
}