Skip to content
Permalink
Browse files
[GRASS] non blocking raster import stream on win
  • Loading branch information
blazek committed May 29, 2015
1 parent aeb0e71 commit 81ef17197da22dc9c3923572408bc45a194ee97d
Showing with 5 additions and 1 deletion.
  1. +3 −1 src/providers/grass/qgis.r.in.cpp
  2. +2 −0 src/providers/grass/qgsgrassimport.cpp
@@ -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() );

@@ -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() )

0 comments on commit 81ef171

Please sign in to comment.