Skip to content

Commit

Permalink
also report layer error when exporting point clouds
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored and nyalldawson committed Oct 4, 2022
1 parent ffbd8a8 commit 8212a53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -8446,12 +8446,17 @@ QString QgisApp::saveAsPointCloudLayer( QgsPointCloudLayer *pclayer )
QgsMapLayer *ml = exp->takeExportedLayer();
if ( ! ml->isValid() )
{
visibleMessageBar()->pushMessage( tr( "Export failed" ),
tr( "A problem occurred while exporting: %1" ).arg( exp->lastError() ),
Qgis::MessageLevel::Warning );
if ( ! exp->lastError().isEmpty() )
visibleMessageBar()->pushMessage( tr( "Export failed" ),
tr( "A problem occurred while exporting: %1" ).arg( exp->lastError() ),
Qgis::MessageLevel::Warning );
else
visibleMessageBar()->pushMessage( tr( "Cannot open file" ),
tr( "Cannot open exported file: %1" ).arg( ml->error().summary() ),
Qgis::MessageLevel::Warning );
}

if ( addToCanvas )
if ( addToCanvas && ml->isValid() )
QgsProject::instance()->addMapLayer( ml );
else
delete ml;
Expand Down
1 change: 0 additions & 1 deletion src/providers/pdal/qgspdalprovider.cpp
Expand Up @@ -296,7 +296,6 @@ bool QgsPdalProvider::load( const QString &uri )
appendError( errorString );
return false;
}

}

QString QgsPdalProviderMetadata::sFilterString;
Expand Down

0 comments on commit 8212a53

Please sign in to comment.