Skip to content

Commit c1fe68c

Browse files
committed
Fix big parameter passed by value warnings
1 parent bca1560 commit c1fe68c

21 files changed

+26
-26
lines changed

python/gui/attributetable/qgsdualview.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class QgsDualView : QStackedWidget
4141
* @param request Use a modified request to limit the shown features
4242
* @param context The context in which this view is shown
4343
*/
44-
void init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const QgsFeatureRequest& request = QgsFeatureRequest(), QgsAttributeEditorContext context = QgsAttributeEditorContext() );
44+
void init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const QgsFeatureRequest& request = QgsFeatureRequest(), const QgsAttributeEditorContext& context = QgsAttributeEditorContext() );
4545

4646
/**
4747
* Change the current view mode.

python/gui/editorwidgets/core/qgseditorwidgetregistry.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class QgsEditorWidgetRegistry : QObject
5151
const QgsEditorWidgetConfig& config,
5252
QWidget* editor,
5353
QWidget* parent /TransferThis/,
54-
const QgsAttributeEditorContext context = QgsAttributeEditorContext() ) /Factory/;
54+
const QgsAttributeEditorContext& context = QgsAttributeEditorContext() ) /Factory/;
5555

5656
/**
5757
* Creates a configuration widget

python/gui/editorwidgets/qgsrelationreferencewidget.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class QgsRelationReferenceWidget : QWidget
2727
//! returns the related feature foreign key
2828
QVariant foreignKey();
2929

30-
void setEditorContext( QgsAttributeEditorContext context, QgsMapCanvas* canvas, QgsMessageBar* messageBar );
30+
void setEditorContext( const QgsAttributeEditorContext& context, QgsMapCanvas* canvas, QgsMessageBar* messageBar );
3131

3232
//! determines if the form of the related feature will be shown
3333
bool embedForm();

python/gui/qgsattributedialog.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class QgsAttributeDialog : QDialog
1717
*
1818
* @deprecated
1919
*/
20-
QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QgsDistanceArea myDa, QWidget* parent = 0, bool showDialogButtons = true ) /Deprecated/;
20+
QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, const QgsDistanceArea& myDa, QWidget* parent = 0, bool showDialogButtons = true ) /Deprecated/;
2121

2222
/**
2323
* Create an attribute dialog for a given layer and feature
@@ -30,7 +30,7 @@ class QgsAttributeDialog : QDialog
3030
* @param context The context in which this dialog is created
3131
*
3232
*/
33-
QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QWidget* parent = 0, bool showDialogButtons = true, QgsAttributeEditorContext context = QgsAttributeEditorContext() );
33+
QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QWidget* parent = 0, bool showDialogButtons = true, const QgsAttributeEditorContext& context = QgsAttributeEditorContext() );
3434

3535
/** Saves the size and position for the next time
3636
* this dialog box will be used.

python/gui/qgsattributeform.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class QgsAttributeForm : QWidget
2020
%End
2121

2222
public:
23-
explicit QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature feature = QgsFeature(), QgsAttributeEditorContext context = QgsAttributeEditorContext(), QWidget *parent = 0 );
23+
explicit QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature& feature = QgsFeature(), const QgsAttributeEditorContext& context = QgsAttributeEditorContext(), QWidget *parent = 0 );
2424
~QgsAttributeForm();
2525

2626
const QgsFeature& feature();

src/gui/attributetable/qgsdualview.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ QgsDualView::QgsDualView( QWidget* parent )
6060
connect( mFeatureList, SIGNAL( displayExpressionChanged( QString ) ), this, SLOT( previewExpressionChanged( QString ) ) );
6161
}
6262

63-
void QgsDualView::init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const QgsFeatureRequest &request, QgsAttributeEditorContext context )
63+
void QgsDualView::init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const QgsFeatureRequest &request, const QgsAttributeEditorContext &context )
6464
{
6565
mEditorContext = context;
6666

src/gui/attributetable/qgsdualview.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBas
7878
* @param request Use a modified request to limit the shown features
7979
* @param context The context in which this view is shown
8080
*/
81-
void init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const QgsFeatureRequest& request = QgsFeatureRequest(), QgsAttributeEditorContext context = QgsAttributeEditorContext() );
81+
void init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const QgsFeatureRequest& request = QgsFeatureRequest(), const QgsAttributeEditorContext& context = QgsAttributeEditorContext() );
8282

