Skip to content
Permalink
Browse files

More const correctness and pass-by-ref

  • Loading branch information
Sandro Santilli
Sandro Santilli committed May 31, 2013
1 parent 3f3ce48 commit 16ba01f7715528d4343e41e0a05df9ea219942ec
@@ -42,7 +42,7 @@ QgsPgTableModel::~QgsPgTableModel()
{
}

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

@@ -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() )
{
@@ -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 );
@@ -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 );

@@ -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;

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

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

0 comments on commit 16ba01f

Please sign in to comment.
You can’t perform that action at this time.