X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fevent.cpp;h=4bb0221df9110ced78f36b4d26e90bd43b64a1d2;hp=b933fa6472fc99db15ecb7d096d103ae62147e76;hb=c194ed5fb3d15e14b9364f9796d3521910dc72fe;hpb=6a63070246d89aa2a2474e3a9a1035fa889ad77e diff --git a/src/common/event.cpp b/src/common/event.cpp index b933fa64..4bb0221d 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -27,14 +27,12 @@ Event::Event(EventManager::EventType type) : _type(type) - , _valid(true) { } Event::Event(EventManager::EventType type, QVariantMap &map) : _type(type) - , _valid(true) { if (!map.contains("flags") || !map.contains("timestamp")) { qWarning() << "Received invalid serialized event:" << map; @@ -86,16 +84,16 @@ Event *Event::fromVariantMap(QVariantMap &map, Network *network) // sanity check if we have a valid enum value if (EventManager::enumName(inttype).isEmpty()) { qWarning() << "Received a serialized event with unknown type" << inttype; - return 0; + return nullptr; } EventManager::EventType type = static_cast(inttype); if (type == EventManager::Invalid || type == EventManager::GenericEvent) - return 0; + return nullptr; EventManager::EventType group = static_cast(type & EventManager::EventGroupMask); - Event *e = 0; + Event *e = nullptr; // we use static create() functions to keep group-specific special cases in the files they belong // e.g. IrcEventRawMessage @@ -121,7 +119,7 @@ Event *Event::fromVariantMap(QVariantMap &map, Network *network) if (!e) { qWarning() << "Can't create event of type" << type; - return 0; + return nullptr; } if (!map.isEmpty()) {