qmlFrontend/hwengine.cpp
branchqmlfrontend
changeset 10418 091d2c0216c3
parent 10416 1c301054694d
child 10420 02c573d19224
--- a/qmlFrontend/hwengine.cpp	Sat Sep 20 00:56:54 2014 +0400
+++ b/qmlFrontend/hwengine.cpp	Sun Sep 21 00:37:50 2014 +0400
@@ -45,7 +45,7 @@
 
     m_args.resize(m_argsList.size());
     for(int i = m_argsList.size() - 1; i >=0; --i)
-        m_args[i] = m_argsList[i].data();
+        m_args[i] = m_argsList[i].constData();
 
     RunEngine(m_args.size(), m_args.data());
     sendIPC("!");
@@ -68,17 +68,15 @@
 
 void HWEngine::sendIPC(const QByteArray & b)
 {
-    string255 str;
-    str.len = b.size() > 255 ? 255 : b.size();
-    qDebug() << "semdIPC: len = " << str.len;
-    qCopy(b.data(), &(b.data()[str.len - 1]), &(str.str[0]));
+    quint8 len = b.size() > 255 ? 255 : b.size();
+    qDebug() << "sendIPC: len = " << len;
 
-    ipcToEngine(str);
+    ipcToEngine(len, b.constData());
 }
 
-void HWEngine::engineMessageCallback(void *context, string255 str)
+void HWEngine::engineMessageCallback(void *context, quint8 len, const char *msg)
 {
-    QByteArray b = QByteArray::fromRawData((const char *)&str.s, str.len + 1);
+    QByteArray b = QByteArray::fromRawData(msg, len);
 
     qDebug() << "FLIPC in" << b;
 }