Skip to content

Commit

Permalink
Replace capitalise by capitalize
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ committed Dec 29, 2016
1 parent 5e87155 commit 7911994
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 24 deletions.
4 changes: 3 additions & 1 deletion doc/api_break.dox
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
<tr><td>QgsApplication<td>userStyleV2Path<td>userStylePath
<tr><td>QgsComposerShape<td>setUseSymbolV2<td>setUseSymbol
<tr><td>QgsIFeatureSelectionManager<td>selectedFeaturesIds<td>selectedFeatureIds
<tr><td>QgsMapLayer<td>capitaliseLayerName<td>capitalizeLayerName
<tr><td>QgsSymbolLayerUtils<td>createSymbolLayerV2ListFromSld<td>createSymbolLayerListFromSld
<tr><td>QgsVectorLayer<td>editorWidgetV2Config<td>editorWidgetConfig
<tr><td>QgsVectorLayer<td>editorWidgetV2Text<td>editorWidgetText
Expand Down Expand Up @@ -309,7 +310,7 @@ Data Providers {#qgis_api_break_3_0_DataProviders}
Qgis {#qgis_api_break_3_0_Qgis}
----

- The QGis class was renamed to Qgis for capitalisation consistency with other class names
- The QGis class was renamed to Qgis for capitalization consistency with other class names
- permissiveToDouble() and permissiveToInt() where moved out of the QGis class and renamed to qgsPermissiveToDouble() and
qgsPermissiveToInt()
- The constants DEFAULT_IDENTIFY_RADIUS and MINIMUM_POINT_SIZE were removed
Expand Down Expand Up @@ -1130,6 +1131,7 @@ screenUpdateRequested() were removed. These members have had no effect for a num
- drawLabels() method was removed. It used old deprecated labeling. Replaced by labeling based on PAL library, see QgsLabelingEngine.
- readLayerXML() was renamed to readLayerXml()
- writeLayerXML() was renamed to writeLayerXml()
- capitaliseLayerName() was renamed to capitalizeLayerName()


QgsMapLayerRegistry {#qgis_api_break_3_0_QgsMapLayerRegistry}
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsmaplayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ class QgsMapLayer : QObject
/** Sets layer's spatial reference system */
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );

/** A convenience function to (un)capitalise the layer name */
static QString capitaliseLayerName( const QString& name );
/** A convenience function to (un)capitalize the layer name */
static QString capitalizeLayerName( const QString& name );

/** Retrieve the style URI for this layer
* (either as a .qml file on disk or as a
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9118,7 +9118,7 @@ void QgisApp::showOptionsDialog( QWidget *parent, const QString& currentPage )
QSettings mySettings;
QString oldScales = mySettings.value( QStringLiteral( "Map/scales" ), PROJECT_SCALES ).toString();

bool oldCapitalise = mySettings.value( QStringLiteral( "/qgis/capitaliseLayerName" ), QVariant( false ) ).toBool();
bool oldCapitalize = mySettings.value( QStringLiteral( "/qgis/capitalizeLayerName" ), QVariant( false ) ).toBool();

QgsOptions *optionsDialog = new QgsOptions( parent );
if ( !currentPage.isEmpty() )
Expand All @@ -9143,7 +9143,7 @@ void QgisApp::showOptionsDialog( QWidget *parent, const QString& currentPage )

mMapCanvas->setMapUpdateInterval( mySettings.value( QStringLiteral( "/qgis/map_update_interval" ), 250 ).toInt() );

if ( oldCapitalise != mySettings.value( QStringLiteral( "/qgis/capitaliseLayerName" ), QVariant( false ) ).toBool() )
if ( oldCapitalize != mySettings.value( QStringLiteral( "/qgis/capitalizeLayerName" ), QVariant( false ) ).toBool() )
{
// if the layer capitalization has changed, we need to update all layer names
Q_FOREACH ( QgsMapLayer* layer, QgsProject::instance()->mapLayers() )
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl )
pbnMeasureColor->setContext( QStringLiteral( "gui" ) );
pbnMeasureColor->setDefaultColor( QColor( 222, 155, 67 ) );

capitaliseCheckBox->setChecked( mSettings->value( QStringLiteral( "/qgis/capitaliseLayerName" ), QVariant( false ) ).toBool() );
capitalizeCheckBox->setChecked( mSettings->value( QStringLiteral( "/qgis/capitalizeLayerName" ), QVariant( false ) ).toBool() );

int projOpen = mSettings->value( QStringLiteral( "/qgis/projOpenAtLaunch" ), 0 ).toInt();
mProjectOnLaunchCmbBx->setCurrentIndex( projOpen );
Expand Down Expand Up @@ -1185,8 +1185,8 @@ void QgsOptions::saveOptions()

mSettings->setValue( QStringLiteral( "/qgis/map_update_interval" ), spinMapUpdateInterval->value() );
mSettings->setValue( QStringLiteral( "/qgis/legendDoubleClickAction" ), cmbLegendDoubleClickAction->currentIndex() );
bool legendLayersCapitalise = mSettings->value( QStringLiteral( "/qgis/capitaliseLayerName" ), false ).toBool();
mSettings->setValue( QStringLiteral( "/qgis/capitaliseLayerName" ), capitaliseCheckBox->isChecked() );
bool legendLayersCapitalize = mSettings->value( QStringLiteral( "/qgis/capitalizeLayerName" ), false ).toBool();
mSettings->setValue( QStringLiteral( "/qgis/capitalizeLayerName" ), capitalizeCheckBox->isChecked() );

// Default simplify drawing configuration
QgsVectorSimplifyMethod::SimplifyHints simplifyHints = QgsVectorSimplifyMethod::NoSimplification;
Expand Down Expand Up @@ -1440,7 +1440,7 @@ void QgsOptions::saveOptions()
// refresh legend if any legend item's state is to be changed
if ( legendLayersBold != mLegendLayersBoldChkBx->isChecked()
|| legendGroupsBold != mLegendGroupsBoldChkBx->isChecked()
|| legendLayersCapitalise != capitaliseCheckBox->isChecked() )
|| legendLayersCapitalize != capitalizeCheckBox->isChecked() )
{
// TODO[MD] QgisApp::instance()->legend()->updateLegendItemStyles();
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ void QgsRasterLayerProperties::apply()

void QgsRasterLayerProperties::on_mLayerOrigNameLineEd_textEdited( const QString& text )
{
leDisplayName->setText( mRasterLayer->capitaliseLayerName( text ) );
leDisplayName->setText( mRasterLayer->capitalizeLayerName( text ) );
}

void QgsRasterLayerProperties::on_buttonBuildPyramids_clicked()
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ QString QgsVectorLayerProperties::metadata()

void QgsVectorLayerProperties::on_mLayerOrigNameLineEdit_textEdited( const QString& text )
{
txtDisplayName->setText( mLayer->capitaliseLayerName( text ) );
txtDisplayName->setText( mLayer->capitalizeLayerName( text ) );
}

void QgsVectorLayerProperties::on_mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem& crs )
Expand Down
14 changes: 7 additions & 7 deletions src/core/qgsmaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ QgsMapLayer::QgsMapLayer( QgsMapLayer::LayerType type,
, mStyleManager( new QgsMapLayerStyleManager( this ) )
{
// Set the display name = internal name
mLayerName = capitaliseLayerName( mLayerOrigName );
mLayerName = capitalizeLayerName( mLayerOrigName );

mShortName = QLatin1String( "" );
//mShortName.replace( QRegExp( "[\\W]" ), "_" );
Expand Down Expand Up @@ -106,7 +106,7 @@ QString QgsMapLayer::id() const

void QgsMapLayer::setName( const QString& name )
{
QString newName = capitaliseLayerName( name );
QString newName = capitalizeLayerName( name );
if ( name == mLayerOrigName && newName == mLayerName )
return;

Expand Down Expand Up @@ -994,16 +994,16 @@ void QgsMapLayer::setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSign
emit crsChanged();
}

QString QgsMapLayer::capitaliseLayerName( const QString& name )
QString QgsMapLayer::capitalizeLayerName( const QString& name )
{
// Capitalise the first letter of the layer name if requested
// Capitalize the first letter of the layer name if requested
QSettings settings;
bool capitaliseLayerName =
settings.value( QStringLiteral( "/qgis/capitaliseLayerName" ), QVariant( false ) ).toBool();
bool capitalizeLayerName =
settings.value( QStringLiteral( "/qgis/capitalizeLayerName" ), QVariant( false ) ).toBool();

QString layerName( name );

if ( capitaliseLayerName && !layerName.isEmpty() )
if ( capitalizeLayerName && !layerName.isEmpty() )
layerName = layerName.at( 0 ).toUpper() + layerName.mid( 1 );

return layerName;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmaplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ class CORE_EXPORT QgsMapLayer : public QObject
//! Sets layer's spatial reference system
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );

//! A convenience function to (un)capitalise the layer name
static QString capitaliseLayerName( const QString& name );
//! A convenience function to (un)capitalize the layer name
static QString capitalizeLayerName( const QString& name );

/** Retrieve the style URI for this layer
* (either as a .qml file on disk or as a
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ void QgsVectorLayer::setDataSource( const QString& dataSource, const QString& ba
QgsWkbTypes::GeometryType geomType = mValid && mDataProvider ? geometryType() : QgsWkbTypes::UnknownGeometry;

mDataSource = dataSource;
mLayerName = capitaliseLayerName( baseName );
mLayerName = capitalizeLayerName( baseName );
setName( mLayerName );
setDataProvider( provider );

Expand Down
6 changes: 3 additions & 3 deletions src/ui/qgsoptionsbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2902,15 +2902,15 @@
</spacer>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="capitaliseCheckBox">
<widget class="QCheckBox" name="capitalizeCheckBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Capitalise layer names</string>
<string>Capitalize layer names</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -5457,7 +5457,7 @@
<tabstop>pbnSelectionColor</tabstop>
<tabstop>pbnCanvasColor</tabstop>
<tabstop>cmbLegendDoubleClickAction</tabstop>
<tabstop>capitaliseCheckBox</tabstop>
<tabstop>capitalizeCheckBox</tabstop>
<tabstop>mLegendLayersBoldChkBx</tabstop>
<tabstop>mLegendGroupsBoldChkBx</tabstop>
<tabstop>cbxLegendClassifiers</tabstop>
Expand Down

0 comments on commit 7911994

Please sign in to comment.