Skip to content

Commit

Permalink
More const correctness and pass-by-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandro Santilli committed May 31, 2013
1 parent 3f3ce48 commit 16ba01f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspgtablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ QgsPgTableModel::~QgsPgTableModel()
{
}

void QgsPgTableModel::addTableEntry( QgsPostgresLayerProperty layerProperty )
void QgsPgTableModel::addTableEntry( const QgsPostgresLayerProperty& layerProperty )
{
QgsDebugMsg( layerProperty.toString() );

Expand Down Expand Up @@ -272,7 +272,7 @@ bool QgsPgTableModel::setData( const QModelIndex &idx, const QVariant &value, in
return true;
}

QString QgsPgTableModel::layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata )
QString QgsPgTableModel::layerURI( const QModelIndex &index, const QString& connInfo, bool useEstimatedMetadata )
{
if ( !index.isValid() )
{
Expand Down
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspgtablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class QgsPgTableModel : public QStandardItemModel
~QgsPgTableModel();

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

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

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

QString layerURI( const QModelIndex &index, QString connInfo, bool useEstimatedMetadata );
QString layerURI( const QModelIndex &index, const QString& connInfo, bool useEstimatedMetadata );

static QIcon iconForWkbType( QGis::WkbType type );

Expand Down
6 changes: 3 additions & 3 deletions src/providers/postgres/qgspostgresconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ struct QgsPostgresLayerProperty
QList<int> srids;
QString sql;

int size() { Q_ASSERT( types.size() == srids.size() ); return types.size(); }
int size() const { Q_ASSERT( types.size() == srids.size() ); return types.size(); }

QgsPostgresLayerProperty at( int i )
QgsPostgresLayerProperty at( int i ) const
{
QgsPostgresLayerProperty property;

Expand All @@ -76,7 +76,7 @@ struct QgsPostgresLayerProperty
}

#if QGISDEBUG
QString toString()
QString toString() const
{
QString typeString;
foreach ( QGis::WkbType type, types )
Expand Down

0 comments on commit 16ba01f

Please sign in to comment.