Adds latest migration results
This commit is contained in:
829 files changed
+35074
-70886
No files matched your search
@@ -9,7 +9,25 @@
|
||||
#include <QtCore/QQueue>
|
||||
#include <QtCore/QThread>
|
||||
|
||||
#ifdef QT6_WEBSOCKETS_AVAILABLE
|
||||
class QWebSocket;
|
||||
#else
|
||||
namespace LtsWebSocket { class QWebSocketStub; }
|
||||
using QWebSocket = LtsWebSocket::QWebSocketStub;
|
||||
namespace LtsWebSocket
|
||||
{
|
||||
class QWebSocketStub
|
||||
{
|
||||
public:
|
||||
QWebSocketStub(QObject* parent = nullptr) { Q_UNUSED(parent); }
|
||||
virtual ~QWebSocketStub() = default;
|
||||
void sendTextMessage(const QString& /*message*/) {}
|
||||
void close() {}
|
||||
bool isValid() const { return false; }
|
||||
QString errorString() const { return QString(); }
|
||||
};
|
||||
} // namespace LtsWebSocket
|
||||
#endif
|
||||
|
||||
namespace LtsWebSocket
|
||||
{
|
||||
@@ -22,6 +40,7 @@ class LTSWEBSOCKETSERVER_EXPORT ClientConnection : public QThread, public ReplyH
|
||||
|
||||
~ClientConnection();
|
||||
|
||||
#ifdef QT6_WEBSOCKETS_AVAILABLE
|
||||
bool init();
|
||||
|
||||
void addReply(ReplyMessage* message) override;
|
||||
@@ -30,6 +49,11 @@ class LTSWEBSOCKETSERVER_EXPORT ClientConnection : public QThread, public ReplyH
|
||||
{
|
||||
return m_socket;
|
||||
}
|
||||
#else
|
||||
bool init() { return false; }
|
||||
void addReply(ReplyMessage* /*message*/) override {}
|
||||
QWebSocket* webSocket() { return nullptr; }
|
||||
#endif
|
||||
|
||||
signals:
|
||||
|
||||
@@ -38,13 +62,17 @@ class LTSWEBSOCKETSERVER_EXPORT ClientConnection : public QThread, public ReplyH
|
||||
void disconnected(ClientConnection* client);
|
||||
|
||||
private slots:
|
||||
#ifdef QT6_WEBSOCKETS_AVAILABLE
|
||||
void onNewTextMessageFromSocket(const QString& message);
|
||||
void sendMessagesFromQueue();
|
||||
void onSocketDisconnect();
|
||||
#endif
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
#ifdef QT6_WEBSOCKETS_AVAILABLE
|
||||
void sendMessages();
|
||||
#endif
|
||||
QWebSocket* m_socket;
|
||||
QQueue<ReplyMessage*> m_messageQueue;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user