Skip to content

Commit 0017807

Browse files
committed
Georeferencer: a fix to support non-ASCII path
1 parent f8d6e32 commit 0017807

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

src/plugins/georeferencer/qgsgeorefplugingui.cpp

+3-11
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ void QgsGeorefPluginGui::generateGDALScript()
358358
{
359359
gdalwarpCommand = generateGDALwarpCommand( resamplingStr, mCompressionMethod, mUseZeroForTrans, order,
360360
mUserResX, mUserResY );
361-
showGDALScript( 2, translateCommand.toAscii().data(), gdalwarpCommand.toAscii().data() );
361+
showGDALScript( QStringList() << translateCommand << gdalwarpCommand );
362362
break;
363363
}
364364
}
@@ -1761,17 +1761,9 @@ void QgsGeorefPluginGui::updateTransformParamLabel()
17611761
}
17621762

17631763
// Gdal script
1764-
void QgsGeorefPluginGui::showGDALScript( int argNum... )
1764+
void QgsGeorefPluginGui::showGDALScript( const QStringList& commands )
17651765
{
1766-
QString script;
1767-
va_list vl;
1768-
va_start( vl, argNum );
1769-
while ( argNum-- )
1770-
{
1771-
script.append( va_arg( vl, char * ) );
1772-
script.append( "\n" );
1773-
}
1774-
va_end( vl );
1766+
QString script = commands.join( "\n" ) + "\n";
17751767

17761768
// create window to show gdal script
17771769
QDialogButtonBox *bbxGdalScript = new QDialogButtonBox( QDialogButtonBox::Cancel, Qt::Horizontal, this );

src/plugins/georeferencer/qgsgeorefplugingui.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas
161161
void updateTransformParamLabel();
162162

163163
// gdal script
164-
void showGDALScript( int argNum... );
164+
void showGDALScript( const QStringList& commands );
165165
QString generateGDALtranslateCommand( bool generateTFW = true );
166166
/* Generate command-line for gdalwarp based on current GCPs and given parameters.
167167
* For values in the range 1 to 3, the parameter "order" prescribes the degree of the interpolating polynomials to use,

src/plugins/georeferencer/qgsimagewarper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ bool QgsImageWarper::createDestinationDataset(
8686
char **papszOptions = NULL;
8787
papszOptions = CSLSetNameValue( papszOptions, "COMPRESS", compression.toAscii() );
8888
hDstDS = GDALCreate( driver,
89-
QFile::encodeName( outputName ).constData(), resX, resY,
89+
TO8F( outputName ), resX, resY,
9090
GDALGetRasterCount( hSrcDS ),
9191
GDALGetRasterDataType( GDALGetRasterBand( hSrcDS, 1 ) ),
9292
papszOptions );

0 commit comments

Comments
 (0)