|
28 | 28 | #include <QTextStream>
|
29 | 29 |
|
30 | 30 | #if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1800
|
31 |
| -#define TO8(x) (x).toUtf8().constData() |
| 31 | +#define TO8F(x) (x).toUtf8().constData() |
32 | 32 | #else
|
33 |
| -#define TO8(x) (x).toLocal8Bit().constData() |
| 33 | +#define TO8F(x) QFile::encodeName( x ).constData() |
34 | 34 | #endif
|
35 | 35 |
|
36 | 36 | QgsRelief::QgsRelief( const QString& inputFile, const QString& outputFile, const QString& outputFormat ): \
|
@@ -269,7 +269,7 @@ int QgsRelief::processRaster( QProgressDialog* p )
|
269 | 269 | if ( p && p->wasCanceled() )
|
270 | 270 | {
|
271 | 271 | //delete the dataset without closing (because it is faster)
|
272 |
| - GDALDeleteDataset( outputDriver, mOutputFile.toLocal8Bit().data() ); |
| 272 | + GDALDeleteDataset( outputDriver, TO8F( mOutputFile ) ); |
273 | 273 | return 7;
|
274 | 274 | }
|
275 | 275 | GDALClose( outputDataset );
|
@@ -390,7 +390,7 @@ bool QgsRelief::setElevationColor( double elevation, int* red, int* green, int*
|
390 | 390 | //duplicated from QgsNineCellFilter. Todo: make common base class
|
391 | 391 | GDALDatasetH QgsRelief::openInputFile( int& nCellsX, int& nCellsY )
|
392 | 392 | {
|
393 |
| - GDALDatasetH inputDataset = GDALOpen( TO8( mInputFile ), GA_ReadOnly ); |
| 393 | + GDALDatasetH inputDataset = GDALOpen( TO8F( mInputFile ), GA_ReadOnly ); |
394 | 394 | if ( inputDataset != NULL )
|
395 | 395 | {
|
396 | 396 | nCellsX = GDALGetRasterXSize( inputDataset );
|
@@ -444,7 +444,7 @@ GDALDatasetH QgsRelief::openOutputFile( GDALDatasetH inputDataset, GDALDriverH o
|
444 | 444 | papszOptions = CSLSetNameValue( papszOptions, "COMPRESS", "PACKBITS" );
|
445 | 445 |
|
446 | 446 | //create three band raster (reg, green, blue)
|
447 |
| - GDALDatasetH outputDataset = GDALCreate( outputDriver, mOutputFile.toLocal8Bit().data(), xSize, ySize, 3, GDT_Byte, papszOptions ); |
| 447 | + GDALDatasetH outputDataset = GDALCreate( outputDriver, TO8F( mOutputFile ), xSize, ySize, 3, GDT_Byte, papszOptions ); |
448 | 448 | if ( outputDataset == NULL )
|
449 | 449 | {
|
450 | 450 | return outputDataset;
|
|
0 commit comments