projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Provide (de)serialization for all event types
[quassel.git]
/
src
/
common
/
eventmanager.cpp
diff --git
a/src/common/eventmanager.cpp
b/src/common/eventmanager.cpp
index
03e891f
..
03c04df
100644
(file)
--- a/
src/common/eventmanager.cpp
+++ b/
src/common/eventmanager.cpp
@@
-72,6
+72,13
@@
QString EventManager::enumName(int type) {
return eventEnum().valueToKey(type);
}
return eventEnum().valueToKey(type);
}
+Event *EventManager::createEvent(const QVariantMap &map) {
+ QVariantMap m = map;
+
+ Network *net = networkById(m.take("network").toInt());
+ return Event::fromVariantMap(m, net);
+}
+
/* NOTE:
Registering and calling handlers works fine even if they specify a subclass of Event as their parameter.
However, this most probably is a result from a reinterpret_cast somewhere deep inside Qt, so there is *no*
/* NOTE:
Registering and calling handlers works fine even if they specify a subclass of Event as their parameter.
However, this most probably is a result from a reinterpret_cast somewhere deep inside Qt, so there is *no*