From 57f1b775197aed1d32e98b0299c0999339a7d5f6 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Sun, 2 Feb 2020 18:14:27 +0100 Subject: Run clang-format also on all cpp files --- src/client/QXmppRemoteMethod.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'src/client/QXmppRemoteMethod.cpp') diff --git a/src/client/QXmppRemoteMethod.cpp b/src/client/QXmppRemoteMethod.cpp index 9493f54e..e2f719a1 100644 --- a/src/client/QXmppRemoteMethod.cpp +++ b/src/client/QXmppRemoteMethod.cpp @@ -30,33 +30,31 @@ #include #include -QXmppRemoteMethod::QXmppRemoteMethod(const QString &jid, const QString &method, const QVariantList &args, QXmppClient *client) : - QObject(client), m_client(client) +QXmppRemoteMethod::QXmppRemoteMethod(const QString &jid, const QString &method, const QVariantList &args, QXmppClient *client) : QObject(client), m_client(client) { - m_payload.setTo( jid ); - m_payload.setFrom( client->configuration().jid() ); - m_payload.setMethod( method ); - m_payload.setArguments( args ); + m_payload.setTo(jid); + m_payload.setFrom(client->configuration().jid()); + m_payload.setMethod(method); + m_payload.setArguments(args); } -QXmppRemoteMethodResult QXmppRemoteMethod::call( ) +QXmppRemoteMethodResult QXmppRemoteMethod::call() { // FIXME : spinning an event loop is a VERY bad idea, it can cause // us to lose incoming packets QEventLoop loop(this); - connect( this, &QXmppRemoteMethod::callDone, &loop, &QEventLoop::quit); - QTimer::singleShot(30000,&loop, &QEventLoop::quit); // Timeout in case the other end hangs... + connect(this, &QXmppRemoteMethod::callDone, &loop, &QEventLoop::quit); + QTimer::singleShot(30000, &loop, &QEventLoop::quit); // Timeout in case the other end hangs... - m_client->sendPacket( m_payload ); + m_client->sendPacket(m_payload); - loop.exec( QEventLoop::ExcludeUserInputEvents | QEventLoop::WaitForMoreEvents ); + loop.exec(QEventLoop::ExcludeUserInputEvents | QEventLoop::WaitForMoreEvents); return m_result; } -void QXmppRemoteMethod::gotError( const QXmppRpcErrorIq &iq ) +void QXmppRemoteMethod::gotError(const QXmppRpcErrorIq &iq) { - if ( iq.id() == m_payload.id() ) - { + if (iq.id() == m_payload.id()) { m_result.hasError = true; m_result.errorMessage = iq.error().text(); m_result.code = iq.error().type(); @@ -64,10 +62,9 @@ void QXmppRemoteMethod::gotError( const QXmppRpcErrorIq &iq ) } } -void QXmppRemoteMethod::gotResult( const QXmppRpcResponseIq &iq ) +void QXmppRemoteMethod::gotResult(const QXmppRpcResponseIq &iq) { - if ( iq.id() == m_payload.id() ) - { + if (iq.id() == m_payload.id()) { m_result.hasError = false; // FIXME: we don't handle multiple responses m_result.result = iq.values().first(); -- cgit v1.2.3