Skip to content
Permalink
Browse files

Show embedded layers in italic

  • Loading branch information
mhugent committed Jun 9, 2011
1 parent b41493b commit 733df174a1078212db6fc83be90239bb1c4afcd4
Showing with 19 additions and 3 deletions.
  1. +6 −0 src/app/legend/qgslegend.cpp
  2. +1 −1 src/app/qgisapp.cpp
  3. +10 −1 src/core/qgsproject.cpp
  4. +2 −1 src/core/qgsproject.h
@@ -636,6 +636,12 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
}

QgsLegendLayer* llayer = new QgsLegendLayer( layer );
if( !QgsProject::instance()->layerIsEmbedded( layer->id() ).isEmpty() )
{
QFont itemFont;
itemFont.setItalic( true );
llayer->setFont( 0, itemFont );
}

//set the correct check states
blockSignals( true );
@@ -5055,7 +5055,7 @@ void QgisApp::embedLayers()

//hardcoded for debugging
QString filepath="/home/marco/geodaten/projekte/composertest.qgs";
QString id="komb113320110516093016594";
QString id="komb113320110531113659299";

QList<QDomNode> brokenNodes;
QList< QPair< QgsVectorLayer*, QDomElement > > vectorLayerList;
@@ -1653,7 +1653,16 @@ bool QgsProject::createEmbeddedLayer( const QString& layerId, const QString& pro
QString id = mapLayerElem.firstChildElement("id").text();
if( id == layerId )
{
return addLayer( mapLayerElem, brokenNodes, vectorLayerList );
mEmbeddedLayers.insert( layerId, projectFilePath );
if( addLayer( mapLayerElem, brokenNodes, vectorLayerList ) )
{
return true;
}
else
{
mEmbeddedLayers.remove( layerId );
return false;
}
#if 0
QString type = mapLayerElem.attribute("type");
QgsMapLayer* layer = 0;
@@ -337,7 +337,8 @@ class CORE_EXPORT QgsProject : public QObject

QgsProjectBadLayerHandler* mBadLayerHandler;

/**Embeded layers which are defined in other projects. Key: layer id, value: project file path*/
/**Embeded layers which are defined in other projects. Key: layer id, value: project file path.
If the project file path is empty, QgsProject is going to ignore the layer for saving (e.g. because it is part and managed by an embedded group)*/
QHash< QString, QString > mEmbeddedLayers;

}; // QgsProject

0 comments on commit 733df17

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