[rkward/frameworks] rkward/rbackend: Windows-specific compilation and startup fixes.

Thomas Friedrichsmeier null at kde.org
Fri May 19 11:21:54 UTC 2017


Git commit 6ea53cf921a9b1e98eb7690c782862e5236cfd9a by Thomas Friedrichsmeier.
Committed on 19/05/2017 at 11:21.
Pushed by tfry into branch 'frameworks'.

Windows-specific compilation and startup fixes.

M  +1    -1    rkward/rbackend/CMakeLists.txt
M  +6    -3    rkward/rbackend/rkfrontendtransmitter.cpp
M  +3    -2    rkward/rbackend/rkrbackend.cpp

https://commits.kde.org/rkward/6ea53cf921a9b1e98eb7690c782862e5236cfd9a

diff --git a/rkward/rbackend/CMakeLists.txt b/rkward/rbackend/CMakeLists.txt
index 3a255416..3ba05779 100644
--- a/rkward/rbackend/CMakeLists.txt
+++ b/rkward/rbackend/CMakeLists.txt
@@ -7,7 +7,7 @@ ENDIF(NOT WIN32)
 ADD_SUBDIRECTORY( rpackages )
 ADD_SUBDIRECTORY( rkwarddevice )
 
-INCLUDE_DIRECTORIES( ${R_INCLUDEDIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}   )
+INCLUDE_DIRECTORIES( ${R_INCLUDEDIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LibIntl_INCLUDE_DIRS} )
 
 SET (
 	rbackend_shared_SRCS
diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index a55c8f66..c3c92801 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -158,11 +158,14 @@ void RKFrontendTransmitter::connectAndEnterLoop () {
 	// handshake
 	if (!con->canReadLine ()) con->waitForReadyRead (1000);
 	QString token_c = QString::fromLocal8Bit (con->readLine ());
-	token_c.chop (1);
+	token_c = token_c.trimmed ();
 	if (token_c != token) handleTransmissionError (i18n ("Error during handshake with backend process. Expected token '%1', received token '%2'", token, token_c));
 	if (!con->canReadLine ()) con->waitForReadyRead (1000);
-	QString version_c = QString::fromLocal8Bit (con->readLine ());
-	version_c.chop (1);
+	QString version_c = QString::fromLocal8Bit (con->readLine ().trimmed ());
+	if (version_c.isEmpty ()) {  // may happend on Windows, due to \r\n lines ends
+		if (!con->canReadLine ()) con->waitForReadyRead (1000);
+			version_c = QString::fromLocal8Bit (con->readLine ().trimmed ());
+	}
 	if (version_c != RKWARD_VERSION) handleTransmissionError (i18n ("Version mismatch during handshake with backend process. Frontend is version '%1' while backend is '%2'.\nPlease fix your installation.", QString (RKWARD_VERSION), version_c));
 
 	setConnection (con);
diff --git a/rkward/rbackend/rkrbackend.cpp b/rkward/rbackend/rkrbackend.cpp
index a30a7bd3..548d8d1f 100644
--- a/rkward/rbackend/rkrbackend.cpp
+++ b/rkward/rbackend/rkrbackend.cpp
@@ -178,8 +178,9 @@ void RKRBackend::clearPendingInterrupt () {
 LibExtern void Rf_PrintWarnings (void);
 #endif
 extern "C" void run_Rmainloop (void);
-#include <R_ext/eventloop.h>
-
+#ifndef Q_OS_WIN
+#	include <R_ext/eventloop.h>
+#endif
 
 #include "rdata.h"
 



More information about the rkward-tracker mailing list