Skip to content

Commit

Permalink
Don't warn on failure to calculate point cloud stats if task was expl…
Browse files Browse the repository at this point in the history
…icitly cancelled
  • Loading branch information
nyalldawson committed Oct 9, 2023
1 parent 79b03ff commit f9fc9df
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/pointcloud/qgspointcloudlayer.cpp
Expand Up @@ -72,6 +72,7 @@ QgsPointCloudLayer::~QgsPointCloudLayer()
{
if ( QgsTask *task = QgsApplication::taskManager()->task( mStatsCalculationTask ) )
{
mStatsCalculationTask = 0;
task->cancel();
}
}
Expand Down Expand Up @@ -934,8 +935,11 @@ void QgsPointCloudLayer::calculateStatistics()
// In case the statistics calculation fails, QgsTask::taskTerminated will be called
connect( task, &QgsTask::taskTerminated, this, [this]()
{
QgsMessageLog::logMessage( QObject::tr( "Failed to calculate statistics of the point cloud %1" ).arg( this->name() ) );
mStatsCalculationTask = 0;
if ( mStatsCalculationTask )
{
QgsMessageLog::logMessage( QObject::tr( "Failed to calculate statistics of the point cloud %1" ).arg( this->name() ) );
mStatsCalculationTask = 0;
}
} );

mStatsCalculationTask = QgsApplication::taskManager()->addTask( task );
Expand Down

0 comments on commit f9fc9df

Please sign in to comment.