From 08e187b1d48aeb3f824aa5240e55def428dcad45 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 31 Aug 2011 12:38:54 +0200 Subject: [PATCH] Debugger: Fixing coding style issues Applying changes done in the Qt Creator copies. Change-Id: I11e0547ddedd2e1f0b99d0ea586a1b209fa8d912 Reviewed-on: http://codereview.qt.nokia.com/3942 Reviewed-by: Aurindam Jana --- .../debugger/qdeclarativeenginedebug.cpp | 4 +++ .../debugger/qdeclarativeenginedebug_p.h | 3 +-- src/declarative/debugger/qpacketprotocol.cpp | 30 +++++++++++----------- src/declarative/debugger/qpacketprotocol_p.h | 12 ++++----- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/declarative/debugger/qdeclarativeenginedebug.cpp b/src/declarative/debugger/qdeclarativeenginedebug.cpp index 836885d..237e2d6 100644 --- a/src/declarative/debugger/qdeclarativeenginedebug.cpp +++ b/src/declarative/debugger/qdeclarativeenginedebug.cpp @@ -415,6 +415,10 @@ QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *cl { } +QDeclarativeEngineDebug::~QDeclarativeEngineDebug() +{ +} + QDeclarativeEngineDebug::Status QDeclarativeEngineDebug::status() const { Q_D(const QDeclarativeEngineDebug); diff --git a/src/declarative/debugger/qdeclarativeenginedebug_p.h b/src/declarative/debugger/qdeclarativeenginedebug_p.h index 2cc6bfb..d98e4e8 100644 --- a/src/declarative/debugger/qdeclarativeenginedebug_p.h +++ b/src/declarative/debugger/qdeclarativeenginedebug_p.h @@ -86,6 +86,7 @@ public: enum Status { NotConnected, Unavailable, Enabled }; explicit QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0); + ~QDeclarativeEngineDebug(); Status status() const; @@ -194,8 +195,6 @@ public: State state() const; bool isWaiting() const; - // bool waitUntilCompleted(); - Q_SIGNALS: void stateChanged(QDeclarativeDebugQuery::State); diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp index 0f1c15e..9b95d06 100644 --- a/src/declarative/debugger/qpacketprotocol.cpp +++ b/src/declarative/debugger/qpacketprotocol.cpp @@ -41,12 +41,12 @@ #include "private/qpacketprotocol_p.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE -#define MAX_PACKET_SIZE 0x7FFFFFFF +static const unsigned int MAX_PACKET_SIZE = 0x7FFFFFFF; /*! \class QPacketProtocol @@ -113,7 +113,7 @@ class QPacketProtocolPrivate : public QObject { Q_OBJECT public: - QPacketProtocolPrivate(QPacketProtocol * parent, QIODevice * _dev) + QPacketProtocolPrivate(QPacketProtocol *parent, QIODevice *_dev) : QObject(parent), inProgressSize(-1), maxPacketSize(MAX_PACKET_SIZE), waitingForPacket(false), dev(_dev) { @@ -150,8 +150,8 @@ public Q_SLOTS: { Q_ASSERT(!sendingPackets.isEmpty()); - while(bytes) { - if(sendingPackets.at(0) > bytes) { + while (bytes) { + if (sendingPackets.at(0) > bytes) { sendingPackets[0] -= bytes; bytes = 0; } else { @@ -214,14 +214,14 @@ public: qint32 inProgressSize; qint32 maxPacketSize; bool waitingForPacket; - QIODevice * dev; + QIODevice *dev; }; /*! Construct a QPacketProtocol instance that works on \a dev with the specified \a parent. */ -QPacketProtocol::QPacketProtocol(QIODevice * dev, QObject * parent) +QPacketProtocol::QPacketProtocol(QIODevice *dev, QObject *parent) : QObject(parent), d(new QPacketProtocolPrivate(this, dev)) { Q_ASSERT(dev); @@ -255,7 +255,7 @@ qint32 QPacketProtocol::maximumPacketSize() const */ qint32 QPacketProtocol::setMaximumPacketSize(qint32 max) { - if(max > (signed)sizeof(qint32)) + if (max > (signed)sizeof(qint32)) d->maxPacketSize = max; return d->maxPacketSize; } @@ -282,7 +282,7 @@ QPacketAutoSend QPacketProtocol::send() */ void QPacketProtocol::send(const QPacket & p) { - if(p.b.isEmpty()) + if (p.b.isEmpty()) return; // We don't send empty packets qint64 sendSize = p.b.size() + sizeof(qint32); @@ -317,7 +317,7 @@ void QPacketProtocol::clear() */ QPacket QPacketProtocol::read() { - if(0 == d->packets.count()) + if (0 == d->packets.count()) return QPacket(); QPacket rv(d->packets.at(0)); @@ -370,7 +370,7 @@ bool QPacketProtocol::waitForReadyRead(int msecs) /*! Return the QIODevice passed to the QPacketProtocol constructor. */ -QIODevice * QPacketProtocol::device() +QIODevice *QPacketProtocol::device() { return d->dev; } @@ -458,7 +458,7 @@ QPacket::QPacket() */ QPacket::~QPacket() { - if(buf) { + if (buf) { delete buf; buf = 0; } @@ -534,14 +534,14 @@ void QPacket::clear() \internal */ -QPacketAutoSend::QPacketAutoSend(QPacketProtocol * _p) +QPacketAutoSend::QPacketAutoSend(QPacketProtocol *_p) : QPacket(), p(_p) { } QPacketAutoSend::~QPacketAutoSend() { - if(!b.isEmpty()) + if (!b.isEmpty()) p->send(*this); } diff --git a/src/declarative/debugger/qpacketprotocol_p.h b/src/declarative/debugger/qpacketprotocol_p.h index f7f3060..5d9d820 100644 --- a/src/declarative/debugger/qpacketprotocol_p.h +++ b/src/declarative/debugger/qpacketprotocol_p.h @@ -74,7 +74,7 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QPacketProtocol : public QObject { Q_OBJECT public: - explicit QPacketProtocol(QIODevice * dev, QObject * parent = 0); + explicit QPacketProtocol(QIODevice *dev, QObject *parent = 0); virtual ~QPacketProtocol(); qint32 maximumPacketSize() const; @@ -90,7 +90,7 @@ public: void clear(); - QIODevice * device(); + QIODevice *device(); Q_SIGNALS: void readyRead(); @@ -98,7 +98,7 @@ Q_SIGNALS: void packetWritten(); private: - QPacketProtocolPrivate * d; + QPacketProtocolPrivate *d; }; @@ -115,9 +115,9 @@ public: protected: friend class QPacketProtocol; - QPacket(const QByteArray & ba); + QPacket(const QByteArray &ba); QByteArray b; - QBuffer * buf; + QBuffer *buf; }; class Q_DECLARATIVE_PRIVATE_EXPORT QPacketAutoSend : public QPacket @@ -128,7 +128,7 @@ public: private: friend class QPacketProtocol; QPacketAutoSend(QPacketProtocol *); - QPacketProtocol * p; + QPacketProtocol *p; }; QT_END_NAMESPACE -- 2.7.4