Skip to content

Commit

Permalink
Use plural for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 16, 2024
1 parent aeb9598 commit a421ac4
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 35 deletions.
8 changes: 4 additions & 4 deletions python/PyQt6/core/auto_additions/qgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8638,9 +8638,9 @@
QgsUnitTypes.MilesUSSurvey = Qgis.DistanceUnit.MilesUSSurvey
QgsUnitTypes.MilesUSSurvey.is_monkey_patched = True
QgsUnitTypes.MilesUSSurvey.__doc__ = "US Survery miles \n.. versionadded:: 3.40"
QgsUnitTypes.Fathom = Qgis.DistanceUnit.Fathom
QgsUnitTypes.Fathom.is_monkey_patched = True
QgsUnitTypes.Fathom.__doc__ = "Fathoms \n.. versionadded:: 3.40"
QgsUnitTypes.Fathoms = Qgis.DistanceUnit.Fathoms
QgsUnitTypes.Fathoms.is_monkey_patched = True
QgsUnitTypes.Fathoms.__doc__ = "Fathoms \n.. versionadded:: 3.40"
QgsUnitTypes.MetersGermanLegal = Qgis.DistanceUnit.MetersGermanLegal
QgsUnitTypes.MetersGermanLegal.is_monkey_patched = True
QgsUnitTypes.MetersGermanLegal.__doc__ = "German legal meter \n.. versionadded:: 3.40"
Expand Down Expand Up @@ -8844,7 +8844,7 @@

.. versionadded:: 3.40

* ``Fathom``: Fathoms
* ``Fathoms``: Fathoms

.. versionadded:: 3.40

Expand Down
2 changes: 1 addition & 1 deletion python/PyQt6/core/auto_generated/qgis.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,7 @@ The development version
YardsIndian1962,
YardsIndian1975,
MilesUSSurvey,
Fathom,
Fathoms,
MetersGermanLegal,
Unknown,
};
Expand Down
8 changes: 4 additions & 4 deletions python/core/auto_additions/qgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8562,9 +8562,9 @@
QgsUnitTypes.MilesUSSurvey = Qgis.DistanceUnit.MilesUSSurvey
QgsUnitTypes.MilesUSSurvey.is_monkey_patched = True
QgsUnitTypes.MilesUSSurvey.__doc__ = "US Survery miles \n.. versionadded:: 3.40"
QgsUnitTypes.Fathom = Qgis.DistanceUnit.Fathom
QgsUnitTypes.Fathom.is_monkey_patched = True
QgsUnitTypes.Fathom.__doc__ = "Fathoms \n.. versionadded:: 3.40"
QgsUnitTypes.Fathoms = Qgis.DistanceUnit.Fathoms
QgsUnitTypes.Fathoms.is_monkey_patched = True
QgsUnitTypes.Fathoms.__doc__ = "Fathoms \n.. versionadded:: 3.40"
QgsUnitTypes.MetersGermanLegal = Qgis.DistanceUnit.MetersGermanLegal
QgsUnitTypes.MetersGermanLegal.is_monkey_patched = True
QgsUnitTypes.MetersGermanLegal.__doc__ = "German legal meter \n.. versionadded:: 3.40"
Expand Down Expand Up @@ -8768,7 +8768,7 @@

.. versionadded:: 3.40

* ``Fathom``: Fathoms
* ``Fathoms``: Fathoms

