aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrizio Bekerle <patrizio@bekerle.com>2018-12-14 19:41:55 +0100
committerItay Grudev <itay-grudev@users.noreply.github.com>2018-12-14 20:41:55 +0200
commitb24d5394a580930919d207683c03954aaafd0e54 (patch)
tree3ba3001d8e2116e525968e943654eef596ccd9dd
parentfixed a typo (#55) (diff)
downloadsingleapplication-b24d5394a580930919d207683c03954aaafd0e54.tar.xz
fixed build process below Qt 5.6 (#57)
-rw-r--r--singleapplication_p.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/singleapplication_p.cpp b/singleapplication_p.cpp
index 1edd2b8..c1bdff4 100644
--- a/singleapplication_p.cpp
+++ b/singleapplication_p.cpp
@@ -207,7 +207,11 @@ void SingleApplicationPrivate::connectToPrimary( int msecs, ConnectionType conne
// Notify the parent that a new instance had been started;
QByteArray initMsg;
QDataStream writeStream(&initMsg, QIODevice::WriteOnly);
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
writeStream.setVersion(QDataStream::Qt_5_6);
+#endif
+
writeStream << blockServerName.toLatin1();
writeStream << static_cast<quint8>(connectionType);
writeStream << instanceNumber;
@@ -217,7 +221,10 @@ void SingleApplicationPrivate::connectToPrimary( int msecs, ConnectionType conne
// The header indicates the message length that follows
QByteArray header;
QDataStream headerStream(&header, QIODevice::WriteOnly);
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
headerStream.setVersion(QDataStream::Qt_5_6);
+#endif
headerStream << static_cast <quint64>( initMsg.length() );
socket->write( header );
@@ -300,7 +307,10 @@ void SingleApplicationPrivate::readInitMessageHeader( QLocalSocket *sock )
}
QDataStream headerStream( sock );
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
headerStream.setVersion( QDataStream::Qt_5_6 );
+#endif
// Read the header to know the message length
quint64 msgLen = 0;
@@ -330,7 +340,10 @@ void SingleApplicationPrivate::readInitMessageBody( QLocalSocket *sock )
// Read the message body
QByteArray msgBytes = sock->read(info.msgLen);
QDataStream readStream(msgBytes);
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
readStream.setVersion( QDataStream::Qt_5_6 );
+#endif
// server name
QByteArray latin1Name;