diff options
Diffstat (limited to 'src/qmldebug/qqmlpreviewclient.cpp')
-rw-r--r-- | src/qmldebug/qqmlpreviewclient.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/qmldebug/qqmlpreviewclient.cpp b/src/qmldebug/qqmlpreviewclient.cpp index fa040e226b..33a2f53ca4 100644 --- a/src/qmldebug/qqmlpreviewclient.cpp +++ b/src/qmldebug/qqmlpreviewclient.cpp @@ -61,18 +61,29 @@ void QQmlPreviewClient::messageReceived(const QByteArray &message) qint8 command; packet >> command; - if (command == Error) { + switch (command) { + case Error: { QString seviceError; packet >> seviceError; emit error(seviceError); - return; + break; + } + case Request: { + QString fileName; + packet >> fileName; + emit request(fileName); + break; + } + case Fps: { + quint16 frames; + packet >> frames; + emit fps(frames); + break; + } + default: + emit error(QString::fromLatin1("Unknown command received: %1").arg(command)); + break; } - - Q_ASSERT(command == Request); - - QString fileName; - packet >> fileName; - emit request(fileName); } void QQmlPreviewClient::sendDirectory(const QString &path, const QStringList &entries) |