X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Feventmanager.cpp;fp=src%2Fcommon%2Feventmanager.cpp;h=03c04df3460337cd5e189c5d05e75238a631e0a6;hp=03e891f48cc804622f373f2cf684c0c25ff0f820;hb=6f38b6fdeb73e726c24b26a97b98c9cfe0fc8a0e;hpb=5c6de1b6613a99791be660bb19df18e3da507cd7 diff --git a/src/common/eventmanager.cpp b/src/common/eventmanager.cpp index 03e891f4..03c04df3 100644 --- a/src/common/eventmanager.cpp +++ b/src/common/eventmanager.cpp @@ -72,6 +72,13 @@ QString EventManager::enumName(int 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*