@@ -153,7 +153,7 @@ bool QgsGeoPackageCollectionItem::equal( const QgsDataItem *other )
153
153
{
154
154
return false ;
155
155
}
156
- const QgsGeoPackageCollectionItem *o = dynamic_cast <const QgsGeoPackageCollectionItem *>( other );
156
+ const QgsGeoPackageCollectionItem *o = qobject_cast <const QgsGeoPackageCollectionItem *>( other );
157
157
return o && mPath == o->mPath && mName == o->mName ;
158
158
159
159
}
@@ -546,7 +546,6 @@ void QgsGeoPackageVectorLayerItem::renameLayer()
546
546
547
547
// Get layer name from layer URI
548
548
QVariantMap pieces ( QgsProviderRegistry::instance ()->decodeUri ( providerKey (), mUri ) );
549
- QString baseUri = pieces[QStringLiteral ( " path" )].toString ();
550
549
QString layerName = pieces[QStringLiteral ( " layerName" )].toString ();
551
550
552
551
// Collect existing table names
@@ -589,8 +588,8 @@ bool QgsGeoPackageCollectionItem::vacuumGeoPackageDb( const QString &path, const
589
588
if ( status != SQLITE_OK || errmsg )
590
589
{
591
590
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 ) );
594
593
}
595
594
else
596
595
{
@@ -725,7 +724,7 @@ bool QgsGeoPackageConnectionItem::equal( const QgsDataItem *other )
725
724
{
726
725
return false ;
727
726
}
728
- const QgsGeoPackageConnectionItem *o = dynamic_cast <const QgsGeoPackageConnectionItem *>( other );
727
+ const QgsGeoPackageConnectionItem *o = qobject_cast <const QgsGeoPackageConnectionItem *>( other );
729
728
return o && mPath == o->mPath && mName == o->mName ;
730
729
731
730
}
@@ -743,7 +742,7 @@ bool QgsGeoPackageAbstractLayerItem::executeDeleteLayer( QString &errCause )
743
742
return false ;
744
743
}
745
744
746
- static int collect_strings ( void *names, int argc , char **argv, char ** )
745
+ static int collect_strings ( void *names, int , char **argv, char ** )
747
746
{
748
747
*static_cast <QList<QString>*>( names ) << QString::fromUtf8 ( argv[ 0 ] );
749
748
return 0 ;
@@ -752,7 +751,6 @@ static int collect_strings( void *names, int argc, char **argv, char ** )
752
751
QList<QString> QgsGeoPackageAbstractLayerItem::tableNames ()
753
752
{
754
753
QList<QString> names;
755
- QString errCause;
756
754
QVariantMap pieces ( QgsProviderRegistry::instance ()->decodeUri ( providerKey (), mUri ) );
757
755
QString baseUri = pieces[QStringLiteral ( " path" )].toString ();
758
756
if ( !baseUri.isEmpty () )
@@ -846,7 +844,7 @@ bool QgsGeoPackageVectorLayerItem::rename( const QString &name )
846
844
847
845
const QVariantMap parts = QgsProviderRegistry::instance ()->decodeUri ( mProviderKey , mUri );
848
846
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 () )
850
848
{
851
849
errCause = QObject::tr ( " Layer URI %1 is not valid!" ).arg ( mUri );
852
850
}
0 commit comments