.. versionadded:: 3.40

Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgis.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,7 @@ The development version
YardsIndian1962,
YardsIndian1975,
MilesUSSurvey,
Fathom,
Fathoms,
MetersGermanLegal,
Unknown,
};
Expand Down
2 changes: 1 addition & 1 deletion src/app/decorations/qgsdecorationscalebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ void QgsDecorationScaleBar::render( const QgsMapSettings &mapSettings, QgsRender
case Qgis::DistanceUnit::YardsIndian1962:
case Qgis::DistanceUnit::YardsIndian1975:
case Qgis::DistanceUnit::MilesUSSurvey:
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
case Qgis::DistanceUnit::MetersGermanLegal:
scaleBarUnitLabel = QgsUnitTypes::toAbbreviatedString( scaleBarUnits );
break;
Expand Down
2 changes: 1 addition & 1 deletion src/core/layout/qgslayoutitemelevationprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ void QgsLayoutItemElevationProfile::setDistanceUnit( Qgis::DistanceUnit unit )
case Qgis::DistanceUnit::YardsIndian1962:
case Qgis::DistanceUnit::YardsIndian1975:
case Qgis::DistanceUnit::MilesUSSurvey:
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
case Qgis::DistanceUnit::MetersGermanLegal:
mPlot->xAxis().setLabelSuffix( QStringLiteral( " %1" ).arg( QgsUnitTypes::toAbbreviatedString( mDistanceUnit ) ) );
break;
Expand Down
2 changes: 1 addition & 1 deletion src/core/proj/qgscoordinatereferencesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,7 @@ void QgsCoordinateReferenceSystem::setMapUnits()
else if ( unitName.compare( QLatin1String( "yard" ), Qt::CaseInsensitive ) == 0 )
d->mMapUnits = Qgis::DistanceUnit::Yards;
else if ( unitName.compare( QLatin1String( "fathom" ), Qt::CaseInsensitive ) == 0 )
d->mMapUnits = Qgis::DistanceUnit::Fathom;
d->mMapUnits = Qgis::DistanceUnit::Fathoms;
else if ( unitName.compare( QLatin1String( "US survey chain" ), Qt::CaseInsensitive ) == 0 )
d->mMapUnits = Qgis::DistanceUnit::ChainsUSSurvey;
else if ( unitName.compare( QLatin1String( "chain" ), Qt::CaseInsensitive ) == 0 )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgis.h
Original file line number Diff line number Diff line change
Expand Up @@ -4670,7 +4670,7 @@ class CORE_EXPORT Qgis
YardsIndian1962, //!< Indian yards (1962) \since QGIS 3.40
YardsIndian1975, //!< Indian yards (1975) \since QGIS 3.40
MilesUSSurvey, //!< US Survery miles \since QGIS 3.40
Fathom, //!< Fathoms \since QGIS 3.40
Fathoms, //!< Fathoms \since QGIS 3.40
MetersGermanLegal, //!< German legal meter \since QGIS 3.40
Unknown SIP_MONKEYPATCH_COMPAT_NAME( DistanceUnknownUnit ), //!< Unknown distance unit
};
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrendercontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ double QgsRenderContext::convertMetersToMapUnits( double meters ) const
case Qgis::DistanceUnit::YardsIndian1962:
case Qgis::DistanceUnit::YardsIndian1975:
case Qgis::DistanceUnit::MilesUSSurvey:
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
case Qgis::DistanceUnit::MetersGermanLegal:
return ( meters * QgsUnitTypes::fromUnitToUnitFactor( Qgis::DistanceUnit::Meters, mDistanceArea.sourceCrs().mapUnits() ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsscalecalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void QgsScaleCalculator::calculateMetrics( const QgsRectangle &mapExtent, double
case Qgis::DistanceUnit::YardsIndian1962:
case Qgis::DistanceUnit::YardsIndian1975:
case Qgis::DistanceUnit::MilesUSSurvey:
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
case Qgis::DistanceUnit::MetersGermanLegal:
// convert to inches
conversionFactor = QgsUnitTypes::fromUnitToUnitFactor( mMapUnits, Qgis::DistanceUnit::Inches );
Expand Down
18 changes: 9 additions & 9 deletions src/core/qgsunittypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Qgis::DistanceUnitType QgsUnitTypes::unitType( Qgis::DistanceUnit unit )
case Qgis::DistanceUnit::YardsIndian1962:
case Qgis::DistanceUnit::YardsIndian1975:
case Qgis::DistanceUnit::MilesUSSurvey:
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
case Qgis::DistanceUnit::MetersGermanLegal:
return Qgis::DistanceUnitType::Standard;

Expand Down Expand Up @@ -307,7 +307,7 @@ QString QgsUnitTypes::encodeUnit( Qgis::DistanceUnit unit )
case Qgis::DistanceUnit::MilesUSSurvey:
return QStringLiteral( "miles us survey" );

case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
return QStringLiteral( "yards fathom" );

case Qgis::DistanceUnit::MetersGermanLegal:
Expand Down Expand Up @@ -380,7 +380,7 @@ Qgis::DistanceUnit QgsUnitTypes::decodeDistanceUnit( const QString &string, bool
Qgis::DistanceUnit::YardsIndian1962,
Qgis::DistanceUnit::YardsIndian1975,
Qgis::DistanceUnit::MilesUSSurvey,
Qgis::DistanceUnit::Fathom,
Qgis::DistanceUnit::Fathoms,
Qgis::DistanceUnit::MetersGermanLegal,
} )
{
Expand Down Expand Up @@ -541,7 +541,7 @@ QString QgsUnitTypes::toString( Qgis::DistanceUnit unit )
case Qgis::DistanceUnit::MilesUSSurvey:
return QObject::tr( "miles (US survey)", "distance" );

case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
return QObject::tr( "fathoms", "distance" );

case Qgis::DistanceUnit::MetersGermanLegal:
Expand Down Expand Up @@ -661,7 +661,7 @@ QString QgsUnitTypes::toAbbreviatedString( Qgis::DistanceUnit unit )
case Qgis::DistanceUnit::LinksUSSurvey:
return QObject::tr( "lk", "distance" );

case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
return QObject::tr( "f", "distance" );

case Qgis::DistanceUnit::MetersGermanLegal:
Expand Down Expand Up @@ -734,7 +734,7 @@ Qgis::DistanceUnit QgsUnitTypes::stringToDistanceUnit( const QString &string, bo
Qgis::DistanceUnit::YardsIndian1962,
Qgis::DistanceUnit::YardsIndian1975,
Qgis::DistanceUnit::MilesUSSurvey,
Qgis::DistanceUnit::Fathom,
Qgis::DistanceUnit::Fathoms,
Qgis::DistanceUnit::MetersGermanLegal,
} )
{
Expand Down Expand Up @@ -853,7 +853,7 @@ constexpr double distanceUnitToMeter( Qgis::DistanceUnit unit )
return 0.9143985;
case Qgis::DistanceUnit::MilesUSSurvey:
return 1609.3472186944;
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
return 1.8288;
case Qgis::DistanceUnit::Unknown:
return 1;
Expand Down Expand Up @@ -1599,7 +1599,7 @@ Qgis::AreaUnit QgsUnitTypes::distanceToAreaUnit( Qgis::DistanceUnit distanceUnit
case Qgis::DistanceUnit::YardsIndian1937:
case Qgis::DistanceUnit::YardsIndian1962:
case Qgis::DistanceUnit::YardsIndian1975:
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
return Qgis::AreaUnit::SquareFeet;

case Qgis::DistanceUnit::Yards:
Expand Down Expand Up @@ -2602,7 +2602,7 @@ Qgis::VolumeUnit QgsUnitTypes::distanceToVolumeUnit( Qgis::DistanceUnit distance
case Qgis::DistanceUnit::LinksBritishSears1922:
case Qgis::DistanceUnit::LinksClarkes:
case Qgis::DistanceUnit::LinksUSSurvey:
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
return Qgis::VolumeUnit::CubicFeet;

case Qgis::DistanceUnit::Degrees:
Expand Down
2 changes: 1 addition & 1 deletion src/gui/elevation/qgselevationprofilecanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class QgsElevationProfilePlotItem : public Qgs2DPlot, public QgsPlotCanvasItem
case Qgis::DistanceUnit::YardsIndian1962:
case Qgis::DistanceUnit::YardsIndian1975:
case Qgis::DistanceUnit::MilesUSSurvey:
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
case Qgis::DistanceUnit::MetersGermanLegal:
return QStringLiteral( " %1" ).arg( QgsUnitTypes::toAbbreviatedString( mDistanceUnit ) );

Expand Down
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutmapgridwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ void QgsLayoutMapGridWidget::onCrsChanged()
case Qgis::DistanceUnit::YardsIndian1962:
case Qgis::DistanceUnit::YardsIndian1975:
case Qgis::DistanceUnit::MilesUSSurvey:
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
case Qgis::DistanceUnit::MetersGermanLegal:
break;

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsextentwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void QgsExtentWidget::setOutputExtent( const QgsRectangle &r, const QgsCoordinat
case Qgis::DistanceUnit::YardsIndian1962:
case Qgis::DistanceUnit::YardsIndian1975:
case Qgis::DistanceUnit::MilesUSSurvey:
case Qgis::DistanceUnit::Fathom:
case Qgis::DistanceUnit::Fathoms:
case Qgis::DistanceUnit::MetersGermanLegal:
decimals = 4;
break;
Expand Down
14 changes: 7 additions & 7 deletions tests/src/python/test_qgsunittypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def testDistanceUnitType(self):
Qgis.DistanceUnit.YardsIndian1962: QgsUnitTypes.DistanceUnitType.Standard,
Qgis.DistanceUnit.YardsIndian1975: QgsUnitTypes.DistanceUnitType.Standard,
Qgis.DistanceUnit.MilesUSSurvey: QgsUnitTypes.DistanceUnitType.Standard,
Qgis.DistanceUnit.Fathom: QgsUnitTypes.DistanceUnitType.Standard,
Qgis.DistanceUnit.Fathoms: QgsUnitTypes.DistanceUnitType.Standard,
Qgis.DistanceUnit.MetersGermanLegal: QgsUnitTypes.DistanceUnitType.Standard,
}

Expand Down Expand Up @@ -155,7 +155,7 @@ def testEncodeDecodeDistanceUnits(self):
Qgis.DistanceUnit.YardsIndian1962,
Qgis.DistanceUnit.YardsIndian1975,
Qgis.DistanceUnit.MilesUSSurvey,
Qgis.DistanceUnit.Fathom,
Qgis.DistanceUnit.Fathoms,
Qgis.DistanceUnit.MetersGermanLegal,
]

Expand Down Expand Up @@ -224,7 +224,7 @@ def testDistanceUnitsToFromString(self):
Qgis.DistanceUnit.YardsIndian1962,
Qgis.DistanceUnit.YardsIndian1975,
Qgis.DistanceUnit.MilesUSSurvey,
Qgis.DistanceUnit.Fathom,
Qgis.DistanceUnit.Fathoms,
Qgis.DistanceUnit.MetersGermanLegal,
]

Expand Down Expand Up @@ -565,7 +565,7 @@ def testFromUnitToUnitFactor(self):
Qgis.DistanceUnit.YardsIndian1962: 1 / 0.9143988,
Qgis.DistanceUnit.YardsIndian1975: 1 / 0.9143985,
Qgis.DistanceUnit.MilesUSSurvey: 1 / 1609.3472186944,
Qgis.DistanceUnit.Fathom: 1 / 1.8288,
Qgis.DistanceUnit.Fathoms: 1 / 1.8288,
Qgis.DistanceUnit.MetersGermanLegal: 1 / 1.0000135965,
},
QgsUnitTypes.DistanceUnit.DistanceKilometers: {
Expand Down Expand Up @@ -750,7 +750,7 @@ def testFromUnitToUnitFactor(self):
Qgis.DistanceUnit.Meters: 0.9143985},
Qgis.DistanceUnit.MilesUSSurvey: {
Qgis.DistanceUnit.Meters: 1609.3472186944},
Qgis.DistanceUnit.Fathom: {
Qgis.DistanceUnit.Fathoms: {
Qgis.DistanceUnit.Meters: 1.8288},
Qgis.DistanceUnit.MetersGermanLegal: {
Qgis.DistanceUnit.Meters: 1.0000135965},
Expand Down Expand Up @@ -1034,7 +1034,7 @@ def testDistanceToAreaUnit(self):
Qgis.DistanceUnit.YardsIndian1962: Qgis.AreaUnit.SquareFeet,
Qgis.DistanceUnit.YardsIndian1975: Qgis.AreaUnit.SquareFeet,
Qgis.DistanceUnit.MilesUSSurvey: Qgis.AreaUnit.SquareMiles,
Qgis.DistanceUnit.Fathom: Qgis.AreaUnit.SquareFeet,
Qgis.DistanceUnit.Fathoms: Qgis.AreaUnit.SquareFeet,
Qgis.DistanceUnit.MetersGermanLegal: Qgis.AreaUnit.SquareMeters,
}

Expand Down Expand Up @@ -1428,7 +1428,7 @@ def testDistanceToVolumeUnit(self):
Qgis.DistanceUnit.YardsIndian1962: Qgis.VolumeUnit.VolumeCubicYards,
Qgis.DistanceUnit.YardsIndian1975: Qgis.VolumeUnit.VolumeCubicYards,
Qgis.DistanceUnit.MilesUSSurvey: Qgis.VolumeUnit.VolumeCubicFeet,
Qgis.DistanceUnit.Fathom: Qgis.VolumeUnit.VolumeCubicFeet,
Qgis.DistanceUnit.Fathoms: Qgis.VolumeUnit.VolumeCubicFeet,
Qgis.DistanceUnit.MetersGermanLegal: Qgis.VolumeUnit.VolumeCubicMeters,
}

Expand Down

0 comments on commit a421ac4

Please sign in to comment.