8383
/**
8484
* Change the current view mode.

src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ QgsEditorWidgetRegistry::~QgsEditorWidgetRegistry()
8181
qDeleteAll( mWidgetFactories.values() );
8282
}
8383

84-
QgsEditorWidgetWrapper* QgsEditorWidgetRegistry::create( const QString& widgetId, QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, QWidget* editor, QWidget* parent, const QgsAttributeEditorContext context )
84+
QgsEditorWidgetWrapper* QgsEditorWidgetRegistry::create( const QString& widgetId, QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, QWidget* editor, QWidget* parent, const QgsAttributeEditorContext &context )
8585
{
8686
if ( mWidgetFactories.contains( widgetId ) )
8787
{

src/gui/editorwidgets/core/qgseditorwidgetregistry.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class GUI_EXPORT QgsEditorWidgetRegistry : public QObject
8181
const QgsEditorWidgetConfig& config,
8282
QWidget* editor,
8383
QWidget* parent,
84-
const QgsAttributeEditorContext context = QgsAttributeEditorContext() );
84+
const QgsAttributeEditorContext& context = QgsAttributeEditorContext() );
8585

8686
/**
8787
* Creates a configuration widget

src/gui/editorwidgets/core/qgswidgetwrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void QgsWidgetWrapper::setConfig( const QgsEditorWidgetConfig& config )
4747
mConfig = config;
4848
}
4949

50-
void QgsWidgetWrapper::setContext( const QgsAttributeEditorContext context )
50+
void QgsWidgetWrapper::setContext( const QgsAttributeEditorContext &context )
5151
{
5252
mContext = context;
5353
}

src/gui/editorwidgets/core/qgswidgetwrapper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class GUI_EXPORT QgsWidgetWrapper : public QObject
7777
*
7878
* @param context context information
7979
*/
80-
void setContext( const QgsAttributeEditorContext context );
80+
void setContext( const QgsAttributeEditorContext& context );
8181

8282
/**
8383
* Use this inside your overriden classes to access the configuration.

src/gui/editorwidgets/qgsrelationreferencewidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ QVariant QgsRelationReferenceWidget::foreignKey()
346346
}
347347
}
348348

349-
void QgsRelationReferenceWidget::setEditorContext( QgsAttributeEditorContext context, QgsMapCanvas* canvas, QgsMessageBar* messageBar )
349+
void QgsRelationReferenceWidget::setEditorContext( const QgsAttributeEditorContext &context, QgsMapCanvas* canvas, QgsMessageBar* messageBar )
350350
{
351351
mEditorContext = context;
352352
mCanvas = canvas;

src/gui/editorwidgets/qgsrelationreferencewidget.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class GUI_EXPORT QgsRelationReferenceWidget : public QWidget
6060
//! returns the related feature foreign key
6161
QVariant foreignKey();
6262

63-
void setEditorContext( QgsAttributeEditorContext context, QgsMapCanvas* canvas, QgsMessageBar* messageBar );
63+
void setEditorContext( const QgsAttributeEditorContext& context, QgsMapCanvas* canvas, QgsMessageBar* messageBar );
6464

6565
//! determines if the form of the related feature will be shown
6666
bool embedForm() {return mEmbedForm;}

src/gui/qgsattributedialog.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <QSettings>
2626

2727

28-
QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeature, bool featureOwner, QgsDistanceArea myDa, QWidget* parent, bool showDialogButtons )
28+
QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeature, bool featureOwner, const QgsDistanceArea &myDa, QWidget* parent, bool showDialogButtons )
2929
: QDialog( parent )
3030
, mHighlight( 0 )
3131
, mOwnedFeature( featureOwner ? thepFeature : 0 )
@@ -39,7 +39,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeat
3939
mAttributeForm->hideButtonBox();
4040
}
4141

42-
QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeature, bool featureOwner, QWidget* parent, bool showDialogButtons, QgsAttributeEditorContext context )
42+
QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeature, bool featureOwner, QWidget* parent, bool showDialogButtons, const QgsAttributeEditorContext &context )
4343
: QDialog( parent )
4444
, mHighlight( 0 )
4545
, mOwnedFeature( featureOwner ? thepFeature : 0 )
@@ -97,7 +97,7 @@ void QgsAttributeDialog::show( bool autoDelete )
9797
activateWindow();
9898
}
9999

100-
void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, QgsAttributeEditorContext& context, QWidget* parent )
100+
void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext &context, QWidget* parent )
101101
{
102102
setWindowTitle( tr( "%1 - Feature Attributes" ).arg( layer->name() ) );
103103
setLayout( new QGridLayout() );

src/gui/qgsattributedialog.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
4949
*
5050
* @deprecated
5151
*/
52-
QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QgsDistanceArea myDa, QWidget* parent = 0, bool showDialogButtons = true );
52+
QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, const QgsDistanceArea& myDa, QWidget* parent = 0, bool showDialogButtons = true );
5353

