diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-05-22 10:22:28 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-05-22 10:22:28 +0900 |
commit | be838b2f4f294a7e1b3f8a771f91d9d1eac14431 (patch) | |
tree | f720ae5a5a52bdd48fdaec17dea3c1c32fe10cd9 /events/roomnameevent.cpp | |
parent | 34764f3020c360ebc769cfe154e79b9e7e98f0f7 (diff) | |
download | libquotient-be838b2f4f294a7e1b3f8a771f91d9d1eac14431.tar.gz libquotient-be838b2f4f294a7e1b3f8a771f91d9d1eac14431.zip |
Refactored Events
The biggest change is we have no pimpls in Event objects anymore - because it's two new's instead of one per Event, and we have thousands and even more of Events created during initial sync. The other big change is introduction of RoomEvent, so that now the structure of events almost precisely reflects the CS API spec. The refactoring made UnknownEvent unnecessary as a separate class; a respective base class (either RoomEvent or Event) is used for this purpose now. All the other changes are consequences of these (mostly of RoomEvent introduction).
Diffstat (limited to 'events/roomnameevent.cpp')
-rw-r--r-- | events/roomnameevent.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/events/roomnameevent.cpp b/events/roomnameevent.cpp index c94cb2c3..c202d17a 100644 --- a/events/roomnameevent.cpp +++ b/events/roomnameevent.cpp @@ -20,33 +20,3 @@ using namespace QMatrixClient;
-class RoomNameEvent::Private
-{
- public:
- QString name;
-};
-
-RoomNameEvent::RoomNameEvent() :
- Event(EventType::RoomName),
- d(new Private)
-{
-}
-
-RoomNameEvent::~RoomNameEvent()
-{
- delete d;
-}
-
-QString RoomNameEvent::name() const
-{
- return d->name;
-}
-
-RoomNameEvent* RoomNameEvent::fromJson(const QJsonObject& obj)
-{
- RoomNameEvent* e = new RoomNameEvent();
- e->parseJson(obj);
- const QJsonObject contents = obj.value("content").toObject();
- e->d->name = contents.value("name").toString();
- return e;
-}
|