Skip to content

Commit 16ba01f

Browse files
author
Sandro Santilli
committed
More const correctness and pass-by-ref
1 parent 3f3ce48 commit 16ba01f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/providers/postgres/qgspgtablemodel.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ QgsPgTableModel::~QgsPgTableModel()
4242
{
4343
}
4444

45-
void QgsPgTableModel::addTableEntry( QgsPostgresLayerProperty layerProperty )
45+
void QgsPgTableModel::addTableEntry( const QgsPostgresLayerProperty& layerProperty )
4646
{
4747
QgsDebugMsg( layerProperty.toString() );
4848

@@ -272,7 +272,7 @@ bool QgsPgTableModel::setData( const QModelIndex &idx, const QVariant &value, in
272272
return true;
273273
}
274274

275-
QString QgsPgTableModel::layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata )
275+
QString QgsPgTableModel::layerURI( const QModelIndex &index, const QString& connInfo, bool useEstimatedMetadata )
276276
{
277277
if ( !index.isValid() )
278278
{

src/providers/postgres/qgspgtablemodel.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class QgsPgTableModel : public QStandardItemModel
3434
~QgsPgTableModel();
3535

3636
/**Adds entry for one database table to the model*/
37-
void addTableEntry( QgsPostgresLayerProperty property );
37+
void addTableEntry( const QgsPostgresLayerProperty& property );
3838

3939
/**Sets an sql statement that belongs to a cell specified by a model index*/
4040
void setSql( const QModelIndex& index, const QString& sql );
@@ -58,7 +58,7 @@ class QgsPgTableModel : public QStandardItemModel
5858

5959
bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
6060

61-
QString layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata );
61+
QString layerURI( const QModelIndex &index, const QString& connInfo, bool useEstimatedMetadata );
6262

6363
static QIcon iconForWkbType( QGis::WkbType type );
6464

src/providers/postgres/qgspostgresconn.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ struct QgsPostgresLayerProperty
5555
QList<int> srids;
5656
QString sql;
5757

58-
int size() { Q_ASSERT( types.size() == srids.size() ); return types.size(); }
58+
int size() const { Q_ASSERT( types.size() == srids.size() ); return types.size(); }
5959

60-
QgsPostgresLayerProperty at( int i )
60+
QgsPostgresLayerProperty at( int i ) const
6161
{
6262
QgsPostgresLayerProperty property;
6363

@@ -76,7 +76,7 @@ struct QgsPostgresLayerProperty
7676
}
7777

7878
#if QGISDEBUG
79-
QString toString()
79+
QString toString() const
8080
{
8181
QString typeString;
8282
foreach ( QGis::WkbType type, types )

0 commit comments

Comments
 (0)