mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
[GRASS] non blocking raster import stream on win
This commit is contained in:
parent
aeb0e71e32
commit
81ef17197d
@ -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() )
|
||||
|
Loading…
x
Reference in New Issue
Block a user