aboutsummaryrefslogtreecommitdiff
path: root/libraries/LocalPeer
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/LocalPeer')
-rw-r--r--libraries/LocalPeer/include/LocalPeer.h4
-rw-r--r--libraries/LocalPeer/src/LocalPeer.cpp7
2 files changed, 5 insertions, 6 deletions
diff --git a/libraries/LocalPeer/include/LocalPeer.h b/libraries/LocalPeer/include/LocalPeer.h
index a24e4775..3619ed5d 100644
--- a/libraries/LocalPeer/include/LocalPeer.h
+++ b/libraries/LocalPeer/include/LocalPeer.h
@@ -83,11 +83,11 @@ public:
LocalPeer(QObject *parent, const ApplicationId &appId);
~LocalPeer();
bool isClient();
- bool sendMessage(const QString &message, int timeout);
+ bool sendMessage(const QByteArray &message, int timeout);
ApplicationId applicationId() const;
Q_SIGNALS:
- void messageReceived(const QString &message);
+ void messageReceived(const QByteArray &message);
protected Q_SLOTS:
void receiveConnection();
diff --git a/libraries/LocalPeer/src/LocalPeer.cpp b/libraries/LocalPeer/src/LocalPeer.cpp
index 129f3abc..cb218466 100644
--- a/libraries/LocalPeer/src/LocalPeer.cpp
+++ b/libraries/LocalPeer/src/LocalPeer.cpp
@@ -155,7 +155,7 @@ bool LocalPeer::isClient()
}
-bool LocalPeer::sendMessage(const QString &message, int timeout)
+bool LocalPeer::sendMessage(const QByteArray &message, int timeout)
{
if (!isClient())
return false;
@@ -177,7 +177,7 @@ bool LocalPeer::sendMessage(const QString &message, int timeout)
return false;
}
- QByteArray uMsg(message.toUtf8());
+ QByteArray uMsg(message);
QDataStream ds(&socket);
ds.writeBytes(uMsg.constData(), uMsg.size());
@@ -232,10 +232,9 @@ void LocalPeer::receiveConnection()
delete socket;
return;
}
- QString message(QString::fromUtf8(uMsg));
socket->write(ack, qstrlen(ack));
socket->waitForBytesWritten(1000);
socket->waitForDisconnected(1000); // make sure client reads ack
delete socket;
- emit messageReceived(message); //### (might take a long time to return)
+ emit messageReceived(uMsg); //### (might take a long time to return)
}