Skip to content
Permalink
Browse files

Fix build of sandbox + fix loading/saving project

  • Loading branch information
wonder-sk authored and nyalldawson committed Oct 26, 2020
1 parent 2017f74 commit 8b15cfb4130d14420629887ddcf86ac7c4e9a657
Showing with 25 additions and 6 deletions.
  1. +1 −3 src/app/3d/qgs3dnavigationwidget.h
  2. +24 −3 src/core/pointcloud/qgspointcloudlayer.cpp
@@ -20,9 +20,7 @@
#include <QGridLayout>
#include <QToolButton>

Q_NOWARN_DEPRECATED_PUSH
#include "qwt_compass.h"
Q_NOWARN_DEPRECATED_POP
class QwtCompass;

#include "qgs3dmapcanvas.h"
#include "qgscameracontroller.h"
@@ -78,9 +78,22 @@ const QgsPointCloudDataProvider *QgsPointCloudLayer::dataProvider() const

bool QgsPointCloudLayer::readXml( const QDomNode &layerNode, QgsReadWriteContext &context )
{
//TODO
setValid( false );
// setValid( loadDataSource() );
// create provider
QDomNode pkeyNode = layerNode.namedItem( QStringLiteral( "provider" ) );
QString providerKey = pkeyNode.toElement().text();
QgsDataProvider::ProviderOptions providerOptions { context.transformContext() };
QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags();
if ( mReadFlags & QgsMapLayer::FlagTrustLayerMetadata )
{
flags |= QgsDataProvider::FlagTrustDataSource;
}
// TODO: support QgsMapLayer::FlagDontResolveLayers ?
bool ok = loadDataSource( providerKey, providerOptions, flags );
setValid( ok );
if ( !ok )
{
return false;
}

QString errorMsg;
if ( !readSymbology( layerNode, errorMsg, context ) )
@@ -95,6 +108,14 @@ bool QgsPointCloudLayer::writeXml( QDomNode &layerNode, QDomDocument &doc, const
QDomElement mapLayerNode = layerNode.toElement();
mapLayerNode.setAttribute( QStringLiteral( "type" ), QStringLiteral( "point-cloud" ) );

if ( mDataProvider )
{
QDomElement provider = doc.createElement( QStringLiteral( "provider" ) );
QDomText providerText = doc.createTextNode( providerType() );
provider.appendChild( providerText );
layerNode.appendChild( provider );
}

writeStyleManager( layerNode, doc );

QString errorMsg;

0 comments on commit 8b15cfb

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