Skip to content
Permalink
Browse files

refactored code to reduce loop in favour of a func

  • Loading branch information
tecoholic authored and mhugent committed Jan 30, 2012
1 parent c9d9c17 commit 1b8a1002d000d85848f7514af675c934cf601fa5
Showing with 2 additions and 22 deletions.
  1. +2 −22 src/plugins/raster_terrain_analysis/qgsrasterterrainanalysisdialog.cpp
@@ -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 );
}
}
}

0 comments on commit 1b8a100

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