Skip to content

Commit 6c6f3c1

Browse files
committedJul 14, 2016
Remove deprecated members from QgsMapLayer
1 parent 7d2027f commit 6c6f3c1

File tree

5 files changed

+5
-115
lines changed

5 files changed

+5
-115
lines changed
 

‎doc/api_break.dox

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ only affects third party c++ providers, and does not affect PyQGIS scripts.</li>
5252

5353
<ul>
5454
<li>crs() now returns a QgsCoordinateReferenceSystem object, not a reference. This change has no effect for PyQGIS code.</li>
55+
<li>setLayerName() was removed, use setName() instead. The layerNameChanged() signal has been replaced by nameChanged().</li>
56+
<li>toggleScaleBasedVisibility() was replaced by setScaleBasedVisibility()</li>
57+
<li>lastErrorTitle(), lastError(), cacheImage(), onCacheImageDelete(), clearCacheImage() and the signals drawingProgress(),
58+
screenUpdateRequested() were removed. These members have had no effect for a number of QGIS 2.x releases.</li>
5559
</ul>
5660

5761
\subsection qgis_api_break_3_0_QgsJSONExporter QgsJSONExporter

‎python/core/qgsmaplayer.sip

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ class QgsMapLayer : QObject
6161
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry */
6262
QString id() const;
6363

64-
/** Set the display name of the layer
65-
* @param name New name for the layer
66-
*/
67-
void setLayerName( const QString & name ) /Deprecated/;
68-
6964
/**
7065
* Set the display name of the layer
7166
* @param name New name for the layer
@@ -343,13 +338,6 @@ class QgsMapLayer : QObject
343338
/** Remove a custom property from layer. Properties are stored in a map and saved in project file. */
344339
void removeCustomProperty( const QString& key );
345340

346-
347-
//! @deprecated since 2.4 - returns empty string
348-
virtual QString lastErrorTitle() /Deprecated/;
349-
350-
//! @deprecated since 2.4 - returns empty string
351-
virtual QString lastError() /Deprecated/;
352-
353341
/** Get current status error. This error describes some principal problem
354342
* for which layer cannot work and thus is not valid. It is not last error
355343
* after accessing data by draw() etc.
@@ -507,13 +495,6 @@ class QgsMapLayer : QObject
507495
void setLegendUrlFormat( const QString& legendUrlFormat );
508496
QString legendUrlFormat() const;
509497

510-
/** @deprecated since 2.4 - returns nullptr */
511-
QImage *cacheImage() /Deprecated/;
512-
/** @deprecated since 2.4 - caches listen to repaintRequested() signal to invalidate the cached image */
513-
void setCacheImage( QImage * thepImage /Transfer/ ) /Deprecated/;
514-
/** @deprecated since 2.4 - does nothing */
515-
virtual void onCacheImageDelete() /Deprecated/;
516-
517498
/**
518499
* Assign a legend controller to the map layer. The object will be responsible for providing legend items.
519500
* @param legend Takes ownership of the object. Can be null pointer
@@ -602,16 +583,6 @@ class QgsMapLayer : QObject
602583
*/
603584
void setScaleBasedVisibility( const bool enabled );
604585

605-
/** Accessor for the scale based visilibility flag
606-
* @deprecated use setScaleBasedVisibility instead
607-
*/
608-
void toggleScaleBasedVisibility( bool theVisibilityFlag ) /Deprecated/;
609-
610-
/** Clear cached image
611-
* @deprecated in 2.4 - use triggerRepaint() - caches automatically listen to repaintRequested() signal to invalidate the cached image
612-
*/
613-
void clearCacheImage() /Deprecated/;
614-
615586
/**
616587
* Will advice the map canvas (and any other interested party) that this layer requires to be repainted.
617588
* Will emit a repaintRequested() signal.
@@ -633,17 +604,9 @@ class QgsMapLayer : QObject
633604

634605
signals:
635606

636-
//! @deprecated in 2.4 - not emitted anymore
637-
void drawingProgress( int theProgress, int theTotalSteps );
638-
639607
/** Emit a signal with status (e.g. to be caught by QgisApp and display a msg on status bar) */
640608
void statusChanged( const QString& theStatus );
641609

