Skip to content

Commit

Permalink
Dox++
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 9, 2019
1 parent 458a247 commit 51ed8c9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions python/core/auto_generated/qgsmaplayer.sip.in
Expand Up @@ -526,6 +526,7 @@ Sets state from DOM document

:param layerElement: The DOM element corresponding to ``maplayer'' tag
:param context: writing context (e.g. for conversion between relative and absolute paths)
:param flags: optional argument which can be used to control layer reading behavior.
\note

The DOM node corresponds to a DOM document project file XML element read
Expand All @@ -536,8 +537,6 @@ by sub-classes so that they can read their own specific state from the given DOM

Invoked by :py:func:`QgsProject.read()`

The optional ``flags`` argument can be used to control layer reading behavior.

:return: ``True`` if successful
%End

Expand Down
3 changes: 1 addition & 2 deletions src/core/qgsmaplayer.h
Expand Up @@ -536,6 +536,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
* Sets state from DOM document
* \param layerElement The DOM element corresponding to ``maplayer'' tag
* \param context writing context (e.g. for conversion between relative and absolute paths)
* \param flags optional argument which can be used to control layer reading behavior.
* \note
*
* The DOM node corresponds to a DOM document project file XML element read
Expand All @@ -546,8 +547,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
*
* Invoked by QgsProject::read().
*
* The optional \a flags argument can be used to control layer reading behavior.
*
* \returns TRUE if successful
*/
bool readLayerXml( const QDomElement &layerElement, QgsReadWriteContext &context, QgsMapLayer::ReadFlags flags = nullptr );
Expand Down
5 changes: 4 additions & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -1438,7 +1438,10 @@ bool QgsVectorLayer::readXml( const QDomNode &layer_node, QgsReadWriteContext &c
QgsDataProvider::ProviderOptions options { context.transformContext() };
if ( ( mReadFlags & QgsMapLayer::FlagDontResolveLayers ) || !setDataProvider( mProviderKey, options ) )
{
QgsDebugMsg( QStringLiteral( "Could not set data provider for layer %1" ).arg( publicSource() ) );
if ( !( mReadFlags & QgsMapLayer::FlagDontResolveLayers ) )
{
QgsDebugMsg( QStringLiteral( "Could not set data provider for layer %1" ).arg( publicSource() ) );
}
const QDomElement elem = layer_node.toElement();

// for invalid layer sources, we fallback to stored wkbType if available
Expand Down
5 changes: 4 additions & 1 deletion src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -1785,7 +1785,10 @@ bool QgsRasterLayer::readXml( const QDomNode &layer_node, QgsReadWriteContext &c

if ( ! mDataProvider )
{
QgsDebugMsg( QStringLiteral( "Raster data provider could not be created for %1" ).arg( mDataSource ) );
if ( !( mReadFlags & QgsMapLayer::FlagDontResolveLayers ) )
{
QgsDebugMsg( QStringLiteral( "Raster data provider could not be created for %1" ).arg( mDataSource ) );
}
return false;
}

Expand Down

0 comments on commit 51ed8c9

Please sign in to comment.