Skip to content
Permalink
Browse files

refresh field names after all layers loaded and encoding change (fix #…

  • Loading branch information
minorua committed Mar 27, 2013
1 parent 3959f94 commit ab55325083e1c8944b8c0808d5c9b4599634ba4c
Showing with 8 additions and 6 deletions.
  1. +1 −1 src/app/qgsvectorlayerproperties.cpp
  2. +1 −0 src/core/qgsproject.cpp
  3. +2 −1 src/core/qgsvectorlayer.cpp
  4. +4 −4 src/core/qgsvectorlayer.h
@@ -451,7 +451,7 @@ void QgsVectorLayerProperties::apply()
{
if ( layer->dataProvider()->capabilities() & QgsVectorDataProvider::SetEncoding )
{
layer->dataProvider()->setEncoding( cboProviderEncoding->currentText() );
layer->setProviderEncoding( cboProviderEncoding->currentText() );
}
}

@@ -707,6 +707,7 @@ QPair< bool, QList<QDomNode> > QgsProject::_getMapLayers( QDomDocument const &do
for ( ; vIt != vLayerList.end(); ++vIt )
{
vIt->first->createJoinCaches();
vIt->first->updateFields();
//for old symbology, it is necessary to read the symbology again after having the complete field map
if ( !vIt->first->isUsingRendererV2() )
{
@@ -1321,6 +1321,7 @@ void QgsVectorLayer::setProviderEncoding( const QString& encoding )
if ( mDataProvider )
{
mDataProvider->setEncoding( encoding );
updateFields();
}
}

@@ -3816,7 +3817,7 @@ void QgsVectorLayer::updateFields()
mEditBuffer->updateFields( mUpdatedFields );

// joined fields
if ( mJoinBuffer->containsJoins() )
if ( mJoinBuffer && mJoinBuffer->containsJoins() )
mJoinBuffer->updateFields( mUpdatedFields );
}

@@ -813,6 +813,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
@note public and static from version 1.4 */
static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );

/** Assembles mUpdatedFields considering provider fields, joined fields and added fields
@note added in 1.7 */
void updateFields();

/** Caches joined attributes if required (and not already done)
@note added in 1.7 */
void createJoinCaches();
@@ -955,10 +959,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
/** Stop version 2 renderer and selected renderer (if required) */
void stopRendererV2( QgsRenderContext& rendererContext, QgsSingleSymbolRendererV2* selRenderer );

/** Assembles mUpdatedFields considering provider fields, joined fields and added fields
@note added in 1.7 */
void updateFields();

/**Registers label and diagram layer
@param rendererContext render context
@param attributes attributes needed for labeling and diagrams will be added to the list

0 comments on commit ab55325

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