|
28 | 28 | #include <QFile> |
29 | 29 | #include <QTextStream> |
30 | 30 |
|
31 | | -#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1800 |
32 | | -#define TO8F(x) (x).toUtf8().constData() |
33 | | -#else |
34 | | -#define TO8F(x) QFile::encodeName( x ).constData() |
35 | | -#endif |
36 | | - |
37 | 31 | QgsRelief::QgsRelief( const QString& inputFile, const QString& outputFile, const QString& outputFormat ) |
38 | 32 | : mInputFile( inputFile ) |
39 | 33 | , mOutputFile( outputFile ) |
@@ -292,7 +286,7 @@ int QgsRelief::processRaster( QProgressDialog* p ) |
292 | 286 | if ( p && p->wasCanceled() ) |
293 | 287 | { |
294 | 288 | //delete the dataset without closing (because it is faster) |
295 | | - GDALDeleteDataset( outputDriver, TO8F( mOutputFile ) ); |
| 289 | + GDALDeleteDataset( outputDriver, mOutputFile.toUtf8().constData() ); |
296 | 290 | return 7; |
297 | 291 | } |
298 | 292 | GDALClose( outputDataset ); |
@@ -415,7 +409,7 @@ bool QgsRelief::setElevationColor( double elevation, int* red, int* green, int* |
415 | 409 | //duplicated from QgsNineCellFilter. Todo: make common base class |
416 | 410 | GDALDatasetH QgsRelief::openInputFile( int& nCellsX, int& nCellsY ) |
417 | 411 | { |
418 | | - GDALDatasetH inputDataset = GDALOpen( TO8F( mInputFile ), GA_ReadOnly ); |
| 412 | + GDALDatasetH inputDataset = GDALOpen( mInputFile.toUtf8().constData(), GA_ReadOnly ); |
419 | 413 | if ( inputDataset ) |
420 | 414 | { |
421 | 415 | nCellsX = GDALGetRasterXSize( inputDataset ); |
@@ -469,7 +463,7 @@ GDALDatasetH QgsRelief::openOutputFile( GDALDatasetH inputDataset, GDALDriverH o |
469 | 463 | papszOptions = CSLSetNameValue( papszOptions, "COMPRESS", "PACKBITS" ); |
470 | 464 |
|
471 | 465 | //create three band raster (reg, green, blue) |
472 | | - GDALDatasetH outputDataset = GDALCreate( outputDriver, TO8F( mOutputFile ), xSize, ySize, 3, GDT_Byte, papszOptions ); |
| 466 | + GDALDatasetH outputDataset = GDALCreate( outputDriver, mOutputFile.toUtf8().constData(), xSize, ySize, 3, GDT_Byte, papszOptions ); |
473 | 467 | if ( !outputDataset ) |
474 | 468 | { |
475 | 469 | return outputDataset; |
|
0 commit comments