42 #include "private/qdeclarativedebugclient_p.h" 44 #include "private/qpacketprotocol_p.h" 46 #include <QtCore/qdebug.h> 47 #include <QtCore/qstringlist.h> 49 #include <private/qobject_p.h> 79 void advertisePlugins();
87 :
QObject(c), q(c), protocol(0), gotHello(false)
121 bool validHello =
false;
122 if (name == clientId) {
136 qWarning(
"QDeclarativeDebugConnection: Invalid hello message");
148 iter.
value()->statusChanged(newStatus);
157 if (name == clientId) {
170 if (serverPlugins.contains(pluginName))
173 if (oldServerPlugins.
contains(pluginName)
174 != serverPlugins.contains(pluginName)) {
175 iter.
value()->statusChanged(newStatus);
179 qWarning() <<
"QDeclarativeDebugConnection: Unknown control message id" << op;
188 qWarning() <<
"QDeclarativeDebugConnection: Message received for missing plugin" <<
name;
190 (*iter)->messageReceived(message);
205 iter.
value()->d_func()->connection = 0;
231 if (
d->connection->d->plugins.contains(name)) {
232 qWarning() <<
"QDeclarativeDebugClient: Conflicting plugin name" <<
name;
235 d->connection->d->plugins.insert(name,
this);
236 d->connection->d->advertisePlugins();
243 if (
d->connection &&
d->connection->d) {
244 d->connection->d->plugins.remove(
d->name);
245 d->connection->d->advertisePlugins();
259 || !
d->connection->isConnected()
260 || !
d->connection->d->gotHello)
263 if (
d->connection->d->serverPlugins.contains(
d->name))
277 pack <<
d->name << message;
278 d->connection->d->protocol->send(pack);
279 d->connection->d->q->flush();
292 #include <qdeclarativedebugclient.moc>
QHash< QString, QDeclarativeDebugClient * > plugins
#define QT_END_NAMESPACE
This macro expands to.
bool flush()
This function writes as much as possible from the internal write buffer to the underlying network soc...
QDeclarativeDebugConnectionPrivate * d
The QByteArray class provides an array of bytes.
The QPacketProtocol class encapsulates communicating discrete packets across fragmented IO channels...
~QDeclarativeDebugClient()
QDeclarativeDebugConnection * q
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QPacketAutoSend send()
Returns a streamable object that is transmitted on destruction.
const int protocolVersion
T & value() const
Returns a modifiable reference to the current item's value.
QDeclarativeDebugConnectionPrivate(QDeclarativeDebugConnection *c)
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
The QObject class is the base class of all Qt objects.
QDeclarativeDebugClient(const QString &, QDeclarativeDebugConnection *parent)
QStringList serverPlugins
The QPacket class encapsulates an unfragmentable packet of data to be transmitted by QPacketProtocol...
QPacketProtocol * protocol
#define QT_BEGIN_NAMESPACE
This macro expands to.
static QIntfbScreen * connected
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
The QStringList class provides a list of strings.
Q_CORE_EXPORT void qWarning(const char *,...)
void sendMessage(const QByteArray &)
The QTcpSocket class provides a TCP socket.
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
QDeclarativeDebugConnection * connection
const Key & key() const
Returns the current item's key as a const reference.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
QDeclarativeDebugConnection(QObject *=0)
#define Q_DECLARE_PUBLIC(Class)
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
qint64 packetsAvailable() const
Returns the number of received packets yet to be read.
QObject * parent() const
Returns a pointer to the parent object.
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
virtual void messageReceived(const QByteArray &)
QDeclarativeDebugClientPrivate()
~QDeclarativeDebugConnection()
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
virtual void statusChanged(Status)
QPacket read()
Return the next unread packet, or an invalid QPacket instance if no packets are available.
QList< Key > keys() const
Returns a list containing all the keys in the hash, in an arbitrary order.
SocketState state() const
Returns the state of the socket.