Skip to content

Commit 9d9cd71

Browse files
author
rblazek
committed
error messages for copy,rename,delete
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5058 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent caf2209 commit 9d9cd71

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/plugins/grass/qgsgrassbrowser.cpp

+16-6
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,13 @@ void QgsGrassBrowser::copyMap()
275275
#endif
276276
QProcess process(this);
277277
process.start(module, QStringList( typeName + "=" + map + "@" + mapset + "," + newName ) );
278-
if ( !process.waitForFinished() )
278+
if ( !process.waitForFinished() || process.exitCode() != 0 )
279279
{
280+
QString output ( process.readAllStandardOutput () );
281+
QString error ( process.readAllStandardError () );
280282
QMessageBox::warning( 0, "Warning", "Cannot copy map "
281-
+ map + "@" + mapset );
283+
+ map + "@" + mapset + "<br>" + output.replace("\n","<br>")
284+
+ "<br>" + error.replace("\n","<br>") );
282285
}
283286
else
284287
{
@@ -335,9 +338,13 @@ void QgsGrassBrowser::renameMap()
335338
#endif
336339
QProcess process(this);
337340
process.start(module, QStringList( typeName + "=" + map + "," + newName ) );
338-
if ( !process.waitForFinished() )
341+
if ( !process.waitForFinished() || process.exitCode() != 0 )
339342
{
340-
QMessageBox::warning( 0, "Warning", "Cannot rename map " + map );
343+
QString output ( process.readAllStandardOutput () );
344+
QString error ( process.readAllStandardError () );
345+
QMessageBox::warning( 0, "Warning", "Cannot rename map "
346+
+ map + "<br>" + output.replace("\n","<br>")
347+
+ "<br>" + error.replace("\n","<br>") );
341348
}
342349
else
343350
{
@@ -383,10 +390,13 @@ void QgsGrassBrowser::deleteMap()
383390
#endif
384391
QProcess process(this);
385392
process.start(module, QStringList( typeName + "=" + map ) );
386-
if ( !process.waitForFinished() )
393+
if ( !process.waitForFinished() || process.exitCode() != 0 )
387394
{
395+
QString output ( process.readAllStandardOutput () );
396+
QString error ( process.readAllStandardError () );
388397
QMessageBox::warning( 0, "Warning", "Cannot delete map "
389-
+ map );
398+
+ map + "<br>" + output.replace("\n","<br>")
399+
+ "<br>" + error.replace("\n","<br>") );
390400
}
391401
else
392402
{

0 commit comments

Comments
 (0)