Navigation Menu

Skip to content

Commit

Permalink
Remove deprecated members from QgsMapLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 14, 2016
1 parent 7d2027f commit 6c6f3c1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 115 deletions.
4 changes: 4 additions & 0 deletions doc/api_break.dox
Expand Up @@ -52,6 +52,10 @@ only affects third party c++ providers, and does not affect PyQGIS scripts.</li>

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

\subsection qgis_api_break_3_0_QgsJSONExporter QgsJSONExporter
Expand Down
40 changes: 0 additions & 40 deletions python/core/qgsmaplayer.sip
Expand Up @@ -61,11 +61,6 @@ class QgsMapLayer : QObject
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry */
QString id() const;

/** Set the display name of the layer
* @param name New name for the layer
*/
void setLayerName( const QString & name ) /Deprecated/;

/**
* Set the display name of the layer
* @param name New name for the layer
Expand Down Expand Up @@ -343,13 +338,6 @@ class QgsMapLayer : QObject
/** Remove a custom property from layer. Properties are stored in a map and saved in project file. */
void removeCustomProperty( const QString& key );


//! @deprecated since 2.4 - returns empty string
virtual QString lastErrorTitle() /Deprecated/;

//! @deprecated since 2.4 - returns empty string
virtual QString lastError() /Deprecated/;

/** Get current status error. This error describes some principal problem
* for which layer cannot work and thus is not valid. It is not last error
* after accessing data by draw() etc.
Expand Down Expand Up @@ -507,13 +495,6 @@ class QgsMapLayer : QObject
void setLegendUrlFormat( const QString& legendUrlFormat );
QString legendUrlFormat() const;

/** @deprecated since 2.4 - returns nullptr */
QImage *cacheImage() /Deprecated/;
/** @deprecated since 2.4 - caches listen to repaintRequested() signal to invalidate the cached image */
void setCacheImage( QImage * thepImage /Transfer/ ) /Deprecated/;
/** @deprecated since 2.4 - does nothing */
virtual void onCacheImageDelete() /Deprecated/;

/**
* Assign a legend controller to the map layer. The object will be responsible for providing legend items.
* @param legend Takes ownership of the object. Can be null pointer
Expand Down Expand Up @@ -602,16 +583,6 @@ class QgsMapLayer : QObject
*/
void setScaleBasedVisibility( const bool enabled );

/** Accessor for the scale based visilibility flag
* @deprecated use setScaleBasedVisibility instead
*/
void toggleScaleBasedVisibility( bool theVisibilityFlag ) /Deprecated/;

/** Clear cached image
* @deprecated in 2.4 - use triggerRepaint() - caches automatically listen to repaintRequested() signal to invalidate the cached image
*/
void clearCacheImage() /Deprecated/;

/**
* Will advice the map canvas (and any other interested party) that this layer requires to be repainted.
* Will emit a repaintRequested() signal.
Expand All @@ -633,17 +604,9 @@ class QgsMapLayer : QObject

signals:

//! @deprecated in 2.4 - not emitted anymore
void drawingProgress( int theProgress, int theTotalSteps );

/** Emit a signal with status (e.g. to be caught by QgisApp and display a msg on status bar) */
void statusChanged( const QString& theStatus );

/** Emit a signal that the layer name has been changed
* @deprecated since 2.16 use nameChanged() instead
*/
void layerNameChanged();

/**
* Emitted when the name has been changed
*
Expand All @@ -659,9 +622,6 @@ class QgsMapLayer : QObject
*/
void repaintRequested();

//! \note Deprecated in 2.4 and not emitted anymore
void screenUpdateRequested();

/** This is used to send a request that any mapcanvas using this layer update its extents */
void recalculateExtents();

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/Postprocessing.py
Expand Up @@ -62,7 +62,7 @@ def handleAlgorithmResults(alg, progress=None, showResults=True):
if isinstance(out, (OutputRaster, OutputVector, OutputTable)):
try:
if hasattr(out, "layer") and out.layer is not None:
out.layer.setLayerName(out.description)
out.layer.setName(out.description)
QgsMapLayerRegistry.instance().addMapLayers([out.layer])
else:
if ProcessingConfig.getSetting(
Expand Down
33 changes: 0 additions & 33 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -84,8 +84,6 @@ QgsMapLayer::QgsMapLayer( QgsMapLayer::LayerType type,
mMinScale = 0;
mMaxScale = 100000000;
mScaleBasedVisibility = false;

connect( this, SIGNAL( nameChanged() ), this, SIGNAL( layerNameChanged() ) );
}

QgsMapLayer::~QgsMapLayer()
Expand All @@ -105,11 +103,6 @@ QString QgsMapLayer::id() const
return mID;
}

void QgsMapLayer::setLayerName( const QString & name )
{
setName( name );
}

void QgsMapLayer::setName( const QString& name )
{
QString newName = capitaliseLayerName( name );
Expand Down Expand Up @@ -930,17 +923,6 @@ void QgsMapLayer::invalidTransformInput()
// TODO: emit a signal - it will be used to update legend
}


