[rkward/frameworks] rkward: Merge branch 'master' into frameworks

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Mon Feb 22 08:47:19 UTC 2016


Git commit edcc8b79696f824cc696156eb350a3705e516913 by Thomas Friedrichsmeier.
Committed on 22/02/2016 at 08:46.
Pushed by tfry into branch 'frameworks'.

Merge branch 'master' into frameworks

M  +2    -2    rkward/plugin/rkformula.cpp
M  +12   -4    rkward/rbackend/rpackages/rkward/R/public_graphics.R
M  +26   -3    rkward/rkward_startup_wrapper.cpp

http://commits.kde.org/rkward/edcc8b79696f824cc696156eb350a3705e516913

diff --cc rkward/plugin/rkformula.cpp
index e8e7832,bb82618..b50666f
--- a/rkward/plugin/rkformula.cpp
+++ b/rkward/plugin/rkformula.cpp
@@@ -40,12 -40,12 +40,12 @@@ RKFormula::RKFormula (const QDomElemen
  	RK_TRACE (PLUGIN);
  
  	// create and register properties
- 	fixed_factors = new RKComponentPropertyRObjects (this, true);
+ 	fixed_factors = new RKComponentPropertyRObjects (this, false);
 -	connect (fixed_factors, SIGNAL (valueChanged(RKComponentPropertyBase*)), this, SLOT (factorsChanged(RKComponentPropertyBase*)));
 +	connect (fixed_factors, &RKComponentPropertyBase::valueChanged, this, &RKFormula::factorsChanged);
  	addChild ("fixed_factors", fixed_factors);
  	fixed_factors->setInternal (true);
- 	dependent = new RKComponentPropertyRObjects (this, true);
+ 	dependent = new RKComponentPropertyRObjects (this, false);
 -	connect (dependent, SIGNAL (valueChanged(RKComponentPropertyBase*)), this, SLOT (factorsChanged(RKComponentPropertyBase*)));
 +	connect (dependent, &RKComponentPropertyBase::valueChanged, this, &RKFormula::factorsChanged);
  	addChild ("dependent", dependent);
  	dependent->setInternal (true);
  	model = new RKComponentPropertyBase (this, true);
diff --cc rkward/rkward_startup_wrapper.cpp
index 2ef9e8d,0e9c720..09d6492
--- a/rkward/rkward_startup_wrapper.cpp
+++ b/rkward/rkward_startup_wrapper.cpp
@@@ -55,11 -55,12 +55,12 @@@ QString findRKWardAtPath (const QStrin
  	return findExeAtPath ("rkward.frontend", path);
  }
  
 -#ifdef Q_WS_WIN
 +#ifdef Q_OS_WIN
  #include <windows.h>
+ #include <QTemporaryFile>
  #endif
  QString quoteCommand (const QString &orig) {
 -#ifdef Q_WS_WIN
 +#ifdef Q_OS_WIN
  // Get short path name as a safe way to pass all sort of commands on the Windows shell
  // credits to http://erasmusjam.wordpress.com/2012/10/01/get-8-3-windows-short-path-names-in-a-qt-application/
  	wchar_t input[orig.size()+1];
@@@ -296,11 -290,33 +297,33 @@@ int main (int argc, char *argv[]) 
  	if (debug_level > 2) qDebug ("Starting frontend: %s %s", qPrintable (r_exe), qPrintable (call_args.join (" ")));
  
  	InteractiveProcess proc;
 -#ifdef Q_WS_WIN
 +#ifdef Q_OS_WIN
- 	proc.setProcessChannelMode (debugger_args.isEmpty () ? QProcess::MergedChannels : QProcess::ForwardedChannels);   // ForwardedChannels causes console window to pop up!
- #else
- 	proc.setProcessChannelMode (QProcess::ForwardedChannels);
+ 	if (debugger_args.isEmpty ()) {
+ 		// start _without_ opening an annoying console window
+ 		QTemporaryFile *vbsf = new QTemporaryFile (QDir::tempPath () + "/rkwardlaunchXXXXXX.vbs");
+ 		vbsf->setAutoRemove (false);
+ 		if (vbsf->open ()) {
+ 			QTextStream vbs (vbsf);
+ 			vbs << "Dim WinScriptHost\r\nSet WinScriptHost = CreateObject(\"WScript.Shell\")\r\nWinScriptHost.Run \"" << quoteCommand (r_exe);
+ 			for (int i = 0;  i < call_args.length (); ++i) {
+ 				vbs << " " << call_args[i];
+ 			}
+ 			vbs << "\", 0\r\nSet WomScriptHost = Nothing\r\n";
+ 			vbsf->close ();
+ 			QString filename = vbsf->fileName ();
+ 			delete (vbsf);  // somehow, if creating vbsf on the stack, we cannot launch it, because "file is in use by another process", despite we have closed it.
+ 			proc.start ("WScript.exe", QStringList (filename));
+ 			bool ok = proc.waitForFinished (-1);
+ 			if (proc.exitCode () || !ok) {
+ 				QMessageBox::critical (0, "Error starting RKWard", QString ("Starting RKWard failed with error \"%1\"").arg (proc.errorString ()));
+ 			}
+ 			QFile (filename).remove ();
+ 			return (0);
+ 		}
+ 	}
+ 	// if that did not work or not on windows:
  #endif
+ 	proc.setProcessChannelMode (QProcess::ForwardedChannels);
  	proc.start (quoteCommand (r_exe), call_args);
  	bool ok = proc.waitForFinished (-1);
  	if (proc.exitCode () || !ok) {



More information about the rkward-tracker mailing list