aboutsummaryrefslogtreecommitdiff
path: root/lib/events/event.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-11-04 16:07:53 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-11-04 16:07:53 +0900
commit9993a0ea50165fd70f75b68c329ea045fb51d7f4 (patch)
tree6c56bc17799273cb3693a2b435d69e361e2c04ff /lib/events/event.h
parentf3221451ce29c3b571e08fe3ce51a49f252029e5 (diff)
downloadlibquotient-9993a0ea50165fd70f75b68c329ea045fb51d7f4.tar.gz
libquotient-9993a0ea50165fd70f75b68c329ea045fb51d7f4.zip
Support dumping Events to QDebug
Diffstat (limited to 'lib/events/event.h')
-rw-r--r--lib/events/event.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/events/event.h b/lib/events/event.h
index 5b33628f..76e77cf6 100644
--- a/lib/events/event.h
+++ b/lib/events/event.h
@@ -257,8 +257,18 @@ namespace QMatrixClient
return fromJson<T>(contentJson()[key]);
}
+ friend QDebug operator<<(QDebug dbg, const Event& e)
+ {
+ QDebugStateSaver _dss { dbg };
+ dbg.noquote().nospace()
+ << e.matrixType() << '(' << e.type() << "): ";
+ e.dumpTo(dbg);
+ return dbg;
+ }
+
virtual bool isStateEvent() const { return false; }
virtual bool isCallEvent() const { return false; }
+ virtual void dumpTo(QDebug dbg) const;
protected:
QJsonObject& editJson() { return _json; }