Skip to content

Commit

Permalink
[GRASS] non blocking raster import stream on win
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed May 29, 2015
1 parent aeb0e71 commit 81ef171
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/grass/qgis.r.in.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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() );

Expand Down
2 changes: 2 additions & 0 deletions src/providers/grass/qgsgrassimport.cpp
Expand Up @@ -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() )
Expand Down

0 comments on commit 81ef171

Please sign in to comment.