# HG changeset patch # User thomas_-_s # Date 1284914153 0 # Node ID bc47ac0a44eb7bd9f5865e70f059533d30467e8c # Parent cb542a15cc6f81f2e42fd756b66d7b17b2168fc6 Changed the environment of the invoked indenter executable to contain the working directory within the PWD environment variable. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@1017 59b1889a-e5ac-428c-b0c7-476e01d41282 diff -r cb542a15cc6f -r bc47ac0a44eb src/IndentHandler.cpp --- a/src/IndentHandler.cpp Sun Sep 19 12:25:49 2010 +0000 +++ b/src/IndentHandler.cpp Sun Sep 19 16:35:53 2010 +0000 @@ -510,7 +510,12 @@ // errors and standard outputs from the process call are merged together //indentProcess.setReadChannelMode(QProcess::MergedChannels); - // Set the directory for the indenter execution + // Set the directory where the indenter will be executed for the process' environment as PWD. + QStringList env = indentProcess.environment(); + env << "PWD=" + QFileInfo(tempDirctoryStr).absoluteFilePath(); + indentProcess.setEnvironment( env ); + + // Set the directory for the indenter execution indentProcess.setWorkingDirectory( QFileInfo(tempDirctoryStr).absoluteFilePath() ); qDebug() << __LINE__ << " " << __FUNCTION__ << ": Will call the indenter in the directory " << indentProcess.workingDirectory() << " using this commandline call: " << indenterCompleteCallString; @@ -556,6 +561,7 @@ errorMessageDialog->showMessage(tr("Error calling Indenter"), processReturnString); } + // If the indenter returned an error code != 0 show its output. if ( indentProcess.exitCode() != 0 ) { QString exitCode;