Skip to content

Commit d9736eb

Browse files
committed
Fix warnings
1 parent a14f5e4 commit d9736eb

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/providers/ogr/qgsgeopackagedataitems.cpp

+6-8
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ bool QgsGeoPackageCollectionItem::equal( const QgsDataItem *other )
153153
{
154154
return false;
155155
}
156-
const QgsGeoPackageCollectionItem *o = dynamic_cast<const QgsGeoPackageCollectionItem *>( other );
156+
const QgsGeoPackageCollectionItem *o = qobject_cast<const QgsGeoPackageCollectionItem *>( other );
157157
return o && mPath == o->mPath && mName == o->mName;
158158

159159
}
@@ -546,7 +546,6 @@ void QgsGeoPackageVectorLayerItem::renameLayer()
546546

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

552551
// Collect existing table names
@@ -589,8 +588,8 @@ bool QgsGeoPackageCollectionItem::vacuumGeoPackageDb( const QString &path, const
589588
if ( status != SQLITE_OK || errmsg )
590589
{
591590
errCause = tr( "There was an error compacting (VACUUM) the database <b>%1</b>: %2" )
592-
.arg( name )
593-
.arg( QString::fromUtf8( errmsg ) );
591+
.arg( name,
592+
QString::fromUtf8( errmsg ) );
594593
}
595594
else
596595
{
@@ -725,7 +724,7 @@ bool QgsGeoPackageConnectionItem::equal( const QgsDataItem *other )
725724
{
726725
return false;
727726
}
728-
const QgsGeoPackageConnectionItem *o = dynamic_cast<const QgsGeoPackageConnectionItem *>( other );
727+
const QgsGeoPackageConnectionItem *o = qobject_cast<const QgsGeoPackageConnectionItem *>( other );
729728
return o && mPath == o->mPath && mName == o->mName;
730729

731730
}
@@ -743,7 +742,7 @@ bool QgsGeoPackageAbstractLayerItem::executeDeleteLayer( QString &errCause )
743742
return false;
744743
}
745744

746-
static int collect_strings( void *names, int argc, char **argv, char ** )
745+
static int collect_strings( void *names, int, char **argv, char ** )
747746
{
748747
*static_cast<QList<QString>*>( names ) << QString::fromUtf8( argv[ 0 ] );
749748
return 0;
@@ -752,7 +751,6 @@ static int collect_strings( void *names, int argc, char **argv, char ** )
752751
QList<QString> QgsGeoPackageAbstractLayerItem::tableNames()
753752
{
754753
QList<QString> names;
755-
QString errCause;
756754
QVariantMap pieces( QgsProviderRegistry::instance()->decodeUri( providerKey(), mUri ) );
757755
QString baseUri = pieces[QStringLiteral( "path" )].toString();
758756
if ( !baseUri.isEmpty() )
@@ -846,7 +844,7 @@ bool QgsGeoPackageVectorLayerItem::rename( const QString &name )
846844

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

0 commit comments

Comments
 (0)