QString QgsMapLayer::lastErrorTitle()
{
return QString();
}

QString QgsMapLayer::lastError()
{
return QString();
}

#if 0
void QgsMapLayer::connectNotify( const char * signal )
{
Expand All @@ -954,11 +936,6 @@ bool QgsMapLayer::isInScaleRange( double scale ) const
return !mScaleBasedVisibility || ( mMinScale * QGis::SCALE_PRECISION < scale && scale < mMaxScale );
}

void QgsMapLayer::toggleScaleBasedVisibility( bool theVisibilityFlag )
{
setScaleBasedVisibility( theVisibilityFlag );
}

bool QgsMapLayer::hasScaleBasedVisibility() const
{
return mScaleBasedVisibility;
Expand Down Expand Up @@ -1669,11 +1646,6 @@ void QgsMapLayer::setValid( bool valid )
mValid = valid;
}

void QgsMapLayer::setCacheImage( QImage * )
{
emit repaintRequested();
}

void QgsMapLayer::setLegend( QgsMapLayerLegend* legend )
{
if ( legend == mLegend )
Expand All @@ -1698,11 +1670,6 @@ QgsMapLayerStyleManager* QgsMapLayer::styleManager() const
return mStyleManager;
}

void QgsMapLayer::clearCacheImage()
{
emit repaintRequested();
}

void QgsMapLayer::triggerRepaint()
{
emit repaintRequested();
Expand Down
41 changes: 0 additions & 41 deletions src/core/qgsmaplayer.h
Expand Up @@ -79,12 +79,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry */
QString id() const;

/** Set the display name of the layer
* @param name New name for the layer
* @deprecated Since 2.16, use setName instead
*/
Q_DECL_DEPRECATED void setLayerName( const QString & name );

/**
* Set the display name of the layer
* @param name New name for the layer
Expand Down Expand Up @@ -362,13 +356,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
/** Remove a custom property from layer. Properties are stored in a map and saved in project file. */
void removeCustomProperty( const QString& key );


//! @deprecated since 2.4 - returns empty string
Q_DECL_DEPRECATED virtual QString lastErrorTitle();

//! @deprecated since 2.4 - returns empty string
Q_DECL_DEPRECATED virtual QString lastError();

/** Get current status error. This error describes some principal problem
* for which layer cannot work and thus is not valid. It is not last error
* after accessing data by draw() etc.
Expand Down Expand Up @@ -529,13 +516,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
void setLegendUrlFormat( const QString& legendUrlFormat ) { mLegendUrlFormat = legendUrlFormat; }
QString legendUrlFormat() const { return mLegendUrlFormat; }

/** @deprecated since 2.4 - returns nullptr */
Q_DECL_DEPRECATED QImage *cacheImage() { return nullptr; }
/** @deprecated since 2.4 - caches listen to repaintRequested() signal to invalidate the cached image */
Q_DECL_DEPRECATED void setCacheImage( QImage * );
/** @deprecated since 2.4 - does nothing */
Q_DECL_DEPRECATED virtual void onCacheImageDelete() {}

/**
* Assign a legend controller to the map layer. The object will be responsible for providing legend items.
* @param legend Takes ownership of the object. Can be null pointer
Expand Down Expand Up @@ -624,16 +604,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
*/
void setScaleBasedVisibility( const bool enabled );

/** Accessor for the scale based visilibility flag
* @deprecated use setScaleBasedVisibility instead
*/
Q_DECL_DEPRECATED void toggleScaleBasedVisibility( bool theVisibilityFlag );

/** Clear cached image
* @deprecated in 2.4 - use triggerRepaint() - caches automatically listen to repaintRequested() signal to invalidate the cached image
*/
Q_DECL_DEPRECATED void clearCacheImage();

/**
* Will advice the map canvas (and any other interested party) that this layer requires to be repainted.
* Will emit a repaintRequested() signal.
Expand All @@ -655,17 +625,9 @@ class CORE_EXPORT QgsMapLayer : public QObject

signals:

//! @deprecated in 2.4 - not emitted anymore
Q_DECL_DEPRECATED void drawingProgress( int theProgress, int theTotalSteps );

/** Emit a signal with status (e.g. to be caught by QgisApp and display a msg on status bar) */
void statusChanged( const QString& theStatus );

/** Emit a signal that the layer name has been changed
* @deprecated since 2.16 use nameChanged() instead
*/
Q_DECL_DEPRECATED void layerNameChanged();

/**
* Emitted when the name has been changed
*
Expand All @@ -681,9 +643,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
*/
void repaintRequested();

//! \note Deprecated in 2.4 and not emitted anymore
void screenUpdateRequested();

/** This is used to send a request that any mapcanvas using this layer update its extents */
void recalculateExtents();

Expand Down

0 comments on commit 6c6f3c1

Please sign in to comment.