[QGIS Commit] r10131 - branches/Version-1_0/src/plugins/grass
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Feb 8 13:14:40 EST 2009
Author: jef
Date: 2009-02-08 13:14:40 -0500 (Sun, 08 Feb 2009)
New Revision: 10131
Modified:
branches/Version-1_0/src/plugins/grass/qgsgrassmodule.cpp
branches/Version-1_0/src/plugins/grass/qgsgrassshell.cpp
branches/Version-1_0/src/plugins/grass/qgsgrasstools.cpp
Log:
merge r10130 in version 1.0
Modified: branches/Version-1_0/src/plugins/grass/qgsgrassmodule.cpp
===================================================================
--- branches/Version-1_0/src/plugins/grass/qgsgrassmodule.cpp 2009-02-08 18:14:04 UTC (rev 10130)
+++ branches/Version-1_0/src/plugins/grass/qgsgrassmodule.cpp 2009-02-08 18:14:40 UTC (rev 10131)
@@ -87,19 +87,19 @@
if ( QFile::exists( file ) ) return file; // full path
- // Search for module
+#ifdef WIN32
+ // On windows try .bat first
for ( QStringList::iterator it = mExecPath.begin();
it != mExecPath.end(); ++it )
{
- QString full = *it + "/" + file;
+ QString full = *it + "/" + file + ".bat";
if ( QFile::exists( full ) )
{
return full;
}
}
- // Not found try with .exe
-#ifdef WIN32
+ // .exe next
for ( QStringList::iterator it = mExecPath.begin();
it != mExecPath.end(); ++it )
{
@@ -109,8 +109,21 @@
return full;
}
}
+
+ // and then try if it's a script (w/o extension)
#endif
+ // Search for module
+ for ( QStringList::iterator it = mExecPath.begin();
+ it != mExecPath.end(); ++it )
+ {
+ QString full = *it + "/" + file;
+ if ( QFile::exists( full ) )
+ {
+ return full;
+ }
+ }
+
return QString();
}
@@ -131,24 +144,7 @@
return arguments;
}
-#if defined(WIN32)
- QFileInfo fi( exe );
- if ( fi.isExecutable() )
- {
- arguments.append( exe );
- }
- else // script
- {
- QString cmd = getShortPath( QgsApplication::applicationDirPath() ) + "/msys/bin/sh";
- arguments.append( cmd );
-
- // Important! Otherwise it does not find DLL even if it is in PATH
- arguments.append( "--login" );
- arguments.append( exe );
- }
-#else
arguments.append( exe );
-#endif
return arguments;
}
Modified: branches/Version-1_0/src/plugins/grass/qgsgrassshell.cpp
===================================================================
--- branches/Version-1_0/src/plugins/grass/qgsgrassshell.cpp 2009-02-08 18:14:04 UTC (rev 10130)
+++ branches/Version-1_0/src/plugins/grass/qgsgrassshell.cpp 2009-02-08 18:14:40 UTC (rev 10131)
@@ -183,7 +183,7 @@
setsid();
seteuid( 0 );
- int fd = open(( char* ) slaveName.ascii(), O_RDWR );
+ int fd = ::open(( char* ) slaveName.ascii(), O_RDWR );
if ( fd < 0 )
{
QMessageBox::warning( 0, "Warning", "Cannot open slave file "
Modified: branches/Version-1_0/src/plugins/grass/qgsgrasstools.cpp
===================================================================
--- branches/Version-1_0/src/plugins/grass/qgsgrasstools.cpp 2009-02-08 18:14:04 UTC (rev 10130)
+++ branches/Version-1_0/src/plugins/grass/qgsgrasstools.cpp 2009-02-08 18:14:40 UTC (rev 10131)
@@ -171,32 +171,9 @@
#endif
#ifdef WIN32
- // Run MSYS if available
- // Note: I was not able to run cmd.exe and command.com
- // with QProcess
-
- QString msysPath = appDir() + "/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, tr( "Warning" ),
- tr( "Cannot find MSYS (" ) + msysPath + ")" );
+ if( !QProcess::startDetached( getenv("COMSPEC") ) ) {
+ QMessageBox::warning( 0, "Warning", tr("Cannot start command shell (%1)").arg( getenv("COMSPEC") ) );
}
- else
- {
- 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
More information about the QGIS-commit
mailing list