Skip to content

Commit

Permalink
Added const to config() method
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Nov 20, 2015
1 parent 7cc0a21 commit 8c24e1e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions python/gui/editorwidgets/core/qgseditorwidgetwrapper.sip
Expand Up @@ -16,7 +16,6 @@
class QgsEditorWidgetWrapper : QObject
{
%TypeHeaderCode
#include <qgseditorwidgetconfig.h>
#include <qgseditorwidgetwrapper.h>
%End

Expand All @@ -42,7 +41,7 @@ class QgsEditorWidgetWrapper : QObject
*
* @return the value assigned to this configuration option
*/
QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );
const QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );

This comment has been minimized.

Copy link
@m-kuhn

m-kuhn Nov 20, 2015

Member

The method should be const, not the return value.

This comment has been minimized.

Copy link
@elpaso

elpaso Nov 20, 2015

Author Contributor

you meant
QVariant config( const QString& key, const QVariant& defaultVal = QVariant() ) const;
?

This comment has been minimized.

Copy link
@m-kuhn

m-kuhn Nov 20, 2015

Member

Yeah, fixed as part of 182dd8a


/**
* Returns the whole config
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/core/qgswidgetwrapper.cpp
Expand Up @@ -52,7 +52,7 @@ void QgsWidgetWrapper::setContext( const QgsAttributeEditorContext &context )
mContext = context;
}

QVariant QgsWidgetWrapper::config( const QString& key, const QVariant& defaultVal )
const QVariant QgsWidgetWrapper::config( const QString& key, const QVariant& defaultVal )
{
if ( mConfig.contains( key ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/core/qgswidgetwrapper.h
Expand Up @@ -87,7 +87,7 @@ class GUI_EXPORT QgsWidgetWrapper : public QObject
*
* @return the value assigned to this configuration option
*/
QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );
const QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );

/**
* Returns the whole config
Expand Down

0 comments on commit 8c24e1e

Please sign in to comment.