642-
/** Emit a signal that the layer name has been changed
643-
* @deprecated since 2.16 use nameChanged() instead
644-
*/
645-
void layerNameChanged();
646-
647610
/**
648611
* Emitted when the name has been changed
649612
*
@@ -659,9 +622,6 @@ class QgsMapLayer : QObject
659622
*/
660623
void repaintRequested();
661624

662-
//! \note Deprecated in 2.4 and not emitted anymore
663-
void screenUpdateRequested();
664-
665625
/** This is used to send a request that any mapcanvas using this layer update its extents */
666626
void recalculateExtents();
667627

‎python/plugins/processing/gui/Postprocessing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def handleAlgorithmResults(alg, progress=None, showResults=True):
6262
if isinstance(out, (OutputRaster, OutputVector, OutputTable)):
6363
try:
6464
if hasattr(out, "layer") and out.layer is not None:
65-
out.layer.setLayerName(out.description)
65+
out.layer.setName(out.description)
6666
QgsMapLayerRegistry.instance().addMapLayers([out.layer])
6767
else:
6868
if ProcessingConfig.getSetting(

‎src/core/qgsmaplayer.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ QgsMapLayer::QgsMapLayer( QgsMapLayer::LayerType type,
8484
mMinScale = 0;
8585
mMaxScale = 100000000;
8686
mScaleBasedVisibility = false;
87-
88-
connect( this, SIGNAL( nameChanged() ), this, SIGNAL( layerNameChanged() ) );
8987
}
9088

9189
QgsMapLayer::~QgsMapLayer()
@@ -105,11 +103,6 @@ QString QgsMapLayer::id() const
105103
return mID;
106104
}
107105

108-
void QgsMapLayer::setLayerName( const QString & name )
109-
{
110-
setName( name );
111-
}
112-
113106
void QgsMapLayer::setName( const QString& name )
114107
{
115108
QString newName = capitaliseLayerName( name );
@@ -930,17 +923,6 @@ void QgsMapLayer::invalidTransformInput()
930923
// TODO: emit a signal - it will be used to update legend
931924
}
932925

933-
934-
QString QgsMapLayer::lastErrorTitle()
935-
{
936-
return QString();
937-
}
938-
939-
QString QgsMapLayer::lastError()
940-
{
941-
return QString();
942-
}
943-
944926
#if 0
945927
void QgsMapLayer::connectNotify( const char * signal )
946928
{
@@ -954,11 +936,6 @@ bool QgsMapLayer::isInScaleRange( double scale ) const
954936
return !mScaleBasedVisibility || ( mMinScale * QGis::SCALE_PRECISION < scale && scale < mMaxScale );
955937
}
956938

957-
void QgsMapLayer::toggleScaleBasedVisibility( bool theVisibilityFlag )
958-
{
959-
setScaleBasedVisibility( theVisibilityFlag );
960-
}
961-
962939
bool QgsMapLayer::hasScaleBasedVisibility() const
963940
{
964941
return mScaleBasedVisibility;
@@ -1669,11 +1646,6 @@ void QgsMapLayer::setValid( bool valid )
16691646
mValid = valid;
16701647
}
16711648

1672-
void QgsMapLayer::setCacheImage( QImage * )
1673-
{
1674-
emit repaintRequested();
1675-
}
1676-
16771649
void QgsMapLayer::setLegend( QgsMapLayerLegend* legend )
16781650
{
16791651
if ( legend == mLegend )
@@ -1698,11 +1670,6 @@ QgsMapLayerStyleManager* QgsMapLayer::styleManager() const
16981670
return mStyleManager;
16991671
}
17001672

