changeset 740:bc47ac0a44eb

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
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Sun, 19 Sep 2010 16:35:53 +0000
parents cb542a15cc6f
children 0b7602d246e4
files src/IndentHandler.cpp
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;