Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow plugin layers to set their source
  • Loading branch information
wonder-sk committed Feb 29, 2016
1 parent 317639f commit 5090491
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/core/qgspluginlayer.sip
Expand Up @@ -11,8 +11,14 @@ class QgsPluginLayer : QgsMapLayer
/** Return plugin layer type (the same as used in QgsPluginLayerRegistry) */
QString pluginLayerType();

/** Set extent of the layer */
void setExtent( const QgsRectangle &extent );

/** Set source string. This is used for example in layer tree to show tooltip.
* @note added in 2.16
*/
void setSource( const QString& source );

//! return a list of symbology items for the legend
//! (defult implementation returns nothing)
//! @note Added in v2.1
Expand Down
5 changes: 5 additions & 0 deletions src/core/qgspluginlayer.cpp
Expand Up @@ -33,6 +33,11 @@ void QgsPluginLayer::setExtent( const QgsRectangle &extent )
mExtent = extent;
}

void QgsPluginLayer::setSource( const QString& source )
{
mDataSource = source;
}

QgsLegendSymbologyList QgsPluginLayer::legendSymbologyItems( QSize iconSize )
{
Q_UNUSED( iconSize );
Expand Down
6 changes: 6 additions & 0 deletions src/core/qgspluginlayer.h
Expand Up @@ -37,8 +37,14 @@ class CORE_EXPORT QgsPluginLayer : public QgsMapLayer
/** Return plugin layer type (the same as used in QgsPluginLayerRegistry) */
QString pluginLayerType();

/** Set extent of the layer */
void setExtent( const QgsRectangle &extent ) override;

/** Set source string. This is used for example in layer tree to show tooltip.
* @note added in 2.16
*/
void setSource( const QString& source );

//! return a list of symbology items for the legend
//! (defult implementation returns nothing)
//! @note Added in v2.1
Expand Down

0 comments on commit 5090491

Please sign in to comment.