diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-05-28 13:00:44 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-28 13:00:44 +0900 |
commit | 36dbba9c543b819aec526f18c33f1d95b0ee61c7 (patch) | |
tree | 49caf6450be52072d8f1e4e40e2dfb8490d73732 /examples | |
parent | ced7a66686596e74a1f25b5d9634b9b562870943 (diff) | |
parent | a5e14da86c3299ca8d36eb4a4eb58ce2a245dc4e (diff) | |
download | libquotient-36dbba9c543b819aec526f18c33f1d95b0ee61c7.tar.gz libquotient-36dbba9c543b819aec526f18c33f1d95b0ee61c7.zip |
Merge pull request #65 from QMatrixClient/kitsune-simplify-events
Events refactoring
Diffstat (limited to 'examples')
-rw-r--r-- | examples/qmc-example.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/qmc-example.cpp b/examples/qmc-example.cpp index 7b45a785..a6da6aba 100644 --- a/examples/qmc-example.cpp +++ b/examples/qmc-example.cpp @@ -1,12 +1,15 @@ -#include <iostream> -#include <QCoreApplication> #include "connection.h" #include "room.h" +#include <QCoreApplication> +#include <iostream> +#include <string> + using namespace QMatrixClient; using std::cout; using std::endl; +using std::string; void onNewRoom(Room* r) { @@ -16,11 +19,11 @@ void onNewRoom(Room* r) cout << " Name: " << r->name().toStdString() << endl; cout << " Canonical alias: " << r->canonicalAlias().toStdString() << endl; }); - QObject::connect(r, &Room::aboutToAddNewMessages, [=] (Events evs) { + QObject::connect(r, &Room::aboutToAddNewMessages, [=] (RoomEvents evs) { cout << "New events in room " << r->id().toStdString() << ":" << endl; for (auto e: evs) { - cout << e->originalJson().toStdString() << endl; + cout << string(e->originalJson()) << endl; } }); } |