Skip to content

Commit

Permalink
Remove ancient disabled layer transparency code
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 29, 2017
1 parent 32af831 commit 5aae97e
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/core/qgsmaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,18 +543,6 @@ bool QgsMapLayer::readLayerXml( const QDomElement &layerElement, const QgsReadWr
mMetadataUrlFormat = metaUrlElem.attribute( QStringLiteral( "format" ), QLatin1String( "" ) );
}

#if 0
//read transparency level
QDomNode transparencyNode = layer_node.namedItem( "transparencyLevelInt" );
if ( ! transparencyNode.isNull() )
{
// set transparency level only if it's in project
// (otherwise it sets the layer transparent)
QDomElement myElement = transparencyNode.toElement();
setTransparency( myElement.text().toInt() );
}
#endif

mMetadata.readFromLayer( this );

return true;
Expand Down Expand Up @@ -821,14 +809,6 @@ bool QgsMapLayer::writeLayerXml( QDomElement &layerElement, QDomDocument &docume
mCRS.writeXml( mySrsElement, document );
layerElement.appendChild( mySrsElement );

#if 0
// <transparencyLevelInt>
QDomElement transparencyLevelIntElement = document.createElement( "transparencyLevelInt" );
QDomText transparencyLevelIntText = document.createTextNode( QString::number( getTransparency() ) );
transparencyLevelIntElement.appendChild( transparencyLevelIntText );
maplayer.appendChild( transparencyLevelIntElement );
#endif

// now append layer node to map layer node

writeCustomProperties( layerElement, document );
Expand Down Expand Up @@ -1212,18 +1192,6 @@ bool QgsMapLayer::importNamedStyle( QDomDocument &myDocument, QString &myErrorMe
setMinimumScale( myRoot.attribute( QStringLiteral( "minimumScale" ) ).toDouble() );
setMaximumScale( myRoot.attribute( QStringLiteral( "maximumScale" ) ).toDouble() );

#if 0
//read transparency level
QDomNode transparencyNode = myRoot.namedItem( "transparencyLevelInt" );
if ( ! transparencyNode.isNull() )
{
// set transparency level only if it's in project
// (otherwise it sets the layer transparent)
QDomElement myElement = transparencyNode.toElement();
setTransparency( myElement.text().toInt() );
}
#endif

return readSymbology( myRoot, myErrorMessage, QgsReadWriteContext() ); // TODO: support relative paths in QML?
}

Expand All @@ -1241,14 +1209,6 @@ void QgsMapLayer::exportNamedStyle( QDomDocument &doc, QString &errorMsg ) const
myRootNode.setAttribute( QStringLiteral( "minimumScale" ), QString::number( minimumScale() ) );
myRootNode.setAttribute( QStringLiteral( "maximumScale" ), QString::number( maximumScale() ) );

#if 0
// <transparencyLevelInt>
QDomElement transparencyLevelIntElement = myDocument.createElement( "transparencyLevelInt" );
QDomText transparencyLevelIntText = myDocument.createTextNode( QString::number( getTransparency() ) );
transparencyLevelIntElement.appendChild( transparencyLevelIntText );
myRootNode.appendChild( transparencyLevelIntElement );
#endif

if ( !writeSymbology( myRootNode, myDocument, errorMsg, QgsReadWriteContext() ) ) // TODO: support relative paths in QML?
{
errorMsg = QObject::tr( "Could not save symbology because:\n%1" ).arg( errorMsg );
Expand Down

0 comments on commit 5aae97e

Please sign in to comment.