Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 22, 2018
1 parent a14f5e4 commit d9736eb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/providers/ogr/qgsgeopackagedataitems.cpp
Expand Up @@ -153,7 +153,7 @@ bool QgsGeoPackageCollectionItem::equal( const QgsDataItem *other )
{
return false;
}
const QgsGeoPackageCollectionItem *o = dynamic_cast<const QgsGeoPackageCollectionItem *>( other );
const QgsGeoPackageCollectionItem *o = qobject_cast<const QgsGeoPackageCollectionItem *>( other );
return o && mPath == o->mPath && mName == o->mName;

}
Expand Down Expand Up @@ -546,7 +546,6 @@ void QgsGeoPackageVectorLayerItem::renameLayer()

// Get layer name from layer URI
QVariantMap pieces( QgsProviderRegistry::instance()->decodeUri( providerKey(), mUri ) );
QString baseUri = pieces[QStringLiteral( "path" )].toString();
QString layerName = pieces[QStringLiteral( "layerName" )].toString();

// Collect existing table names
Expand Down Expand Up @@ -589,8 +588,8 @@ bool QgsGeoPackageCollectionItem::vacuumGeoPackageDb( const QString &path, const
if ( status != SQLITE_OK || errmsg )
{
errCause = tr( "There was an error compacting (VACUUM) the database <b>%1</b>: %2" )
.arg( name )
.arg( QString::fromUtf8( errmsg ) );
.arg( name,
QString::fromUtf8( errmsg ) );
}
else
{
Expand Down Expand Up @@ -725,7 +724,7 @@ bool QgsGeoPackageConnectionItem::equal( const QgsDataItem *other )
{
return false;
}
const QgsGeoPackageConnectionItem *o = dynamic_cast<const QgsGeoPackageConnectionItem *>( other );
const QgsGeoPackageConnectionItem *o = qobject_cast<const QgsGeoPackageConnectionItem *>( other );
return o && mPath == o->mPath && mName == o->mName;

}
Expand All @@ -743,7 +742,7 @@ bool QgsGeoPackageAbstractLayerItem::executeDeleteLayer( QString &errCause )
return false;
}

static int collect_strings( void *names, int argc, char **argv, char ** )
static int collect_strings( void *names, int, char **argv, char ** )
{
*static_cast<QList<QString>*>( names ) << QString::fromUtf8( argv[ 0 ] );
return 0;
Expand All @@ -752,7 +751,6 @@ static int collect_strings( void *names, int argc, char **argv, char ** )
QList<QString> QgsGeoPackageAbstractLayerItem::tableNames()
{
QList<QString> names;
QString errCause;
QVariantMap pieces( QgsProviderRegistry::instance()->decodeUri( providerKey(), mUri ) );
QString baseUri = pieces[QStringLiteral( "path" )].toString();
if ( !baseUri.isEmpty() )
Expand Down Expand Up @@ -846,7 +844,7 @@ bool QgsGeoPackageVectorLayerItem::rename( const QString &name )

const QVariantMap parts = QgsProviderRegistry::instance()->decodeUri( mProviderKey, mUri );
QString errCause;
if ( parts.empty() || parts.value( QStringLiteral( "path" ) ).isNull() || parts.value( "layerName" ).isNull() )
if ( parts.empty() || parts.value( QStringLiteral( "path" ) ).isNull() || parts.value( QStringLiteral( "layerName" ) ).isNull() )
{
errCause = QObject::tr( "Layer URI %1 is not valid!" ).arg( mUri );
}
Expand Down

0 comments on commit d9736eb

Please sign in to comment.