Skip to content

Commit bdda8d0

Browse files
committedFeb 1, 2019
back to const methods
1 parent d61940c commit bdda8d0

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed
 

‎python/core/auto_generated/qgsmaplayer.sip.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ Export the properties of this layer as named style in a QDomDocument
815815
%End
816816

817817

818-
virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg );
818+
virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg ) const;
819819
%Docstring
820820
Export the properties of this layer as SLD style in a QDomDocument
821821

@@ -856,7 +856,7 @@ record in the users style table in their personal qgis.db)
856856
.. seealso:: :py:func:`saveDefaultStyle`
857857
%End
858858

859-
virtual QString saveSldStyle( const QString &uri, bool &resultFlag );
859+
virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const;
860860
%Docstring
861861
Saves the properties of this layer to an SLD format file.
862862

‎python/core/auto_generated/raster/qgsrasterlayer.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ Draws a preview of the rasterlayer into a QImage
362362
virtual QDateTime timestamp() const;
363363

364364

365-
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() );
365+
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() ) const;
366366
%Docstring
367367
Writes the symbology of the layer into the document provided in SLD 1.0.0 format
368368

‎src/core/qgsmaplayer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,15 +1385,15 @@ QString QgsMapLayer::saveNamedStyle( const QString &uri, bool &resultFlag, Style
13851385
return saveNamedProperty( uri, QgsMapLayer::Style, resultFlag, categories );
13861386
}
13871387

1388-
void QgsMapLayer::exportSldStyle( QDomDocument &doc, QString &errorMsg )
1388+
void QgsMapLayer::exportSldStyle( QDomDocument &doc, QString &errorMsg ) const
13891389
{
13901390
QDomDocument myDocument = QDomDocument();
13911391

13921392
QDomNode header = myDocument.createProcessingInstruction( QStringLiteral( "xml" ), QStringLiteral( "version=\"1.0\" encoding=\"UTF-8\"" ) );
13931393
myDocument.appendChild( header );
13941394

13951395
const QgsVectorLayer *vlayer = qobject_cast<const QgsVectorLayer *>( this );
1396-
QgsRasterLayer *rlayer = qobject_cast<QgsRasterLayer *>( this );
1396+
const QgsRasterLayer *rlayer = qobject_cast<const QgsRasterLayer *>( this );
13971397
if ( !vlayer && !rlayer )
13981398
{
13991399
errorMsg = tr( "Could not save symbology because:\n%1" )
@@ -1462,7 +1462,7 @@ void QgsMapLayer::exportSldStyle( QDomDocument &doc, QString &errorMsg )
14621462
doc = myDocument;
14631463
}
14641464

1465-
QString QgsMapLayer::saveSldStyle( const QString &uri, bool &resultFlag )
1465+
QString QgsMapLayer::saveSldStyle( const QString &uri, bool &resultFlag ) const
14661466
{
14671467
QString errorMsg;
14681468
QDomDocument myDocument;

‎src/core/qgsmaplayer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
780780
* \param errorMsg this QString will be initialized on error
781781
* during the execution of writeSymbology
782782
*/
783-
virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg );
783+
virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg ) const;
784784

785785
/**
786786
* Save the properties of this layer as the default style
@@ -818,7 +818,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
818818
* \returns a string with any status or error messages
819819
* \see loadSldStyle()
820820
*/
821-
virtual QString saveSldStyle( const QString &uri, bool &resultFlag );
821+
virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const;
822822

823823
/**
824824
* Attempts to style the layer using the formatting from an SLD type file.

‎src/core/raster/qgsrasterlayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ QDateTime QgsRasterLayer::timestamp() const
12841284
}
12851285

12861286

1287-
bool QgsRasterLayer::writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props )
1287+
bool QgsRasterLayer::writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props ) const
12881288
{
12891289
Q_UNUSED( errorMessage );
12901290

‎src/core/raster/qgsrasterlayer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
423423
* \returns true in case of success
424424
* \since QGIS 3.6
425425
*/
426-
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() );
426+
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() ) const;
427427

428428

429429
public slots:

0 commit comments

Comments
 (0)
Please sign in to comment.