[Qgis-developer] Typo in QgsRasterLayer enum

Tim Sutton lists at linfiniti.com
Tue Aug 10 12:04:08 EDT 2010


Hi

Fixed in r14042.

Regards

Tim

On Tue, Aug 10, 2010 at 11:37 AM, Manuel Massing
<m.massing at warped-space.de> wrote:
> Hi Pete,
>
>> Last night  I was looking through the QgsRasterLayer code and noticed a
>> typo in the DrawingStyle enum that made it in during the major renaming
>> efforts  (r9564 & r9566) just before version 1.0 was released.
>>
>> MultiBandSingleGandGray should be MultiBandsingleBandGray
>>
>> Question is how do we go about fixing it and preserving compatibility?
>>
>> I was thinking we would need to:
>> 1) add the correctly spelled enum
>> 2) use both enums where ever the incorrect one appears, example
>> if( QgsRasterLayer::MultiBandSingleGandGray )
>> becomes
>> if( QgsRasterLayer::MultiBandSingleGandGray ||
>> QgsRasterLayer::MultiBandsingleBandGray )
>> 3) Wait until v2.0 to drop MultiBandSingleGandGray enum
>
> It is possible to let multiple enumeration constants share the same value,
> e.g.
>
>  enum Test {
>    Value1,
>    Value1alias = Value1,
>    Value2
>  };
>
>
> This retains binary and source compatibility, so one could introduce the
> correctly written enum as an alias, rename all enums in the qgis codebase to
> the orthographically correct one (which has identical numerical value, so
> won't affect binary API) and mark the old enum constant name as deprecated,
> (keep it around for source compatibility until 2.0).
>
> cheers,
>
>        Manuel
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==============================================


More information about the Qgis-developer mailing list