Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 27, 2014
1 parent 0bdca1f commit 7b0af0d
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/providers/mssql/qgsmssqlfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ QgsMssqlFeatureIterator::QgsMssqlFeatureIterator( QgsMssqlFeatureSource* source,
mQuery = NULL;

mParser.IsGeography = mSource->mIsGeography;

BuildStatement( request );

// connect to the database
mDatabase = GetDatabase(mSource->mDriver, mSource->mHost, mSource->mDatabaseName, mSource->mUserName, mSource->mPassword);
mDatabase = GetDatabase( mSource->mDriver, mSource->mHost, mSource->mDatabaseName, mSource->mUserName, mSource->mPassword );

if ( !mDatabase.open() )
{
QgsDebugMsg( "Failed to open database" );
Expand All @@ -46,7 +46,7 @@ QgsMssqlFeatureIterator::QgsMssqlFeatureIterator( QgsMssqlFeatureSource* source,

// create sql query
mQuery = new QSqlQuery( mDatabase );

// start selection
rewind();
}
Expand Down Expand Up @@ -248,19 +248,19 @@ bool QgsMssqlFeatureIterator::close()

if ( mQuery )
{
if ( !mQuery->isActive() )
{
QgsDebugMsg( "QgsMssqlFeatureIterator::close on inactive query" );
return false;
}
if ( !mQuery->isActive() )
{
QgsDebugMsg( "QgsMssqlFeatureIterator::close on inactive query" );
return false;
}

mQuery->finish();
mQuery->finish();
}

if ( mQuery )
delete mQuery;
delete mQuery;

if (mDatabase.isOpen())
if ( mDatabase.isOpen() )
mDatabase.close();

iteratorClosed();
Expand All @@ -269,15 +269,15 @@ bool QgsMssqlFeatureIterator::close()
return true;
}

QSqlDatabase QgsMssqlFeatureIterator::GetDatabase(QString driver, QString host, QString database, QString username, QString password)
QSqlDatabase QgsMssqlFeatureIterator::GetDatabase( QString driver, QString host, QString database, QString username, QString password )
{
QSqlDatabase db;
QString connectionName;

// create a separate database connection for each feature source
QgsDebugMsg( "Creating a separate database connection" );
QString id;

// QString::sprintf adds 0x prefix
id.sprintf( "%p", this );

Expand Down Expand Up @@ -348,12 +348,12 @@ QgsMssqlFeatureSource::QgsMssqlFeatureSource( const QgsMssqlProvider* p )
, mFidColName( p->mFidColName )
, mGeometryColName( p->mGeometryColName )
, mGeometryColType( p->mGeometryColType )
, mSchemaName( p->mSchemaName )
, mTableName( p->mTableName )
, mUserName( p->mUserName )
, mService( p->mService )
, mDatabaseName( p->mDatabaseName )
, mHost( p->mHost )
, mSchemaName( p->mSchemaName )
, mTableName( p->mTableName )
, mSqlWhereClause( p->mSqlWhereClause )
{
mSRId = p->mSRId;
Expand Down

0 comments on commit 7b0af0d

Please sign in to comment.