5454
/**
5555
* Create an attribute dialog for a given layer and feature
@@ -62,7 +62,7 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
6262
* @param context The context in which this dialog is created
6363
*
6464
*/
65-
QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QWidget* parent = 0, bool showDialogButtons = true, QgsAttributeEditorContext context = QgsAttributeEditorContext() );
65+
QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QWidget* parent = 0, bool showDialogButtons = true, const QgsAttributeEditorContext& context = QgsAttributeEditorContext() );
6666

6767
~QgsAttributeDialog();
6868

@@ -126,7 +126,7 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
126126
void show( bool autoDelete = true );
127127

128128
private:
129-
void init( QgsVectorLayer* layer, QgsFeature* feature, QgsAttributeEditorContext& context, QWidget* parent );
129+
void init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext& context, QWidget* parent );
130130

131131
QString mSettingsPath;
132132
// Used to sync multiple widgets for the same field

src/gui/qgsattributeform.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
int QgsAttributeForm::sFormCounter = 0;
3939

40-
QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &feature, QgsAttributeEditorContext context, QWidget* parent )
40+
QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &feature, const QgsAttributeEditorContext &context, QWidget* parent )
4141
: QWidget( parent )
4242
, mLayer( vl )
4343
, mContext( context )

src/gui/qgsattributeform.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
3131
Q_OBJECT
3232

3333
public:
34-
explicit QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &feature = QgsFeature(), QgsAttributeEditorContext context = QgsAttributeEditorContext(), QWidget *parent = 0 );
34+
explicit QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &feature = QgsFeature(), const QgsAttributeEditorContext& context = QgsAttributeEditorContext(), QWidget *parent = 0 );
3535
~QgsAttributeForm();
3636

3737
const QgsFeature& feature() { return mFeature; }

src/providers/wcs/qgswcsdataitems.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void QgsWCSConnectionItem::deleteConnection()
119119

120120
// ---------------------------------------------------------------------------
121121

122-
QgsWCSLayerItem::QgsWCSLayerItem( QgsDataItem* parent, QString name, QString path, QgsWcsCapabilitiesProperty capabilitiesProperty, QgsDataSourceURI dataSourceUri, QgsWcsCoverageSummary coverageSummary )
122+
QgsWCSLayerItem::QgsWCSLayerItem( QgsDataItem* parent, QString name, QString path, QgsWcsCapabilitiesProperty capabilitiesProperty, QgsDataSourceURI dataSourceUri, const QgsWcsCoverageSummary& coverageSummary )
123123
: QgsLayerItem( parent, name, path, QString(), QgsLayerItem::Raster, "wcs" ),
124124
mCapabilities( capabilitiesProperty ),
125125
mDataSourceUri( dataSourceUri ),

src/providers/wcs/qgswcsdataitems.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class QgsWCSLayerItem : public QgsLayerItem
4949
Q_OBJECT
5050
public:
5151
QgsWCSLayerItem( QgsDataItem* parent, QString name, QString path,
52-
QgsWcsCapabilitiesProperty capabilitiesProperty, QgsDataSourceURI dataSourceUri, QgsWcsCoverageSummary coverageSummary );
52+
QgsWcsCapabilitiesProperty capabilitiesProperty, QgsDataSourceURI dataSourceUri, const QgsWcsCoverageSummary& coverageSummary );
5353
~QgsWCSLayerItem();
5454

5555
QString createUri();

src/providers/wcs/qgswcsprovider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ int QgsWcsProvider::capabilities() const
11981198
return capability;
11991199
}
12001200

1201-
QString QgsWcsProvider::coverageMetadata( QgsWcsCoverageSummary coverage )
1201+
QString QgsWcsProvider::coverageMetadata( const QgsWcsCoverageSummary &coverage )
12021202
{
12031203
QString metadata;
12041204

src/providers/wcs/qgswcsprovider.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class QgsWcsProvider : public QgsRasterDataProvider, QgsGdalProviderBase
232232
*/
233233
QString prepareUri( QString uri ) const;
234234

235-
QString coverageMetadata( QgsWcsCoverageSummary c );
235+
QString coverageMetadata( const QgsWcsCoverageSummary& c );
236236

237237
//! remove query item and replace it with a new value
238238
void setQueryItem( QUrl &url, QString key, QString value );

0 commit comments

Comments
 (0)