[GRASS] non blocking raster import stream on win

This commit is contained in:
Radim Blazek 2015-05-29 20:45:37 +02:00
parent aeb0e71e32
commit 81ef17197d
2 changed files with 5 additions and 1 deletions

View File

@ -66,7 +66,7 @@ extern "C"
// http://lists.qt-project.org/pipermail/interest/2012-May/002110.html
// http://lists.qt-project.org/pipermail/interest/2012-May/002117.html
// TODO: This is just test if it works on Windows
QByteArray readData( QFile & file, quint32 size )
QByteArray readData( QFile & file, qint32 size )
{
QByteArray byteArray;
forever
@ -233,8 +233,10 @@ int main( int argc, char **argv )
}
G_put_raster_row( cf, buf, grass_type );
#ifndef Q_OS_WIN
stdoutStream << ( bool )true; // row written
stdoutFile.flush();
#endif
}
//G_fatal_error( "%s", msg.toAscii().data() );

View File

@ -264,10 +264,12 @@ bool QgsGrassRasterImport::import()
outStream << false; // not canceled
outStream << byteArray;
#ifndef Q_OS_WIN
// wait until the row is written to allow quick cancel (don't send data to buffer)
process->waitForReadyRead();
bool result;
outStream >> result;
#endif
}
delete block;
if ( isCanceled() )