Skip to content

Commit

Permalink
Extra fixes related to truncation of feature count
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and nyalldawson committed Jun 15, 2021
1 parent 53ca5b2 commit d482bc0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions python/core/auto_generated/qgsofflineediting.sip.in
Expand Up @@ -73,7 +73,7 @@ comparing the index of the current ``layer`` to the total amount
``numLayers``.
%End

void progressModeSet( QgsOfflineEditing::ProgressMode mode, int maximum );
void progressModeSet( QgsOfflineEditing::ProgressMode mode, long long maximum );
%Docstring
Emitted when the mode for the progress of the current operation is
set.
Expand All @@ -82,7 +82,7 @@ set.
:param maximum: total number of entities to process in the current operation
%End

void progressUpdated( int progress );
void progressUpdated( long long progress );
%Docstring
Emitted with the progress of the current mode

Expand Down
12 changes: 6 additions & 6 deletions src/analysis/processing/qgsalgorithmexportmesh.cpp
Expand Up @@ -1298,7 +1298,7 @@ QVariantMap QgsMeshExportCrossSection::processAlgorithm( const QVariantMap &para
QgsFeature feat;
while ( featIt.nextFeature( feat ) )
{
int fid = feat.id();
QgsFeatureId fid = feat.id();
QgsGeometry line = feat.geometry();
try
{
Expand Down Expand Up @@ -1359,7 +1359,7 @@ QVariantMap QgsMeshExportCrossSection::processAlgorithm( const QVariantMap &para

if ( feedback )
{
feedback->setProgress( 100 * featCounter / featCount );
feedback->setProgress( 100.0 * featCounter / featCount );
if ( feedback->isCanceled() )
return QVariantMap();
}
Expand Down Expand Up @@ -1609,13 +1609,13 @@ QVariantMap QgsMeshExportTimeSeries::processAlgorithm( const QVariantMap &parame

textStream << header.join( ',' ) << QStringLiteral( "\n" );

int featCount = featureSource->featureCount();
int featCounter = 0;
long long featCount = featureSource->featureCount();
long long featCounter = 0;
QgsFeatureIterator featIt = featureSource->getFeatures();
QgsFeature feat;
while ( featIt.nextFeature( feat ) )
{
int fid = feat.id();
QgsFeatureId fid = feat.id();
QgsGeometry geom = feat.geometry();
try
{
Expand Down Expand Up @@ -1709,7 +1709,7 @@ QVariantMap QgsMeshExportTimeSeries::processAlgorithm( const QVariantMap &parame
featCounter++;
if ( feedback )
{
feedback->setProgress( 100 * featCounter / featCount );
feedback->setProgress( 100.0 * featCounter / featCount );
if ( feedback->isCanceled() )
return QVariantMap();
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsofflineediting.cpp
Expand Up @@ -851,7 +851,7 @@ QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlit
{
emit progressModeSet( QgsOfflineEditing::CopyFeatures, layer->dataProvider()->featureCount() );
}
int featureCount = 1;
long long featureCount = 1;

QList<QgsFeatureId> remoteFeatureIds;
while ( fit.nextFeature( f ) )
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsofflineediting.h
Expand Up @@ -95,13 +95,13 @@ class CORE_EXPORT QgsOfflineEditing : public QObject
* \param mode progress mode
* \param maximum total number of entities to process in the current operation
*/
void progressModeSet( QgsOfflineEditing::ProgressMode mode, int maximum );
void progressModeSet( QgsOfflineEditing::ProgressMode mode, long long maximum );

/**
* Emitted with the progress of the current mode
* \param progress current index of processed entities
*/
void progressUpdated( int progress );
void progressUpdated( long long progress );

//! Emitted when the processing of all layers has finished
void progressStopped();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetablemodel.h
Expand Up @@ -343,7 +343,7 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel

QHash<QgsFeatureId, int> mIdRowMap;
QHash<int, QgsFeatureId> mRowIdMap;
mutable QHash<int, QList<QgsConditionalStyle> > mRowStylesMap;
mutable QHash<QgsFeatureId, QList<QgsConditionalStyle> > mRowStylesMap;

mutable QgsExpressionContext mExpressionContext;

Expand Down
2 changes: 1 addition & 1 deletion tests/src/geometry_checker/testqgsgeometrychecks.cpp
Expand Up @@ -1065,7 +1065,7 @@ void TestQgsGeometryChecks::testSelfIntersectionCheck()
// Test fixes
QgsFeature f;

int nextId = testContext.second[errs1[0]->layerId()]->layer()->featureCount();
QgsFeatureId nextId = testContext.second[errs1[0]->layerId()]->layer()->featureCount();
QVERIFY( fixCheckError( testContext.second, errs1[0],
QgsGeometrySelfIntersectionCheck::ToSingleObjects, QgsGeometryCheckError::StatusFixed,
{
Expand Down

0 comments on commit d482bc0

Please sign in to comment.