diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-12-13 08:22:03 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-12-13 08:22:03 +0000 |
| commit | 38bf36a15e08a67230bb658d2121cd048f428659 (patch) | |
| tree | 3dcf61399e6553ef7637a453ce1650cb4ee5a707 /examples/example_6_rpcClient | |
| parent | 914a4a04f812fecf61c2747cb830b6c3def833e1 (diff) | |
explicitly load QXmppRpcManager
Diffstat (limited to 'examples/example_6_rpcClient')
| -rw-r--r-- | examples/example_6_rpcClient/rpcClient.cpp | 11 | ||||
| -rw-r--r-- | examples/example_6_rpcClient/rpcClient.h | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/examples/example_6_rpcClient/rpcClient.cpp b/examples/example_6_rpcClient/rpcClient.cpp index 9e244393..98e72944 100644 --- a/examples/example_6_rpcClient/rpcClient.cpp +++ b/examples/example_6_rpcClient/rpcClient.cpp @@ -1,8 +1,9 @@ /* * Copyright (C) 2008-2010 The QXmpp developers * - * Author: + * Authors: * Ian Reinhart Geiser + * Jeremy Lainé * * Source: * http://code.google.com/p/qxmpp @@ -25,6 +26,7 @@ #include <QTimer> #include "QXmppRemoteMethod.h" +#include "QXmppRpcManager.h" #include "QXmppUtils.h" #include "rpcClient.h" @@ -32,6 +34,11 @@ rpcClient::rpcClient(QObject *parent) : QXmppClient(parent) { + // add RPC manager + m_rpcManager = new QXmppRpcManager; + addExtension(m_rpcManager); + + // observe incoming presences bool check = connect(this, SIGNAL(presenceReceived(QXmppPresence)), this, SLOT(slotPresenceReceived(QXmppPresence))); Q_ASSERT(check); @@ -44,7 +51,7 @@ rpcClient::~rpcClient() void rpcClient::slotInvokeRemoteMethod() { - QXmppRemoteMethodResult methodResult = callRemoteMethod( + QXmppRemoteMethodResult methodResult = m_rpcManager->callRemoteMethod( m_remoteJid, "RemoteInterface.echoString", "This is a test" ); if( methodResult.hasError ) qDebug() << "Error:" << methodResult.code << methodResult.errorMessage; diff --git a/examples/example_6_rpcClient/rpcClient.h b/examples/example_6_rpcClient/rpcClient.h index 49ab8b7b..8af09459 100644 --- a/examples/example_6_rpcClient/rpcClient.h +++ b/examples/example_6_rpcClient/rpcClient.h @@ -1,8 +1,9 @@ /* * Copyright (C) 2008-2010 The QXmpp developers * - * Author: + * Authors: * Ian Reinhart Geiser + * Jeremy Lainé * * Source: * http://code.google.com/p/qxmpp @@ -27,6 +28,8 @@ #include "QXmppClient.h" +class QXmppRpcManager; + class rpcClient : public QXmppClient { Q_OBJECT @@ -41,6 +44,7 @@ private slots: private: QString m_remoteJid; + QXmppRpcManager *m_rpcManager; }; #endif // RPCCLIENT_H |
