Skip to content
Permalink
Browse files

[GRASS] fixed overwrite existing output

  • Loading branch information
blazek committed Oct 20, 2015
1 parent 2d159f3 commit 07fae8fe51b4b3cbb7f9b1e8dc7f23d1869bfc7f
@@ -630,13 +630,15 @@ void QgsGrassModule::run()
if ( ret == QMessageBox::Cancel )
return;

// r.mapcalc does not use standard parser
if ( typeid( *mOptions ) != typeid( QgsGrassMapcalc ) )
#if GRASS_VERSION_MAJOR < 7
// r.mapcalc does not use standard parser (does not accept --o) in GRASS 6
if ( mXName != "r.mapcalc" )
{
arguments.append( "--o" );
//mProcess.addArgument( "--o" );
//command.append ( " --o" );
}
#else
arguments.append( "--o" );
#endif
}
}

@@ -649,6 +651,7 @@ void QgsGrassModule::run()
mViewButton->setEnabled( false );

QStringList list = mOptions->arguments();
list << arguments;

QStringList argumentsHtml;
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
@@ -119,7 +119,9 @@ void QgsGrassModuleInputModel::onDirectoryChanged( const QString & path )
watch( path + "/" + watchedDir );
}
// TODO: use db path defined in mapset VAR
#if GRASS_VERSION_MAJOR >= 7
watch( path + "/tgis/sqlite.db" );
#endif
}
else // cellhd or vector dir
{
@@ -209,7 +211,9 @@ void QgsGrassModuleInputModel::refreshMapset( QStandardItem *mapsetItem, const Q
if ( types.isEmpty() )
{
types << QgsGrassObject::Raster << QgsGrassObject::Vector;
#if GRASS_VERSION_MAJOR >= 7
types << QgsGrassObject::Strds << QgsGrassObject::Stvds << QgsGrassObject::Str3ds;
#endif
}
Q_FOREACH ( QgsGrassObject::Type type, types )
{
@@ -304,7 +308,9 @@ void QgsGrassModuleInputModel::reload()
{
watch( dirPath + "/" + watchedDir );
}
#if GRASS_VERSION_MAJOR >= 7
watch( dirPath + "/tgis/sqlite.db" );
#endif
}
}

@@ -274,7 +274,7 @@ void QgsGrassTools::runModule( QString name, bool direct )
#ifdef Q_OS_WIN
QgsGrass::putEnv( "GRASS_HTML_BROWSER", QgsGrassUtils::htmlBrowserPath() );
QStringList env;
QByteArray origPath = qgetenv( "PATH" );
QByteArray origPath = qgetenv( "PATH" );
QByteArray origPythonPath = qgetenv( "PYTHONPATH" );
QString path = QString( origPath ) + QgsGrass::pathSeparator() + QgsGrass::grassModulesPaths().join( QgsGrass::pathSeparator() );
QString pythonPath = QString( origPythonPath ) + QgsGrass::pathSeparator() + QgsGrass::getPythonPath();
@@ -303,7 +303,10 @@ void QgsGrassTools::runModule( QString name, bool direct )
}
else
{
// set wait cursor because starting module may be slow because of getting temporal datasets (t.list)
QApplication::setOverrideCursor( Qt::WaitCursor );
QgsGrassModule *gmod = new QgsGrassModule( this, name, mIface, direct, mTabWidget );
QApplication::restoreOverrideCursor();
if ( !gmod->errors().isEmpty() )
{
QgsGrass::warning( gmod->errors().join( "\n" ) );
@@ -332,7 +335,6 @@ void QgsGrassTools::runModule( QString name, bool direct )

// We must call resize to reset COLUMNS environment variable
// used by bash !!!

#if 0
/* TODO: Implement something that resizes the terminal without
* crashes.
@@ -1486,6 +1486,7 @@ QStringList QgsGrass::grassObjects( const QgsGrassObject& mapsetObject, QgsGrass
}
else if ( type == QgsGrassObject::Strds || type == QgsGrassObject::Stvds || type == QgsGrassObject::Str3ds )
{
#if GRASS_VERSION_MAJOR >= 7
QString cmd = gisbase() + "/scripts/t.list";
QStringList arguments;

@@ -1515,6 +1516,7 @@ QStringList QgsGrass::grassObjects( const QgsGrassObject& mapsetObject, QgsGrass
}
}
}
#endif
}
else
{

0 comments on commit 07fae8f

Please sign in to comment.
You can’t perform that action at this time.