Skip to content

Commit

Permalink
refactored code to reduce loop in favour of a func
Browse files Browse the repository at this point in the history
  • Loading branch information
Arunmozhi authored and mhugent committed Jan 30, 2012
1 parent c9d9c17 commit 1b8a100
Showing 1 changed file with 2 additions and 22 deletions.
Expand Up @@ -70,28 +70,8 @@ QgsRasterTerrainAnalysisDialog::QgsRasterTerrainAnalysisDialog( DisplayMode mode

//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 1b8a100

Please sign in to comment.