Skip to content
Permalink
Browse files

Fix all Qt 5.14 deprecation warnings

  • Loading branch information
nyalldawson committed Jun 15, 2020
1 parent 05f4359 commit 3717adcef6315f4b9a0089bfc2393cede937b644
Showing with 193 additions and 187 deletions.
  1. +1 −1 src/3d/chunks/qgschunkedentity_p.cpp
  2. +1 −1 src/3d/qgs3dmapscene.cpp
  3. +1 −1 src/analysis/network/qgsvectorlayerdirector.cpp
  4. +1 −1 src/analysis/processing/qgsalgorithmcategorizeusingstyle.cpp
  5. +1 −1 src/analysis/processing/qgsalgorithmdeleteduplicategeometries.cpp
  6. +1 −1 src/analysis/processing/qgsalgorithmlineintersection.cpp
  7. +1 −1 src/analysis/processing/qgsalgorithmrandomextract.cpp
  8. +1 −1 src/analysis/processing/qgsalgorithmserviceareafromlayer.cpp
  9. +1 −1 src/analysis/processing/qgsalgorithmserviceareafrompoint.cpp
  10. +1 −1 src/analysis/processing/qgsalgorithmsplitwithlines.cpp
  11. +2 −2 src/analysis/processing/qgsoverlayutils.cpp
  12. +1 −1 src/analysis/vector/geometry_checker/qgsfeaturepool.cpp
  13. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryfollowboundariescheck.cpp
  14. +2 −2 src/analysis/vector/qgsgeometrysnapper.cpp
  15. +4 −0 src/app/dwg/qgsdwgimporter.cpp
  16. +1 −1 src/app/locator/qgsinbuiltlocatorfilters.cpp
  17. +1 −1 src/app/qgisapp.cpp
  18. +1 −1 src/app/qgsattributetabledialog.cpp
  19. +2 −2 src/app/qgsbookmarkeditordialog.cpp
  20. +1 −1 src/app/qgsdxfexportdialog.cpp
  21. +1 −1 src/app/qgsgeometryvalidationmodel.cpp
  22. +2 −2 src/app/qgsgeometryvalidationservice.cpp
  23. +2 −2 src/app/qgsidentifyresultsdialog.cpp
  24. +1 −1 src/app/qgsmaptoolrotatepointsymbols.cpp
  25. +3 −3 src/app/vertextool/qgsvertextool.cpp
  26. +2 −2 src/core/auth/qgsauthmanager.cpp
  27. +1 −1 src/core/expression/qgsexpression.cpp
  28. +2 −2 src/core/fieldformatter/qgsrelationreferencefieldformatter.cpp
  29. +6 −8 src/core/fieldformatter/qgsvaluerelationfieldformatter.cpp
  30. +1 −1 src/core/gps/qgsgpsconnectionregistry.cpp
  31. +3 −3 src/core/layout/qgslayoutmodel.cpp
  32. +1 −1 src/core/providers/memory/qgsmemoryfeatureiterator.cpp
  33. +1 −1 src/core/providers/memory/qgsmemoryprovider.cpp
  34. +4 −4 src/core/providers/ogr/qgsogrfeatureiterator.cpp
  35. +1 −1 src/core/providers/ogr/qgsogrprovider.cpp
  36. +10 −0 src/core/qgis.h
  37. +1 −1 src/core/qgscachedfeatureiterator.cpp
  38. +2 −2 src/core/qgsdataitem.cpp
  39. +2 −2 src/core/qgsexpressioncontext.cpp
  40. +1 −1 src/core/qgsmaprendererjob.cpp
  41. +1 −1 src/core/qgsmapsettingsutils.cpp
  42. +2 −2 src/core/qgsmapthemecollection.cpp
  43. +2 −2 src/core/qgstaskmanager.cpp
  44. +1 −1 src/core/qgsvectorfilewriter.cpp
  45. +2 −2 src/core/qgsvectorlayer.cpp
  46. +3 −3 src/core/qgsvectorlayercache.cpp
  47. +1 −1 src/core/qgsvectorlayereditbuffer.cpp
  48. +5 −5 src/core/qgsvectorlayerfeatureiterator.cpp
  49. +1 −1 src/core/qgsvectorlayerjoinbuffer.cpp
  50. +1 −1 src/core/symbology/qgscategorizedsymbolrenderer.cpp
  51. +1 −1 src/core/symbology/qgsrulebasedrenderer.cpp
  52. +2 −2 src/core/symbology/qgsstyle.cpp
  53. +1 −3 src/core/symbology/qgssymbollayerutils.cpp
  54. +2 −2 src/core/vectortile/qgsvectortileutils.cpp
  55. +1 −1 src/gui/attributetable/qgsattributetableview.cpp
  56. +1 −1 src/gui/editorwidgets/qgsrelationreferencewidget.cpp
  57. +2 −2 src/gui/layertree/qgslayertreeview.cpp
  58. +1 −1 src/gui/processing/qgsprocessingenummodelerwidget.cpp
  59. +1 −1 src/gui/processing/qgsprocessingmatrixparameterdialog.cpp
  60. +3 −3 src/gui/qgscolorschemelist.cpp
  61. +1 −1 src/gui/qgsconfigureshortcutsdialog.cpp
  62. +1 −1 src/gui/qgsexpressionbuilderwidget.cpp
  63. +2 −2 src/gui/qgsfieldmappingmodel.cpp
  64. +1 −1 src/gui/qgsmaptoolidentify.cpp
  65. +1 −1 src/gui/qgsowssourceselect.cpp
  66. +1 −1 src/gui/qgsquerybuilder.cpp
  67. +1 −1 src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp
  68. +2 −2 src/gui/vector/qgsattributeactiondialog.cpp
  69. +1 −1 src/gui/vector/qgswmsdimensiondialog.cpp
  70. +4 −4 src/providers/arcgisrest/qgsafsfeatureiterator.cpp
  71. +1 −1 src/providers/arcgisrest/qgsamsprovider.cpp
  72. +2 −2 src/providers/db2/qgsdb2featureiterator.cpp
  73. +2 −2 src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.cpp
  74. +3 −3 src/providers/gpx/gpsdata.cpp
  75. +2 −2 src/providers/mssql/qgsmssqlfeatureiterator.cpp
  76. +5 −5 src/providers/postgres/qgspgtablemodel.cpp
  77. +2 −2 src/providers/postgres/qgspostgresfeatureiterator.cpp
  78. +2 −2 src/providers/postgres/qgspostgresprovider.cpp
  79. +4 −4 src/providers/spatialite/qgsspatialitefeatureiterator.cpp
  80. +1 −1 src/providers/wcs/qgswcscapabilities.cpp
  81. +1 −2 src/providers/wfs/qgsbackgroundcachedfeatureiterator.cpp
  82. +1 −2 src/providers/wfs/qgsbackgroundcachedshareddata.cpp
  83. +1 −2 src/providers/wfs/qgsoapifitemsrequest.cpp
  84. +1 −3 src/providers/wfs/qgswfsprovider.cpp
  85. +1 −1 src/providers/wfs/qgswfssourceselect.cpp
  86. +3 −3 src/providers/wms/qgswmsprovider.cpp
  87. +9 −9 src/providers/wms/qgswmssourceselect.cpp
  88. +3 −3 src/server/services/wms/qgswmsgetcapabilities.cpp
  89. +1 −1 src/server/services/wms/qgswmsrenderer.cpp
  90. +1 −1 tests/bench/qgsbench.h
  91. +3 −3 tests/src/analysis/testqgsprocessing.cpp
  92. +1 −1 tests/src/app/testqgsmaptooladdfeatureline.cpp
  93. +1 −1 tests/src/core/testqgsexpressioncontext.cpp
  94. +2 −2 tests/src/core/testqgslabelingengine.cpp
  95. +7 −7 tests/src/core/testqgslayoutmap.cpp
  96. +5 −4 tests/src/core/testqgsspatialindex.cpp
  97. +3 −3 tests/src/core/testqgstaskmanager.cpp
  98. +1 −1 tests/src/core/testziplayer.cpp
  99. +1 −1 tests/src/gui/testqgsdualview.cpp
  100. +1 −1 tests/src/providers/testqgswcspublicservers.cpp
