Commit 788722e135f6a782ed16fa0294a302b45a9d312b

Authored by Charles Otto
1 parent 85bf95aa

Clean up some warnings

Showing 1 changed file with 18 additions and 2 deletions
openbr/plugins/process.cpp
@@ -30,6 +30,8 @@ public: @@ -30,6 +30,8 @@ public:
30 // signals for our sever 30 // signals for our sever
31 connect(&server, SIGNAL(newConnection()), this, SLOT(receivedConnection() )); 31 connect(&server, SIGNAL(newConnection()), this, SLOT(receivedConnection() ));
32 connect(this, SIGNAL(pulseStartServer(QString)), this, SLOT(startServerInternal(QString)), Qt::BlockingQueuedConnection); 32 connect(this, SIGNAL(pulseStartServer(QString)), this, SLOT(startServerInternal(QString)), Qt::BlockingQueuedConnection);
  33 + connect(this, SIGNAL(pulseOutboundConnect(QString)), this, SLOT(startConnectInternal(QString) ), Qt::BlockingQueuedConnection);
  34 +
33 35
34 // internals, cause work to be done by the main thread because reasons. 36 // internals, cause work to be done by the main thread because reasons.
35 connect(this, SIGNAL(pulseSignal()), this, SLOT(sendSignalInternal()), Qt::BlockingQueuedConnection); 37 connect(this, SIGNAL(pulseSignal()), this, SLOT(sendSignalInternal()), Qt::BlockingQueuedConnection);
@@ -85,11 +87,13 @@ public slots: @@ -85,11 +87,13 @@ public slots:
85 // informative. 87 // informative.
86 void outboundConnectionError(QLocalSocket::LocalSocketError socketError) 88 void outboundConnectionError(QLocalSocket::LocalSocketError socketError)
87 { 89 {
  90 + (void) socketError;
88 //qDebug() << key << " outbound socket error " << socketError; 91 //qDebug() << key << " outbound socket error " << socketError;
89 } 92 }
90 93
91 void outboundStateChanged(QLocalSocket::LocalSocketState socketState) 94 void outboundStateChanged(QLocalSocket::LocalSocketState socketState)
92 { 95 {
  96 + (void) socketState;
93 //qDebug() << key << " outbound socket state changed to " << socketState; 97 //qDebug() << key << " outbound socket state changed to " << socketState;
94 } 98 }
95 99
@@ -101,11 +105,13 @@ public slots: @@ -101,11 +105,13 @@ public slots:
101 105
102 void inboundConnectionError(QLocalSocket::LocalSocketError socketError) 106 void inboundConnectionError(QLocalSocket::LocalSocketError socketError)
103 { 107 {
  108 + (void) socketError;
104 //qDebug() << key << " inbound socket error " << socketError; 109 //qDebug() << key << " inbound socket error " << socketError;
105 } 110 }
106 111
107 void inboundStateChanged(QLocalSocket::LocalSocketState socketState) 112 void inboundStateChanged(QLocalSocket::LocalSocketState socketState)
108 { 113 {
  114 + (void) socketState;
109 //qDebug() << key << " inbound socket state changed to " << socketState; 115 //qDebug() << key << " inbound socket state changed to " << socketState;
110 } 116 }
111 117
@@ -132,7 +138,7 @@ public slots: @@ -132,7 +138,7 @@ public slots:
132 138
133 void readSignalInternal() 139 void readSignalInternal()
134 { 140 {
135 - while (inbound->bytesAvailable() < sizeof(readSignal) ) { 141 + while (inbound->bytesAvailable() < qint64(sizeof(readSignal)) ) {
136 bool size_ready = inbound->waitForReadyRead(-1); 142 bool size_ready = inbound->waitForReadyRead(-1);
137 if (!size_ready) 143 if (!size_ready)
138 { 144 {
@@ -237,6 +243,13 @@ public slots: @@ -237,6 +243,13 @@ public slots:
237 server.close(); 243 server.close();
238 } 244 }
239 245
  246 +
  247 + void startConnectInternal(QString remoteName)
  248 + {
  249 + outbound.connectToServer(remoteName);
  250 + }
  251 +
  252 +
240 signals: 253 signals:
241 void pulseStartServer(QString serverName); 254 void pulseStartServer(QString serverName);
242 void pulseSignal(); 255 void pulseSignal();
@@ -244,6 +257,7 @@ signals: @@ -244,6 +257,7 @@ signals:
244 void pulseReadSerialized(); 257 void pulseReadSerialized();
245 void pulseSendSerialized(); 258 void pulseSendSerialized();
246 void pulseShutdown(); 259 void pulseShutdown();
  260 + void pulseOutboundConnect(QString serverName);
247 261
248 262
249 public: 263 public:
@@ -280,11 +294,12 @@ public: @@ -280,11 +294,12 @@ public:
280 294
281 void connectToRemote(const QString & remoteName) 295 void connectToRemote(const QString & remoteName)
282 { 296 {
283 - outbound.connectToServer(remoteName); 297 + emit pulseOutboundConnect(remoteName);
284 298
285 QMutexLocker locker(&outboundLock); 299 QMutexLocker locker(&outboundLock);
286 while (outbound.state() != QLocalSocket::ConnectedState) { 300 while (outbound.state() != QLocalSocket::ConnectedState) {
287 outboundWait.wait(&outboundLock,30*1000); 301 outboundWait.wait(&outboundLock,30*1000);
  302 +
288 } 303 }
289 } 304 }
290 305
@@ -404,6 +419,7 @@ void shutUp(QtMsgType type, const QMessageLogContext &amp;context, const QString &amp;ms @@ -404,6 +419,7 @@ void shutUp(QtMsgType type, const QMessageLogContext &amp;context, const QString &amp;ms
404 // Please tell me more about how you want every single god damn thing to be created from and used by exactly one thread. 419 // Please tell me more about how you want every single god damn thing to be created from and used by exactly one thread.
405 // It does not matter, so shut up already. 420 // It does not matter, so shut up already.
406 // p.s. I hope you die. 421 // p.s. I hope you die.
  422 + (void) type; (void) context; (void) msg;
407 } 423 }
408 424
409 425