mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Remove QgsMapLayer::originalName()
Now QgsMapLayer::name() is guaranteed to return the same string
This commit is contained in:
parent
1e4f6917de
commit
6f55e50a13
@ -1667,6 +1667,7 @@ screenUpdateRequested() were removed. These members have had no effect for a num
|
||||
now sets the maximum (i.e. largest scale, or most zoomed in) at which the layer will appear, and setMinimumScale now sets the minimum (i.e. smallest scale,
|
||||
or most zoomed out) at which the layer will appear. The same is true for the maximumScale and minimumScale getters.
|
||||
- capitalizeLayerName() was removed. Use formatLayerName() instead.
|
||||
- originalName() was removed. Use name() instead.
|
||||
|
||||
|
||||
QgsMapLayerActionRegistry {#qgis_api_break_3_0_QgsMapLayerActionRegistry}
|
||||
|
@ -97,7 +97,6 @@ Returns the layer's unique ID, which is used to access this layer from QgsProjec
|
||||
QString name() const;
|
||||
%Docstring
|
||||
Returns the display name of the layer.
|
||||
:return: the layer name
|
||||
.. seealso:: setName()
|
||||
:rtype: str
|
||||
%End
|
||||
@ -109,12 +108,6 @@ Returns the layer's unique ID, which is used to access this layer from QgsProjec
|
||||
%End
|
||||
|
||||
|
||||
QString originalName() const;
|
||||
%Docstring
|
||||
Returns the original name of the layer.
|
||||
:rtype: str
|
||||
%End
|
||||
|
||||
void setShortName( const QString &shortName );
|
||||
%Docstring
|
||||
Sets the short name of the layer
|
||||
@ -1184,7 +1177,6 @@ Set error message
|
||||
|
||||
|
||||
|
||||
|
||||
bool hasDependencyCycle( const QSet<QgsMapLayerDependency> &layers ) const;
|
||||
%Docstring
|
||||
Checks whether a new set of dependencies will introduce a cycle
|
||||
|
@ -724,7 +724,7 @@ void QgsRasterLayerProperties::sync()
|
||||
*/
|
||||
|
||||
//these properties (layer name and label) are provided by the qgsmaplayer superclass
|
||||
mLayerOrigNameLineEd->setText( mRasterLayer->originalName() );
|
||||
mLayerOrigNameLineEd->setText( mRasterLayer->name() );
|
||||
leDisplayName->setText( mRasterLayer->name() );
|
||||
|
||||
//get the thumbnail for the layer
|
||||
|
@ -432,7 +432,7 @@ void QgsVectorLayerProperties::insertFieldOrExpression()
|
||||
void QgsVectorLayerProperties::syncToLayer()
|
||||
{
|
||||
// populate the general information
|
||||
mLayerOrigNameLineEdit->setText( mLayer->originalName() );
|
||||
mLayerOrigNameLineEdit->setText( mLayer->name() );
|
||||
txtDisplayName->setText( mLayer->name() );
|
||||
pbnQueryBuilder->setWhatsThis( tr( "This button opens the query "
|
||||
"builder and allows you to create a subset of features to display on "
|
||||
|
@ -55,7 +55,6 @@ QgsMapLayer::QgsMapLayer( QgsMapLayer::LayerType type,
|
||||
const QString &lyrname,
|
||||
const QString &source )
|
||||
: mDataSource( source )
|
||||
, mLayerOrigName( lyrname ) // store the original name
|
||||
, mLayerType( type )
|
||||
, mStyleManager( new QgsMapLayerStyleManager( this ) )
|
||||
{
|
||||
@ -137,10 +136,9 @@ QString QgsMapLayer::id() const
|
||||
|
||||
void QgsMapLayer::setName( const QString &name )
|
||||
{
|
||||
if ( name == mLayerOrigName && name == mLayerName )
|
||||
if ( name == mLayerName )
|
||||
return;
|
||||
|
||||
mLayerOrigName = name;
|
||||
mLayerName = name;
|
||||
|
||||
emit nameChanged();
|
||||
@ -162,11 +160,6 @@ const QgsDataProvider *QgsMapLayer::dataProvider() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QString QgsMapLayer::originalName() const
|
||||
{
|
||||
return mLayerOrigName;
|
||||
}
|
||||
|
||||
QString QgsMapLayer::publicSource() const
|
||||
{
|
||||
// Redo this every time we're asked for it, as we don't know if
|
||||
@ -720,7 +713,7 @@ bool QgsMapLayer::writeLayerXml( QDomElement &layerElement, QDomDocument &docume
|
||||
|
||||
// layer name
|
||||
QDomElement layerName = document.createElement( QStringLiteral( "layername" ) );
|
||||
QDomText layerNameText = document.createTextNode( originalName() );
|
||||
QDomText layerNameText = document.createTextNode( name() );
|
||||
layerName.appendChild( layerNameText );
|
||||
layerElement.appendChild( layerName );
|
||||
|
||||
|
@ -138,7 +138,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
|
||||
|
||||
/**
|
||||
* Returns the display name of the layer.
|
||||
* \returns the layer name
|
||||
* \see setName()
|
||||
*/
|
||||
QString name() const;
|
||||
@ -154,11 +153,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
|
||||
*/
|
||||
virtual const QgsDataProvider *dataProvider() const SIP_SKIP;
|
||||
|
||||
/**
|
||||
* Returns the original name of the layer.
|
||||
*/
|
||||
QString originalName() const;
|
||||
|
||||
/**
|
||||
* Sets the short name of the layer
|
||||
* used by QGIS Server to identify the layer.
|
||||
@ -1125,11 +1119,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
|
||||
//! Name of the layer - used for display
|
||||
QString mLayerName;
|
||||
|
||||
/**
|
||||
* Original name of the layer
|
||||
*/
|
||||
QString mLayerOrigName;
|
||||
|
||||
QString mShortName;
|
||||
QString mTitle;
|
||||
|
||||
|
@ -194,7 +194,7 @@ QgsVectorLayer::~QgsVectorLayer()
|
||||
|
||||
QgsVectorLayer *QgsVectorLayer::clone() const
|
||||
{
|
||||
QgsVectorLayer *layer = new QgsVectorLayer( source(), originalName(), mProviderKey );
|
||||
QgsVectorLayer *layer = new QgsVectorLayer( source(), name(), mProviderKey );
|
||||
QgsMapLayer::clone( layer );
|
||||
|
||||
QList<QgsVectorLayerJoinInfo> joins = vectorJoins();
|
||||
@ -3997,7 +3997,7 @@ QString QgsVectorLayer::htmlMetadata() const
|
||||
myMetadata += QLatin1String( "<table class=\"list-view\">\n" );
|
||||
|
||||
// original name
|
||||
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Original" ) + QStringLiteral( "</td><td>" ) + originalName() + QStringLiteral( "</td></tr>\n" );
|
||||
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Original" ) + QStringLiteral( "</td><td>" ) + name() + QStringLiteral( "</td></tr>\n" );
|
||||
|
||||
// name
|
||||
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Name" ) + QStringLiteral( "</td><td>" ) + name() + QStringLiteral( "</td></tr>\n" );
|
||||
|
@ -146,7 +146,7 @@ QgsRasterLayer::~QgsRasterLayer()
|
||||
|
||||
QgsRasterLayer *QgsRasterLayer::clone() const
|
||||
{
|
||||
QgsRasterLayer *layer = new QgsRasterLayer( source(), originalName(), mProviderKey );
|
||||
QgsRasterLayer *layer = new QgsRasterLayer( source(), name(), mProviderKey );
|
||||
QgsMapLayer::clone( layer );
|
||||
|
||||
// do not clone data provider which is the first element in pipe
|
||||
@ -317,7 +317,7 @@ QString QgsRasterLayer::htmlMetadata() const
|
||||
myMetadata += QLatin1String( "<table class=\"list-view\">\n" );
|
||||
|
||||
// original name
|
||||
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Original" ) + QStringLiteral( "</td><td>" ) + originalName() + QStringLiteral( "</td></tr>\n" );
|
||||
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Original" ) + QStringLiteral( "</td><td>" ) + name() + QStringLiteral( "</td></tr>\n" );
|
||||
|
||||
// name
|
||||
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Name" ) + QStringLiteral( "</td><td>" ) + name() + QStringLiteral( "</td></tr>\n" );
|
||||
|
Loading…
x
Reference in New Issue
Block a user