Skip to content
Permalink
Browse files

Append suffix in raster terrain plugin

  • Loading branch information
mhugent committed Jan 12, 2012
1 parent c8ac76c commit 8d560a9c62480aca2840321c481b9b533c996291
Showing with 23 additions and 1 deletion.
  1. +23 −1 src/plugins/raster_terrain_analysis/qgsrasterterrainanalysisdialog.cpp
@@ -139,7 +139,29 @@ QString QgsRasterTerrainAnalysisDialog::inputFile() const

QString QgsRasterTerrainAnalysisDialog::outputFile() const
{
return mOutputLayerLineEdit->text();
QString outputFileName = mOutputLayerLineEdit->text();
QFileInfo fileInfo( outputFileName );
QString suffix = fileInfo.suffix();
if ( !suffix.isEmpty() )
{
return outputFileName;
}

//add the file format extension if the user did not specify it
int index = mOutputFormatComboBox->currentIndex();
if ( index == -1 )
{
return outputFileName;
}

QString driverShortName = mOutputFormatComboBox->itemData( index ).toString();
QMap<QString, QString>::const_iterator it = mDriverExtensionMap.find( driverShortName );
if ( it == mDriverExtensionMap.constEnd() )
{
return outputFileName;
}

return ( outputFileName + "." + it.value() );
}

QString QgsRasterTerrainAnalysisDialog::outputFormat() const

0 comments on commit 8d560a9

Please sign in to comment.
You can’t perform that action at this time.