Skip to content

Commit d998465

Browse files
dwadlernyalldawson
authored andcommittedNov 20, 2018
run prepare-commit on DB2 fixes for #20337
1 parent c339dd4 commit d998465

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed
 

‎src/providers/db2/qgsdb2featureiterator.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Copyright : (C) 2016 by David Adler
66
Shirley Xiao, David Nguyen
77
Email : dadler at adtechgeospatial.com
8-
xshirley2012 at yahoo.com, davidng0123 at gmail.com
8+
xshirley2012 at yahoo.com, davidng0123 at gmail.com
99
Adapted from MSSQL provider by Tamas Szekeres
1010
****************************************************************************
1111
*
@@ -302,23 +302,23 @@ bool QgsDb2FeatureIterator::fetchFeature( QgsFeature &feature )
302302
if ( !mDatabase.isValid() )
303303
{
304304
// No existing connection, so set it up now. It's safe to do here as we're now in
305-
// the thread were iteration is actually occurring.
306-
// connect to the database
307-
QString errMsg;
308-
QgsDebugMsg( QStringLiteral( "fetchFeature getDatabase" ) );
309-
mDatabase = QgsDb2Provider::getDatabase( mSource->mConnInfo, errMsg );
310-
QgsDebugMsg( QStringLiteral( "fetchFeature back from getDatabase" ) );
311-
if ( !errMsg.isEmpty() )
312-
{
313-
QgsDebugMsg( "Failed to open database: " + errMsg );
314-
return false;
315-
}
305+
// the thread were iteration is actually occurring.
306+
// connect to the database
307+
QString errMsg;
308+
QgsDebugMsg( QStringLiteral( "fetchFeature getDatabase" ) );
309+
mDatabase = QgsDb2Provider::getDatabase( mSource->mConnInfo, errMsg );
310+
QgsDebugMsg( QStringLiteral( "fetchFeature back from getDatabase" ) );
311+
if ( !errMsg.isEmpty() )
312+
{
313+
QgsDebugMsg( "Failed to open database: " + errMsg );
314+
return false;
315+
}
316316

317-
// create sql query
318-
mQuery.reset( new QSqlQuery( mDatabase ) );
317+
// create sql query
318+
mQuery.reset( new QSqlQuery( mDatabase ) );
319319

320-
// start selection
321-
if ( !rewind() )
320+
// start selection
321+
if ( !rewind() )
322322
return false;
323323
}
324324

‎src/providers/db2/qgsdb2provider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Copyright : (C) 2016 by David Adler
66
Shirley Xiao, David Nguyen
77
Email : dadler at adtechgeospatial.com
8-
xshirley2012 at yahoo.com, davidng0123 at gmail.com
8+
xshirley2012 at yahoo.com, davidng0123 at gmail.com
99
Adapted from MSSQL provider by Tamas Szekeres
1010
****************************************************************************
1111
*
@@ -192,7 +192,7 @@ QSqlDatabase QgsDb2Provider::getDatabase( const QString &connInfo, QString &errM
192192
// using the thread address as connection name.
193193
const QString threadSafeConnectionName = dbConnectionName( connectionName );
194194
QgsDebugMsg( "threadSafeConnectionName: " + threadSafeConnectionName );
195-
195+
196196
/* if new database connection */
197197
if ( !QSqlDatabase::contains( threadSafeConnectionName ) )
198198
{

‎src/providers/db2/qgsdb2provider.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Copyright : (C) 2016 by David Adler
66
Shirley Xiao, David Nguyen
77
Email : dadler at adtechgeospatial.com
8-
xshirley2012 at yahoo.com, davidng0123 at gmail.com
8+
xshirley2012 at yahoo.com, davidng0123 at gmail.com
99
****************************************************************************
1010
*
1111
* This program is free software; you can redistribute it and/or modify
@@ -118,9 +118,10 @@ class QgsDb2Provider : public QgsVectorDataProvider
118118
private:
119119
static void db2WkbTypeAndDimension( QgsWkbTypes::Type wkbType, QString &geometryType, int &dim );
120120
static QString db2TypeName( int typeId );
121-
/**
122-
* Returns a thread-safe connection name for use with QSqlDatabase
123-
*/
121+
122+
/**
123+
* Returns a thread-safe connection name for use with QSqlDatabase
124+
*/
124125
static QString dbConnectionName( const QString &name );
125126

126127
QgsFields mAttributeFields; //fields

0 commit comments

Comments
 (0)
Please sign in to comment.