forked from dresden-elektronik/deconz-rest-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
event.cpp
54 lines (49 loc) · 925 Bytes
/
event.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "event.h"
#include "deconz.h"
#include "resource.h"
/*! Constructor.
*/
Event::Event() :
m_resource(0),
m_what(0),
m_num(0),
m_numPrev(0)
{
}
Event::Event(const char *resource, const char *what, const QString &id, ResourceItem *item) :
m_resource(resource),
m_what(what),
m_id(id),
m_num(0),
m_numPrev(0)
{
DBG_Assert(item != 0);
if (item)
{
m_num = item->toNumber();
m_numPrev = item->toNumberPrevious();
}
}
/*! Constructor.
*/
Event::Event(const char *resource, const char *what, const QString &id) :
m_resource(resource),
m_what(what),
m_id(id),
m_num(0),
m_numPrev(0)
{
}
/*! Constructor.
*/
Event::Event(const char *resource, const char *what, int num) :
m_resource(resource),
m_what(what),
m_num(num),
m_numPrev(0)
{
if (resource == RGroups)
{
m_id = QString::number(num);
}
}