[rkward-cvs] SF.net SVN: rkward-code:[4831] trunk/rkward/rkward/rbackend/ rkfrontendtransmitter.cpp

tfry at users.sf.net tfry at users.sf.net
Wed Sep 17 13:12:18 UTC 2014


Revision: 4831
          http://sourceforge.net/p/rkward/code/4831
Author:   tfry
Date:     2014-09-17 13:12:17 +0000 (Wed, 17 Sep 2014)
Log Message:
-----------
More diagnostics, and another fix for trouble locating backend executable

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rkfrontendtransmitter.cpp

Modified: trunk/rkward/rkward/rbackend/rkfrontendtransmitter.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rkfrontendtransmitter.cpp	2014-09-17 12:11:31 UTC (rev 4830)
+++ trunk/rkward/rkward/rbackend/rkfrontendtransmitter.cpp	2014-09-17 13:12:17 UTC (rev 4831)
@@ -38,14 +38,15 @@
 QString findBackendAtPath (const QString &path) {
 	QDir dir (path);
 	dir.makeAbsolute ();
-	QString ret;
 #ifdef Q_WS_WIN
-	if (QFileInfo (dir.filePath ("rkward.rbackend.exe")).isExecutable ()) ret = dir.filePath ("rkward.rbackend.exe");
+	QString ret = dir.filePath ("rkward.rbackend.exe");
 #else
-	if (QFileInfo (dir.filePath ("rkward.rbackend")).isExecutable ()) ret = dir.filePath ("rkward.rbackend");
+	QString ret = dir.filePath ("rkward.rbackend");
 #endif
-	RK_DEBUG (RBACKEND, DL_DEBUG, "Looking for backend at %s: %s", qPrintable (dir.absolutePath ()), qPrintable (ret));
-	return ret;
+	RK_DEBUG (RBACKEND, DL_DEBUG, "Looking for backend at %s", qPrintable (ret));
+	QFileInfo fi (ret);
+	if (fi.exists () && fi.isExecutable ()) return ret;
+	return QString ();
 }
 
 RKFrontendTransmitter::RKFrontendTransmitter () : RKAbstractTransmitter () {
@@ -105,6 +106,10 @@
 		backend->start (backend_executable, args, QIODevice::ReadOnly);
 	}
 
+	if (!backend->waitForStarted ()) {
+		handleTransmissionError (i18n ("The backend executable could not be started. Error message was: %1").arg (backend->errorString ()));
+	}
+
 	// fetch security token
 	if (!backend->canReadLine ()) backend->waitForReadyRead ();
 	token = QString::fromLocal8Bit (backend->readLine ()).trimmed ();





More information about the rkward-tracker mailing list