Skip to content

Commit

Permalink
Apply loop improvement from Arunmozhi also to raster calc dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jan 30, 2012
1 parent 1b8a100 commit a201ae9
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/app/qgsrastercalcdialog.cpp
Expand Up @@ -155,27 +155,8 @@ void QgsRasterCalcDialog::insertAvailableOutputFormats()

//store the driver shortnames and the corresponding extensions
//(just in case the user does not give an extension for the output file name)
int index = 0;
while (( driverMetadata ) && driverMetadata[index] != 0 )
{
QStringList metadataTokens = QString( driverMetadata[index] ).split( "=", QString::SkipEmptyParts );
if ( metadataTokens.size() < 1 )
{
break;
}

if ( metadataTokens[0] == "DMD_EXTENSION" )
{
if ( metadataTokens.size() < 2 )
{
++index;
continue;
}
mDriverExtensionMap.insert( QString( GDALGetDriverShortName( driver ) ), metadataTokens[1] );
break;
}
++index;
}
QString driverExtension = GDALGetMetadataItem( driver, GDAL_DMD_EXTENSION, NULL );
mDriverExtensionMap.insert( QString( GDALGetDriverShortName( driver ) ), driverExtension );
}
}
}
Expand Down

0 comments on commit a201ae9

Please sign in to comment.