diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-12-13 08:19:18 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-12-13 08:19:18 +0000 |
| commit | adcf0f03c09495330848c1f9c96b921aaa71ce80 (patch) | |
| tree | 3fb16956a5b7aeb8894d8cbea0fa973793a94c45 /examples/example_5_rpcInterface/main.cpp | |
| parent | ab4a7c55293df690605c43a14c5ca35c00b585d4 (diff) | |
| download | qxmpp-adcf0f03c09495330848c1f9c96b921aaa71ce80.tar.gz | |
update RPC interface example to load QXmppRpcManager
Diffstat (limited to 'examples/example_5_rpcInterface/main.cpp')
| -rw-r--r-- | examples/example_5_rpcInterface/main.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/examples/example_5_rpcInterface/main.cpp b/examples/example_5_rpcInterface/main.cpp index bc493b53..6e1fc578 100644 --- a/examples/example_5_rpcInterface/main.cpp +++ b/examples/example_5_rpcInterface/main.cpp @@ -1,8 +1,9 @@ /* * Copyright (C) 2008-2010 The QXmpp developers * - * Author: + * Authors: * Manjeet Dahiya + * Jeremy Lainé * * Source: * http://code.google.com/p/qxmpp @@ -21,10 +22,13 @@ * */ +#include <QCoreApplication> -#include <QtCore/QCoreApplication> -#include "rpcClient.h" +#include "QXmppClient.h" #include "QXmppLogger.h" +#include "QXmppRpcManager.h" + +#include "remoteinterface.h" int main(int argc, char *argv[]) { @@ -32,7 +36,13 @@ int main(int argc, char *argv[]) QXmppLogger::getLogger()->setLoggingType(QXmppLogger::StdoutLogging); - rpcClient client; + QXmppClient client; + + // add RPC extension and register interface + QXmppRpcManager *manager = new QXmppRpcManager; + client.addExtension(manager); + manager->addInvokableInterface(new RemoteInterface(&client)); + client.connectToServer("qxmpp.test1@gmail.com", "qxmpp123"); return a.exec(); } |
