From f8fb7694bc2d90e9e1929aed68ce874c8067a5e4 Mon Sep 17 00:00:00 2001 From: timlinux Date: Tue, 5 Dec 2006 13:10:17 +0000 Subject: [PATCH] Fix for msys shell not launching due to spaces in paths / filenames git-svn-id: http://svn.osgeo.org/qgis/trunk@6187 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/plugins/grass/qgsgrasstools.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/plugins/grass/qgsgrasstools.cpp b/src/plugins/grass/qgsgrasstools.cpp index 950f9cb0b65..629551c9210 100644 --- a/src/plugins/grass/qgsgrasstools.cpp +++ b/src/plugins/grass/qgsgrasstools.cpp @@ -211,24 +211,27 @@ void QgsGrassTools::moduleClicked( Q3ListViewItem * item ) // Note: I was not able to run cmd.exe and command.com // with QProcess - QString msysPath = mAppDir + "/msys/msys.bat"; + QString msysPath = mAppDir + "/msys/bin/rxvt.exe"; + QString myArguments = "-backspacekey ^H -sl 2500 -fg white -bg black -sr -fn Courier-16 -tn msys -geometry 80x25 -e /bin/sh --login -i"; QFile file ( msysPath ); if ( !file.exists() ) { - QMessageBox::warning( 0, "Warning", - "Cannot find MSYS (" + msysPath + ")" ); + QMessageBox::warning( 0, "Warning", + "Cannot find MSYS (" + msysPath + ")" ); } else { - QProcess *proc = new QProcess(this); - proc->start (msysPath); - proc->waitForStarted(); - if ( proc->state() != QProcess::Running ) - { - QMessageBox::warning( 0, "Warning", + QProcess *proc = new QProcess(this); + //allow msys to exist in a path with spaces + msysPath = "\"" + msysPath + "\"" ; + proc->start(msysPath + " " + myArguments); + proc->waitForStarted(); + if ( proc->state() != QProcess::Running ) + { + QMessageBox::warning( 0, "Warning", "Cannot start MSYS (" + msysPath + ")" ); - } + } } return; #else