Skip to content

Commit a201ae9

Browse files
committedJan 30, 2012
Apply loop improvement from Arunmozhi also to raster calc dialog
1 parent 1b8a100 commit a201ae9

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed
 

‎src/app/qgsrastercalcdialog.cpp

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -155,27 +155,8 @@ void QgsRasterCalcDialog::insertAvailableOutputFormats()
155155

156156
//store the driver shortnames and the corresponding extensions
157157
//(just in case the user does not give an extension for the output file name)
158-
int index = 0;
159-
while (( driverMetadata ) && driverMetadata[index] != 0 )
160-
{
161-
QStringList metadataTokens = QString( driverMetadata[index] ).split( "=", QString::SkipEmptyParts );
162-
if ( metadataTokens.size() < 1 )
163-
{
164-
break;
165-
}
166-
167-
if ( metadataTokens[0] == "DMD_EXTENSION" )
168-
{
169-
if ( metadataTokens.size() < 2 )
170-
{
171-
++index;
172-
continue;
173-
}
174-
mDriverExtensionMap.insert( QString( GDALGetDriverShortName( driver ) ), metadataTokens[1] );
175-
break;
176-
}
177-
++index;
178-
}
158+
QString driverExtension = GDALGetMetadataItem( driver, GDAL_DMD_EXTENSION, NULL );
159+
mDriverExtensionMap.insert( QString( GDALGetDriverShortName( driver ) ), driverExtension );
179160
}
180161
}
181162
}

0 commit comments

Comments
 (0)
Please sign in to comment.