@@ -131,7 +131,7 @@ void QgsChunkedEntity::update( const SceneState &state )

int oldJobsCount = pendingJobsCount();

QSet<QgsChunkNode *> activeBefore = QSet<QgsChunkNode *>::fromList( mActiveNodes );
QSet<QgsChunkNode *> activeBefore = qgis::listToSet( mActiveNodes );
mActiveNodes.clear();
mFrustumCulled = 0;
mCurrentTime = QTime::currentTime();
@@ -516,7 +516,7 @@ void Qgs3DMapScene::onLayerRenderer3DChanged()

void Qgs3DMapScene::onLayersChanged()
{
QSet<QgsMapLayer *> layersBefore = QSet<QgsMapLayer *>::fromList( mLayerEntities.keys() );
QSet<QgsMapLayer *> layersBefore = qgis::listToSet( mLayerEntities.keys() );
QList<QgsMapLayer *> layersAdded;
Q_FOREACH ( QgsMapLayer *layer, mMap.layers() )
{
@@ -85,7 +85,7 @@ QgsAttributeList QgsVectorLayerDirector::requiredAttributes() const
{
attrs.unite( strategy->requiredAttributes() );
}
return attrs.toList();
return qgis::setToList( attrs );
}

QgsVectorLayerDirector::Direction QgsVectorLayerDirector::directionForFeature( const QgsFeature &feature ) const
@@ -204,7 +204,7 @@ QVariantMap QgsCategorizeUsingStyleAlgorithm::processAlgorithm( const QVariantMa
uniqueVals << value;
}

QVariantList sortedUniqueVals = uniqueVals.toList();
QVariantList sortedUniqueVals = qgis::setToList( uniqueVals );
std::sort( sortedUniqueVals.begin(), sortedUniqueVals.end() );

QgsCategoryList cats;
@@ -164,7 +164,7 @@ QVariantMap QgsDeleteDuplicateGeometriesAlgorithm::processAlgorithm( const QVari

// now, fetch all the feature attributes for the unique features only
// be super-smart and don't re-fetch geometries
QSet< QgsFeatureId > outputFeatureIds = uniqueFeatures.keys().toSet();
QSet< QgsFeatureId > outputFeatureIds = qgis::listToSet( uniqueFeatures.keys() );
outputFeatureIds.unite( nullGeometryFeatures );
step = outputFeatureIds.empty() ? 1 : 100.0 / outputFeatureIds.size();

@@ -125,7 +125,7 @@ QVariantMap QgsLineIntersectionAlgorithm::processAlgorithm( const QVariantMap &p
continue;

QgsGeometry inGeom = inFeatureA.geometry();
QgsFeatureIds lines = spatialIndex.intersects( inGeom.boundingBox() ).toSet();
QgsFeatureIds lines = qgis::listToSet( spatialIndex.intersects( inGeom.boundingBox() ) );
if ( !lines.empty() )
{
// use prepared geometries for faster intersection tests
@@ -121,7 +121,7 @@ QVariantMap QgsRandomExtractAlgorithm::processAlgorithm( const QVariantMap &para
idsCount[ id ] += 1;
}

QgsFeatureIds ids = QSet< QgsFeatureId >::fromList( idsCount.keys() );
QgsFeatureIds ids = qgis::listToSet( idsCount.keys() );
QgsFeatureIterator fit = source->getFeatures( QgsFeatureRequest().setFilterFids( ids ), QgsProcessingFeatureSource::FlagSkipGeometryValidityChecks );

QgsFeature f;
@@ -199,7 +199,7 @@ QVariantMap QgsServiceAreaFromLayerAlgorithm::processAlgorithm( const QVariantMa
} // costs

// convert to list and sort to maintain same order of points between algorithm runs
QList< int > verticesList = vertices.toList();
QList< int > verticesList = qgis::setToList( vertices );
areaPoints.reserve( verticesList.size() );
std::sort( verticesList.begin(), verticesList.end() );
for ( int v : verticesList )
@@ -164,7 +164,7 @@ QVariantMap QgsServiceAreaFromPointAlgorithm::processAlgorithm( const QVariantMa
} // costs

// convert to list and sort to maintain same order of points between algorithm runs
QList< int > verticesList = vertices.toList();
QList< int > verticesList = qgis::setToList( vertices );
points.reserve( verticesList.size() );
std::sort( verticesList.begin(), verticesList.end() );
for ( int v : verticesList )
@@ -146,7 +146,7 @@ QVariantMap QgsSplitWithLinesAlgorithm::processAlgorithm( const QVariantMap &par

QVector< QgsGeometry > inGeoms = inGeom.asGeometryCollection();

const QgsFeatureIds lines = spatialIndex.intersects( inGeom.boundingBox() ).toSet();
const QgsFeatureIds lines = qgis::listToSet( spatialIndex.intersects( inGeom.boundingBox() ) );
if ( !lines.empty() ) // has intersection of bounding boxes
{
QVector< QgsGeometry > splittingLines;
@@ -104,7 +104,7 @@ void QgsOverlayUtils::difference( const QgsFeatureSource &sourceA, const QgsFeat
if ( featA.hasGeometry() )
{
QgsGeometry geom( featA.geometry() );
QgsFeatureIds intersects = indexB.intersects( geom.boundingBox() ).toSet();
QgsFeatureIds intersects = qgis::listToSet( indexB.intersects( geom.boundingBox() ) );

QgsFeatureRequest request;
request.setFilterFids( intersects );
@@ -209,7 +209,7 @@ void QgsOverlayUtils::intersection( const QgsFeatureSource &sourceA, const QgsFe
continue;

QgsGeometry geom( featA.geometry() );
QgsFeatureIds intersects = indexB.intersects( geom.boundingBox() ).toSet();
QgsFeatureIds intersects = qgis::listToSet( indexB.intersects( geom.boundingBox() ) );

QgsFeatureRequest request;
request.setFilterFids( intersects );
@@ -100,7 +100,7 @@ QgsFeatureIds QgsFeaturePool::allFeatureIds() const
QgsFeatureIds QgsFeaturePool::getIntersects( const QgsRectangle &rect ) const
{
QgsReadWriteLocker locker( mCacheLock, QgsReadWriteLocker::Read );
QgsFeatureIds ids = QgsFeatureIds::fromList( mIndex.intersects( rect ) );
QgsFeatureIds ids = qgis::listToSet( mIndex.intersects( rect ) );
return ids;
}

@@ -62,7 +62,7 @@ void QgsGeometryFollowBoundariesCheck::collectErrors( const QMap<QString, QgsFea
// Get potential reference features
QgsRectangle searchBounds = geomt.constGet()->boundingBox();
searchBounds.grow( mContext->tolerance );
QgsFeatureIds refFeatureIds = mIndex->intersects( searchBounds ).toSet();
QgsFeatureIds refFeatureIds = qgis::listToSet( mIndex->intersects( searchBounds ) );

QgsFeatureRequest refFeatureRequest = QgsFeatureRequest().setFilterFids( refFeatureIds ).setNoAttributes();
QgsFeatureIterator refFeatureIt = mCheckLayer->getFeatures( refFeatureRequest );
@@ -485,7 +485,7 @@ QgsGeometry QgsGeometrySnapper::snapGeometry( const QgsGeometry &geometry, doubl
mIndexMutex.lock();
QgsRectangle searchBounds = geometry.boundingBox();
searchBounds.grow( snapTolerance );
QgsFeatureIds refFeatureIds = mIndex.intersects( searchBounds ).toSet();
QgsFeatureIds refFeatureIds = qgis::listToSet( mIndex.intersects( searchBounds ) );
mIndexMutex.unlock();

QgsFeatureRequest refFeatureRequest = QgsFeatureRequest().setFilterFids( refFeatureIds ).setNoAttributes();
@@ -758,7 +758,7 @@ QgsGeometry QgsInternalGeometrySnapper::snapFeature( const QgsFeature &feature )
// Get potential reference features and construct snap index
QgsRectangle searchBounds = geometry.boundingBox();
searchBounds.grow( mSnapTolerance );
QgsFeatureIds refFeatureIds = mProcessedIndex.intersects( searchBounds ).toSet();
QgsFeatureIds refFeatureIds = qgis::listToSet( mProcessedIndex.intersects( searchBounds ) );
if ( !refFeatureIds.isEmpty() )
{
QList< QgsGeometry > refGeometries;
@@ -834,7 +834,11 @@ void QgsDwgImporter::addLType( const DRW_LType &data )
setString( dfn, f.get(), QStringLiteral( "name" ), name );
SETSTRINGPTR( desc );

#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QVector<double> path( QVector<double>::fromStdVector( data.path ) );
#else
QVector<double> path( data.path.begin(), data.path.end() );
#endif
OGR_F_SetFieldDoubleList( f.get(), OGR_FD_GetFieldIndex( dfn, "path" ), path.size(), path.data() );

QVector<double> upath;
@@ -379,7 +379,7 @@ void QgsAllLayersFeaturesLocatorFilter::prepare( const QString &string, const Qg
expression.prepare( &context );

QgsFeatureRequest req;
req.setSubsetOfAttributes( expression.referencedAttributeIndexes( layer->fields() ).toList() );
req.setSubsetOfAttributes( qgis::setToList( expression.referencedAttributeIndexes( layer->fields() ) ) );
if ( !expression.needsGeometry() )
req.setFlags( QgsFeatureRequest::NoGeometry );
QString enhancedSearch = string;
@@ -12889,7 +12889,7 @@ bool QgisApp::checkTasksDependOnProject()
if ( !activeTaskDescriptions.isEmpty() )
{
QMessageBox::warning( this, tr( "Active Tasks" ),
tr( "The following tasks are currently running which depend on layers in this project:\n\n%1\n\nPlease cancel these tasks and retry." ).arg( activeTaskDescriptions.toList().join( QStringLiteral( "\n" ) ) ) );
tr( "The following tasks are currently running which depend on layers in this project:\n\n%1\n\nPlease cancel these tasks and retry." ).arg( qgis::setToList( activeTaskDescriptions ).join( QStringLiteral( "\n" ) ) ) );
return true;
}
return false;
@@ -636,7 +636,7 @@ void QgsAttributeTableDialog::mActionCopySelectedRows_triggered()
}
featureStore.setFields( fields );

QgsFeatureIterator it = mLayer->getFeatures( QgsFeatureRequest( featureIds.toSet() )
QgsFeatureIterator it = mLayer->getFeatures( QgsFeatureRequest( qgis::listToSet( featureIds ) )
.setSubsetOfAttributes( fieldNames, mLayer->fields() ) );
QgsFeatureMap featureMap;
QgsFeature feature;
@@ -39,8 +39,8 @@ QgsBookmarkEditorDialog::QgsBookmarkEditorDialog( QgsBookmark bookmark, bool inP

mName->setText( mBookmark.name() );

QSet<QString> groups = QSet<QString>::fromList( QgsProject::instance()->bookmarkManager()->groups() << QgsApplication::instance()->bookmarkManager()->groups() );
QStringList groupsList = groups.toList();
QSet<QString> groups = qgis::listToSet( QgsProject::instance()->bookmarkManager()->groups() << QgsApplication::instance()->bookmarkManager()->groups() );
QStringList groupsList = qgis::setToList( groups );
groupsList.removeOne( QString() );
groupsList.sort();
mGroup->addItems( groupsList );
@@ -350,7 +350,7 @@ void QgsVectorLayerAndAttributeModel::applyVisibilityPreset( const QString &name
}
else
{
visibleLayers = QgsProject::instance()->mapThemeCollection()->mapThemeVisibleLayerIds( name ).toSet();
visibleLayers = qgis::listToSet( QgsProject::instance()->mapThemeCollection()->mapThemeVisibleLayerIds( name ) );
}

if ( visibleLayers.isEmpty() )
@@ -246,7 +246,7 @@ void QgsGeometryValidationModel::setCurrentLayer( QgsVectorLayer *currentLayer )
mDisplayExpression = mCurrentLayer ? mCurrentLayer->displayExpression() : QString();
mExpressionContext = QgsExpressionContext( QgsExpressionContextUtils::globalProjectLayerScopes( mCurrentLayer ) );
mDisplayExpression.prepare( &mExpressionContext );
mRequiredAttributes = mDisplayExpression.referencedColumns().toList();
mRequiredAttributes = qgis::setToList( mDisplayExpression.referencedColumns() );
}
else
{
@@ -414,8 +414,8 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
QgsFeatureIds affectedFeatureIds;
if ( layer->editBuffer() )
{
affectedFeatureIds = layer->editBuffer()->changedGeometries().keys().toSet();
affectedFeatureIds.unite( layer->editBuffer()->addedFeatures().keys().toSet() );
affectedFeatureIds = qgis::listToSet( layer->editBuffer()->changedGeometries().keys() );
affectedFeatureIds.unite( qgis::listToSet( layer->editBuffer()->addedFeatures().keys() ) );
}

const QString layerId = layer->id();
@@ -601,7 +601,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
QTreeWidgetItem *twi = new QTreeWidgetItem( QStringList() << QString() << action->text() );
twi->setIcon( 0, QgsApplication::getThemeIcon( QStringLiteral( "/mAction.svg" ) ) );
twi->setData( 0, Qt::UserRole, "map_layer_action" );
twi->setData( 0, Qt::UserRole + 1, qVariantFromValue( qobject_cast<QObject *>( action ) ) );
twi->setData( 0, Qt::UserRole + 1, QVariant::fromValue( qobject_cast<QObject *>( action ) ) );
actionItem->addChild( twi );

connect( action, &QObject::destroyed, this, &QgsIdentifyResultsDialog::mapLayerActionDestroyed );
@@ -851,7 +851,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer,
if ( !( QgsRasterDataProvider::identifyFormatToCapability( f ) & capabilities ) )
continue;
formatCombo->addItem( QgsRasterDataProvider::identifyFormatLabel( f ), f );
formatCombo->setItemData( formatCombo->count() - 1, qVariantFromValue( qobject_cast<QObject *>( layer ) ), Qt::UserRole + 1 );
formatCombo->setItemData( formatCombo->count() - 1, QVariant::fromValue( qobject_cast<QObject *>( layer ) ), Qt::UserRole + 1 );
if ( currentFormat == f )
formatCombo->setCurrentIndex( formatCombo->count() - 1 );
}
@@ -77,7 +77,7 @@ void QgsMapToolRotatePointSymbols::canvasPressEvent( QgsMapMouseEvent *e )
void QgsMapToolRotatePointSymbols::canvasPressOnFeature( QgsMapMouseEvent *e, const QgsFeature &feature, const QgsPointXY &snappedPoint )
{
//find out initial arrow direction
QVariant attrVal = feature.attribute( mCurrentRotationAttributes.toList().at( 0 ) );
QVariant attrVal = feature.attribute( qgis::setToList( mCurrentRotationAttributes ).at( 0 ) );

mCurrentRotationFeature = attrVal.toDouble();
createPixmapItem( mMarkerSymbol.get() );
@@ -1005,7 +1005,7 @@ void QgsVertexTool::tryToSelectFeature( QgsMapMouseEvent *e )
mLockedFeatureAlternatives->alternatives.append( firstChoice );
alternatives.remove( firstChoice );
}
mLockedFeatureAlternatives->alternatives.append( alternatives.toList() );
mLockedFeatureAlternatives->alternatives.append( qgis::setToList( alternatives ) );

if ( mLockedFeature )
{
@@ -2222,13 +2222,13 @@ void QgsVertexTool::deleteVertex()
QSet<Vertex> toDelete;
if ( !mSelectedVertices.isEmpty() )
{
toDelete = QSet<Vertex>::fromList( mSelectedVertices );
toDelete = qgis::listToSet( mSelectedVertices );
}
else
{
bool addingVertex = mDraggingVertexType == AddingVertex || mDraggingVertexType == AddingEndpoint;
toDelete << *mDraggingVertex;
toDelete += QSet<Vertex>::fromList( mDraggingExtraVertices );
toDelete += qgis::listToSet( mDraggingExtraVertices );

if ( addingVertex )
{
@@ -2266,7 +2266,7 @@ bool QgsAuthManager::updateIgnoredSslErrorsCacheFromConfig( const QgsAuthConfigS
QList<QSslError::SslError> errenums( config.sslIgnoredErrorEnums() );
if ( !errenums.isEmpty() )
{
mIgnoredSslErrorsCache.insert( shahostport, QSet<QSslError::SslError>::fromList( errenums ) );
mIgnoredSslErrorsCache.insert( shahostport, qgis::listToSet( errenums ) );
QgsDebugMsg( QStringLiteral( "Update of ignored SSL errors cache SUCCEEDED for sha:host:port = %1" ).arg( shahostport ) );
dumpIgnoredSslErrorsCache_();
return true;
@@ -2347,7 +2347,7 @@ bool QgsAuthManager::rebuildIgnoredSslErrorCache()
QList<QSslError::SslError> errenums( config.sslIgnoredErrorEnums() );
if ( !errenums.isEmpty() )
{
nextcache.insert( shahostport, QSet<QSslError::SslError>::fromList( errenums ) );
nextcache.insert( shahostport, qgis::listToSet( errenums ) );
}
if ( prevcache.contains( shahostport ) )
{
@@ -250,7 +250,7 @@ QSet<int> QgsExpression::referencedAttributeIndexes( const QgsFields &fields ) c
{
if ( fieldName == QgsFeatureRequest::ALL_ATTRIBUTES )
{
referencedIndexes = fields.allAttributesList().toSet();
referencedIndexes = qgis::listToSet( fields.allAttributesList() );
break;
}
const int idx = fields.lookupField( fieldName );
@@ -147,7 +147,7 @@ QVariant QgsRelationReferenceFieldFormatter::createCache( QgsVectorLayer *layer,

QgsFeatureRequest request;
request.setFlags( QgsFeatureRequest::NoGeometry );
QgsAttributeList requiredAttributes = expr.referencedAttributeIndexes( referencedLayer->fields() ).toList();
QgsAttributeList requiredAttributes = qgis::setToList( expr.referencedAttributeIndexes( referencedLayer->fields() ) );
requiredAttributes << referencedFieldIdx;
request.setSubsetOfAttributes( requiredAttributes );
QgsFeature feature;
@@ -196,7 +196,7 @@ QVariantList QgsRelationReferenceFieldFormatter::availableValues( const QVariant
if ( referencedLayer )
{
int fieldIndex = context.project()->relationManager()->relation( config[QStringLiteral( "Relation" )].toString() ).referencedFields().first();
values = referencedLayer->uniqueValues( fieldIndex, countLimit ).toList();
values = qgis::setToList( referencedLayer->uniqueValues( fieldIndex, countLimit ) );
}
}
return values;
@@ -147,7 +147,7 @@ QgsValueRelationFieldFormatter::ValueRelationCache QgsValueRelationFieldFormatte
QgsExpressionContext context( QgsExpressionContextUtils::globalProjectLayerScopes( layer ) );
descriptionExpression.prepare( &context );
subsetOfAttributes += descriptionExpression.referencedAttributeIndexes( layer->fields() );
request.setSubsetOfAttributes( subsetOfAttributes.toList() );
request.setSubsetOfAttributes( qgis::setToList( subsetOfAttributes ) );

const QString filterExpression = config.value( QStringLiteral( "FilterExpression" ) ).toString();

@@ -219,7 +219,7 @@ QVariantList QgsValueRelationFieldFormatter::availableValues( const QVariantMap
if ( referencedLayer )
{
int fieldIndex = referencedLayer->fields().indexOf( config.value( QStringLiteral( "Key" ) ).toString() );
values = referencedLayer->uniqueValues( fieldIndex, countLimit ).toList();
values = qgis::setToList( referencedLayer->uniqueValues( fieldIndex, countLimit ) );
}
}
return values;
@@ -291,7 +291,7 @@ QStringList QgsValueRelationFieldFormatter::valueToStringList( const QVariant &v
QSet<QString> QgsValueRelationFieldFormatter::expressionFormVariables( const QString &expression )
{
std::unique_ptr< QgsExpressionContextScope > scope( QgsExpressionContextUtils::formScope() );
QSet< QString > formVariables = scope->variableNames().toSet();
QSet< QString > formVariables = qgis::listToSet( scope->variableNames() );
const QSet< QString > usedVariables = QgsExpression( expression ).referencedVariables();
formVariables.intersect( usedVariables );
return formVariables;
@@ -300,7 +300,7 @@ QSet<QString> QgsValueRelationFieldFormatter::expressionFormVariables( const QSt
QSet<QString> QgsValueRelationFieldFormatter::expressionParentFormVariables( const QString &expression )
{
std::unique_ptr< QgsExpressionContextScope > scope( QgsExpressionContextUtils::parentFormScope() );
QSet< QString > formVariables = scope->variableNames().toSet();
QSet< QString > formVariables = qgis::listToSet( scope->variableNames() );
const QSet< QString > usedVariables = QgsExpression( expression ).referencedVariables();
formVariables.intersect( usedVariables );
return formVariables;
@@ -322,8 +322,7 @@ QSet<QString> QgsValueRelationFieldFormatter::expressionParentFormAttributes( co
QgsExpression exp( expression );
std::unique_ptr< QgsExpressionContextScope > scope( QgsExpressionContextUtils::parentFormScope() );
// List of form function names used in the expression
const QSet<QString> formFunctions( scope->functionNames()
.toSet()
const QSet<QString> formFunctions( qgis::listToSet( scope->functionNames() )
.intersect( exp.referencedFunctions( ) ) );
const QList<const QgsExpressionNodeFunction *> expFunctions( exp.findNodes<QgsExpressionNodeFunction>() );
QgsExpressionContext context;
@@ -347,8 +346,7 @@ QSet<QString> QgsValueRelationFieldFormatter::expressionFormAttributes( const QS
QgsExpression exp( expression );
std::unique_ptr< QgsExpressionContextScope > scope( QgsExpressionContextUtils::formScope() );
// List of form function names used in the expression
const QSet<QString> formFunctions( scope->functionNames()
.toSet()
const QSet<QString> formFunctions( qgis::listToSet( scope->functionNames() )
.intersect( exp.referencedFunctions( ) ) );
const QList<const QgsExpressionNodeFunction *> expFunctions( exp.findNodes<QgsExpressionNodeFunction>() );
QgsExpressionContext context;

0 comments on commit 3717adc

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