Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 21, 2018
1 parent 7604d9b commit 314eca9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -1931,7 +1931,7 @@ int QgsCoordinateReferenceSystem::syncDatabase()

QString srsProj4;
QString srsDesc;
bool srsDeprecated;
bool srsDeprecated = deprecated;
if ( statement.step() == SQLITE_ROW )
{
srsProj4 = statement.columnAsText( 0 );
Expand Down Expand Up @@ -2133,6 +2133,7 @@ int QgsCoordinateReferenceSystem::syncDatabase()
return -1;
}

Q_UNUSED( deleted );
QgsDebugMsgLevel( QStringLiteral( "CRS update (inserted:%1 updated:%2 deleted:%3 errors:%4)" ).arg( QString::number( inserted ), QString::number( updated ), QString::number( deleted ), QString::number( errors ) ), 4 );

if ( errors > 0 )
Expand Down
32 changes: 16 additions & 16 deletions src/core/qgssettings.h
Expand Up @@ -251,25 +251,25 @@ class CORE_EXPORT QgsSettings : public QObject
QByteArray ba = value( key, metaEnum.valueToKey( defaultValue ) ).toString().toUtf8();
const char *vs = ba.data();
v = static_cast<T>( metaEnum.keyToValue( vs, &ok ) );
if ( ok )
return v;
}
if ( !ok )

// if failed, try to read as int (old behavior)
// this code shall be removed later (probably after QGIS 3.4 LTR for 3.6)
// then the method could be marked as const
v = static_cast<T>( value( key, static_cast<int>( defaultValue ), section ).toInt( &ok ) );
if ( metaEnum.isValid() )
{
// if failed, try to read as int (old behavior)
// this code shall be removed later (probably after QGIS 3.4 LTR for 3.6)
// then the method could be marked as const
v = static_cast<T>( value( key, static_cast<int>( defaultValue ), section ).toInt( &ok ) );
if ( metaEnum.isValid() )
if ( !ok || !metaEnum.valueToKey( static_cast<int>( v ) ) )
{
if ( !ok || !metaEnum.valueToKey( static_cast<int>( v ) ) )
{
v = defaultValue;
}
else
{
// found setting as an integer
// convert the setting to the new form (string)
setEnumValue( key, v, section );
}
v = defaultValue;
}
else
{
// found setting as an integer
// convert the setting to the new form (string)
setEnumValue( key, v, section );
}
}

Expand Down

0 comments on commit 314eca9

Please sign in to comment.