Skip to content

Commit a2fbf5e

Browse files
committed
[oracle] Fix some clazy warnings
1 parent 3032ab7 commit a2fbf5e

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/providers/oracle/qgsoracleprovider.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag
11871187

11881188
bool returnvalue = true;
11891189

1190-
if ( !( flags & QgsFeatureSink::FastInsert ) && !getWorkspace().isEmpty() && getWorkspace().toUpper() != "LIVE" )
1190+
if ( !( flags & QgsFeatureSink::FastInsert ) && !getWorkspace().isEmpty() && getWorkspace().compare( QStringLiteral( "LIVE" ), Qt::CaseInsensitive ) != 0 )
11911191
{
11921192
static bool warn = true;
11931193
if ( warn )
@@ -1210,37 +1210,37 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag
12101210
}
12111211

12121212
// Prepare the INSERT statement
1213-
QString insert = QString( "INSERT INTO %1(" ).arg( mQuery );
1214-
QString values = ") VALUES (";
1215-
QString delim = "";
1213+
QString insert = QStringLiteral( "INSERT INTO %1(" ).arg( mQuery );
1214+
QString values = QStringLiteral( ") VALUES (" );
1215+
QString delim;
12161216

12171217
QStringList defaultValues;
12181218
QList<int> fieldId;
12191219

12201220
if ( !mGeometryColumn.isNull() )
12211221
{
12221222
insert += quotedIdentifier( mGeometryColumn );
1223-
values += "?";
1224-
delim = ",";
1223+
values += '?';
1224+
delim = ',';
12251225
}
12261226

12271227
if ( mPrimaryKeyType == PktInt || mPrimaryKeyType == PktFidMap )
12281228
{
1229-
QString keys, kdelim = "";
1229+
QString keys, kdelim;
12301230

12311231
Q_FOREACH ( int idx, mPrimaryKeyAttrs )
12321232
{
12331233
QgsField fld = field( idx );
12341234
insert += delim + quotedIdentifier( fld.name() );
12351235
keys += kdelim + quotedIdentifier( fld.name() );
1236-
values += delim + "?";
1237-
delim = ",";
1238-
kdelim = ",";
1236+
values += delim + '?';
1237+
delim = ',';
1238+
kdelim = ',';
12391239
fieldId << idx;
12401240
defaultValues << defaultValue( idx ).toString();
12411241
}
12421242

1243-
if ( !getfid.prepare( QString( "SELECT %1 FROM %2 WHERE ROWID=?" ).arg( keys ).arg( mQuery ) ) )
1243+
if ( !getfid.prepare( QStringLiteral( "SELECT %1 FROM %2 WHERE ROWID=?" ).arg( keys ).arg( mQuery ) ) )
12441244
{
12451245
throw OracleException( tr( "Could not prepare get feature id statement" ), getfid );
12461246
}
@@ -1270,16 +1270,16 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag
12701270

12711271
QString defVal = defaultValue( idx ).toString();
12721272

1273-
values += delim + "?";
1273+
values += delim + '?';
12741274
defaultValues.append( defVal );
12751275
fieldId.append( idx );
12761276

1277-
delim = ",";
1277+
delim = ',';
12781278
}
12791279

12801280
insert += values + ")";
12811281

1282-
QgsDebugMsgLevel( QString( "SQL prepare: %1" ).arg( insert ), 4 );
1282+
QgsDebugMsgLevel( QStringLiteral( "SQL prepare: %1" ).arg( insert ), 4 );
12831283
if ( !ins.prepare( insert ) )
12841284
{
12851285
throw OracleException( tr( "Could not prepare insert statement" ), ins );
@@ -1289,7 +1289,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag
12891289
{
12901290
QgsAttributes attributevec = features->attributes();
12911291

1292-
QgsDebugMsgLevel( QString( "insert feature %1" ).arg( features->id() ), 4 );
1292+
QgsDebugMsgLevel( QStringLiteral( "insert feature %1" ).arg( features->id() ), 4 );
12931293

12941294
if ( !mGeometryColumn.isNull() )
12951295
{
@@ -1318,7 +1318,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag
13181318
}
13191319
}
13201320

1321-
QgsDebugMsgLevel( QString( "addBindValue: %1" ).arg( v ), 4 );
1321+
QgsDebugMsgLevel( QStringLiteral( "addBindValue: %1" ).arg( v ), 4 );
13221322
ins.addBindValue( v );
13231323
}
13241324

@@ -1330,7 +1330,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag
13301330
if ( mPrimaryKeyType == PktRowId )
13311331
{
13321332
features->setId( mShared->lookupFid( QList<QVariant>() << QVariant( ins.lastInsertId() ) ) );
1333-
QgsDebugMsgLevel( QString( "new fid=%1" ).arg( features->id() ), 4 );
1333+
QgsDebugMsgLevel( QStringLiteral( "new fid=%1" ).arg( features->id() ), 4 );
13341334
}
13351335
else if ( mPrimaryKeyType == PktInt || mPrimaryKeyType == PktFidMap )
13361336
{
@@ -1383,7 +1383,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag
13831383

13841384
features->setId( mShared->lookupFid( primaryKeyVals ) );
13851385
}
1386-
QgsDebugMsgLevel( QString( "new fid=%1" ).arg( features->id() ), 4 );
1386+
QgsDebugMsgLevel( QStringLiteral( "new fid=%1" ).arg( features->id() ), 4 );
13871387
}
13881388
}
13891389
}
@@ -1392,7 +1392,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag
13921392
}
13931393
catch ( OracleException &e )
13941394
{
1395-
QgsDebugMsg( QString( "Oracle error: %1" ).arg( e.errorMessage() ) );
1395+
QgsDebugMsg( QStringLiteral( "Oracle error: %1" ).arg( e.errorMessage() ) );
13961396
pushError( tr( "Oracle error while adding features: %1" ).arg( e.errorMessage() ) );
13971397
if ( !db.rollback() )
13981398
{

0 commit comments

Comments
 (0)