Skip to content

Commit

Permalink
Add some const
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Oct 11, 2017
1 parent ea96031 commit 562e9b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/providers/postgres/qgspostgresconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ QString QgsPostgresConn::quotedValue( const QVariant &value )
}
}

PGresult *QgsPostgresConn::PQexec( const QString &query, bool logError )
PGresult *QgsPostgresConn::PQexec( const QString &query, bool logError ) const
{
if ( PQstatus() != CONNECTION_OK )
{
Expand Down Expand Up @@ -1192,13 +1192,13 @@ void QgsPostgresConn::PQfinish()
mConn = nullptr;
}

int QgsPostgresConn::PQstatus()
int QgsPostgresConn::PQstatus() const
{
Q_ASSERT( mConn );
return ::PQstatus( mConn );
}

QString QgsPostgresConn::PQerrorMessage()
QString QgsPostgresConn::PQerrorMessage() const
{
Q_ASSERT( mConn );
return QString::fromUtf8( ::PQerrorMessage( mConn ) );
Expand Down Expand Up @@ -1856,7 +1856,7 @@ bool QgsPostgresConn::cancel()
return res == 0;
}

QString QgsPostgresConn::currentDatabase()
QString QgsPostgresConn::currentDatabase() const
{
QString database;
QString sql = "SELECT current_database()";
Expand Down
8 changes: 4 additions & 4 deletions src/providers/postgres/qgspostgresconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ class QgsPostgresConn : public QObject
//

// run a query and check for errors
PGresult *PQexec( const QString &query, bool logError = true );
PGresult *PQexec( const QString &query, bool logError = true ) const;
void PQfinish();
QString PQerrorMessage();
QString PQerrorMessage() const;
int PQsendQuery( const QString &query );
int PQstatus();
int PQstatus() const;
PGresult *PQgetResult();
PGresult *PQprepare( const QString &stmtName, const QString &query, int nParams, const Oid *paramTypes );
PGresult *PQexecPrepared( const QString &stmtName, const QStringList &params );
Expand Down Expand Up @@ -315,7 +315,7 @@ class QgsPostgresConn : public QObject
*
* \since QGIS 3.0
*/
QString currentDatabase();
QString currentDatabase() const;

static const int GEOM_TYPE_SELECT_LIMIT;

Expand Down

0 comments on commit 562e9b4

Please sign in to comment.