From 81ef17197da22dc9c3923572408bc45a194ee97d Mon Sep 17 00:00:00 2001 From: Radim Blazek Date: Fri, 29 May 2015 20:45:37 +0200 Subject: [PATCH] [GRASS] non blocking raster import stream on win --- src/providers/grass/qgis.r.in.cpp | 4 +++- src/providers/grass/qgsgrassimport.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/providers/grass/qgis.r.in.cpp b/src/providers/grass/qgis.r.in.cpp index 94dfb7257ad..16b8ea2955c 100644 --- a/src/providers/grass/qgis.r.in.cpp +++ b/src/providers/grass/qgis.r.in.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() ); diff --git a/src/providers/grass/qgsgrassimport.cpp b/src/providers/grass/qgsgrassimport.cpp index 22b49f27bbe..cb3433c76b1 100644 --- a/src/providers/grass/qgsgrassimport.cpp +++ b/src/providers/grass/qgsgrassimport.cpp @@ -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() )