Skip to content

Commit

Permalink
Fix for msys shell not launching due to spaces in paths / filenames
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6187 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Dec 5, 2006
1 parent e79fc68 commit 244681b
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/plugins/grass/qgsgrasstools.cpp
Expand Up @@ -211,24 +211,27 @@ void QgsGrassTools::moduleClicked( Q3ListViewItem * item )
// Note: I was not able to run cmd.exe and command.com // Note: I was not able to run cmd.exe and command.com
// with QProcess // 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 ); QFile file ( msysPath );


if ( !file.exists() ) if ( !file.exists() )
{ {
QMessageBox::warning( 0, "Warning", QMessageBox::warning( 0, "Warning",
"Cannot find MSYS (" + msysPath + ")" ); "Cannot find MSYS (" + msysPath + ")" );
} }
else else
{ {
QProcess *proc = new QProcess(this); QProcess *proc = new QProcess(this);
proc->start (msysPath); //allow msys to exist in a path with spaces
proc->waitForStarted(); msysPath = "\"" + msysPath + "\"" ;
if ( proc->state() != QProcess::Running ) proc->start(msysPath + " " + myArguments);
{ proc->waitForStarted();
QMessageBox::warning( 0, "Warning", if ( proc->state() != QProcess::Running )
{
QMessageBox::warning( 0, "Warning",
"Cannot start MSYS (" + msysPath + ")" ); "Cannot start MSYS (" + msysPath + ")" );
} }
} }
return; return;
#else #else
Expand Down

0 comments on commit 244681b

Please sign in to comment.