File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1272,12 +1272,22 @@ void QgsGrassModule::readStdout()
1272
1272
#endif
1273
1273
1274
1274
QString line;
1275
+ QRegExp rxpercent ( " GRASS_INFO_PERCENT: (\\ d+)" );
1276
+
1275
1277
mProcess .setReadChannel ( QProcess::StandardOutput );
1276
1278
while ( mProcess .canReadLine () ) {
1277
1279
// line = QString::fromLocal8Bit( mProcess.readLineStdout().ascii() );
1278
1280
QByteArray ba = mProcess .readLine ();
1279
1281
line = QString::fromLocal8Bit ( QString (ba).ascii () );
1280
- mOutputTextBrowser ->append ( line );
1282
+
1283
+ // GRASS_INFO_PERCENT is catched here only because of bugs in GRASS,
1284
+ // normaly it should be printed to stderr
1285
+ if ( rxpercent.search ( line ) != -1 ) {
1286
+ int progress = rxpercent.cap (1 ).toInt ();
1287
+ mProgressBar ->setProgress ( progress, 100 );
1288
+ } else {
1289
+ mOutputTextBrowser ->append ( line );
1290
+ }
1281
1291
}
1282
1292
}
1283
1293
@@ -1301,7 +1311,7 @@ void QgsGrassModule::readStderr()
1301
1311
// line = QString::fromLocal8Bit( mProcess.readLineStderr().ascii() );
1302
1312
QByteArray ba = mProcess .readLine ();
1303
1313
line = QString::fromLocal8Bit ( QString (ba).ascii () );
1304
- // std::cerr << "stderr: " << line << std::endl;
1314
+ // std::cerr << "line: ' " << line.ascii() << "'" << std::endl;
1305
1315
1306
1316
if ( rxpercent.search ( line ) != -1 ) {
1307
1317
int progress = rxpercent.cap (1 ).toInt ();
You can’t perform that action at this time.
0 commit comments