1701-
void QgsMapLayer::clearCacheImage()
1702-
{
1703-
emit repaintRequested();
1704-
}
1705-
17061673
void QgsMapLayer::triggerRepaint()
17071674
{
17081675
emit repaintRequested();

‎src/core/qgsmaplayer.h

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
7979
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry */
8080
QString id() const;
8181

82-
/** Set the display name of the layer
83-
* @param name New name for the layer
84-
* @deprecated Since 2.16, use setName instead
85-
*/
86-
Q_DECL_DEPRECATED void setLayerName( const QString & name );
87-
8882
/**
8983
* Set the display name of the layer
9084
* @param name New name for the layer
@@ -362,13 +356,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
362356
/** Remove a custom property from layer. Properties are stored in a map and saved in project file. */
363357
void removeCustomProperty( const QString& key );
364358

365-
366-
//! @deprecated since 2.4 - returns empty string
367-
Q_DECL_DEPRECATED virtual QString lastErrorTitle();
368-
369-
//! @deprecated since 2.4 - returns empty string
370-
Q_DECL_DEPRECATED virtual QString lastError();
371-
372359
/** Get current status error. This error describes some principal problem
373360
* for which layer cannot work and thus is not valid. It is not last error
374361
* after accessing data by draw() etc.
@@ -529,13 +516,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
529516
void setLegendUrlFormat( const QString& legendUrlFormat ) { mLegendUrlFormat = legendUrlFormat; }
530517
QString legendUrlFormat() const { return mLegendUrlFormat; }
531518

532-
/** @deprecated since 2.4 - returns nullptr */
533-
Q_DECL_DEPRECATED QImage *cacheImage() { return nullptr; }
534-
/** @deprecated since 2.4 - caches listen to repaintRequested() signal to invalidate the cached image */
535-
Q_DECL_DEPRECATED void setCacheImage( QImage * );
536-
/** @deprecated since 2.4 - does nothing */
537-
Q_DECL_DEPRECATED virtual void onCacheImageDelete() {}
538-
539519
/**
540520
* Assign a legend controller to the map layer. The object will be responsible for providing legend items.
541521
* @param legend Takes ownership of the object. Can be null pointer
@@ -624,16 +604,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
624604
*/
625605
void setScaleBasedVisibility( const bool enabled );
626606

627-
/** Accessor for the scale based visilibility flag
628-
* @deprecated use setScaleBasedVisibility instead
629-
*/
630-
Q_DECL_DEPRECATED void toggleScaleBasedVisibility( bool theVisibilityFlag );
631-
632-
/** Clear cached image
633-
* @deprecated in 2.4 - use triggerRepaint() - caches automatically listen to repaintRequested() signal to invalidate the cached image
634-
*/
635-
Q_DECL_DEPRECATED void clearCacheImage();
636-
637607
/**
638608
* Will advice the map canvas (and any other interested party) that this layer requires to be repainted.
639609
* Will emit a repaintRequested() signal.
@@ -655,17 +625,9 @@ class CORE_EXPORT QgsMapLayer : public QObject
655625

656626
signals:
657627

658-
//! @deprecated in 2.4 - not emitted anymore
659-
Q_DECL_DEPRECATED void drawingProgress( int theProgress, int theTotalSteps );
660-
661628
/** Emit a signal with status (e.g. to be caught by QgisApp and display a msg on status bar) */
662629
void statusChanged( const QString& theStatus );
663630

664-
/** Emit a signal that the layer name has been changed
665-
* @deprecated since 2.16 use nameChanged() instead
666-
*/
667-
Q_DECL_DEPRECATED void layerNameChanged();
668-
669631
/**
670632
* Emitted when the name has been changed
671633
*
@@ -681,9 +643,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
681643
*/
682644
void repaintRequested();
683645

684-
//! \note Deprecated in 2.4 and not emitted anymore
685-
void screenUpdateRequested();
686-
687646
/** This is used to send a request that any mapcanvas using this layer update its extents */
688647
void recalculateExtents();
689648

0 commit comments

Comments
 (0)