Skip to content
Permalink
Browse files

fix warnings

  • Loading branch information
jef-n committed Jun 21, 2018
1 parent 7604d9b commit 314eca9934c9ac4617dacf920c19b51e730d97e6
Showing with 18 additions and 17 deletions.
  1. +2 −1 src/core/qgscoordinatereferencesystem.cpp
  2. +16 −16 src/core/qgssettings.h
@@ -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 );
@@ -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 )
@@ -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 );
}
}

0 comments on commit 314eca9

Please sign in to comment.
You can’t perform that action at this time.