Skip to content

Commit

Permalink
automatic indentation update (r9365-r9447)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9448 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 6, 2008
1 parent 23566c3 commit 7c0aa7c
Show file tree
Hide file tree
Showing 19 changed files with 199 additions and 199 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsoptions.cpp
Expand Up @@ -168,7 +168,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
mDefaultSnapModeComboBox->insertItem( 0, tr( "to vertex" ), "to vertex" );
mDefaultSnapModeComboBox->insertItem( 1, tr( "to segment" ), "to segment" );
mDefaultSnapModeComboBox->insertItem( 2, tr( "to vertex and segment" ), "to vertex and segment" );
QString defaultSnapString = settings.value( "/qgis/digitizing/default_snap_mode", "to vertex").toString();
QString defaultSnapString = settings.value( "/qgis/digitizing/default_snap_mode", "to vertex" ).toString();
mDefaultSnapModeComboBox->setCurrentIndex( mDefaultSnapModeComboBox->findData( defaultSnapString ) );
mDefaultSnappingToleranceSpinBox->setValue( settings.value( "/qgis/digitizing/default_snapping_tolerance", 0 ).toDouble() );
mSearchRadiusVertexEditSpinBox->setValue( settings.value( "/qgis/digitizing/search_radius_vertex_edit", 10 ).toDouble() );
Expand Down
8 changes: 4 additions & 4 deletions src/core/composer/qgslegendmodel.cpp
Expand Up @@ -434,10 +434,10 @@ QStandardItem* QgsLegendModel::itemFromSymbol( QgsSymbol* s )
label = s->label();

//Take the label as item text if it is there
if(!label.isEmpty())
{
itemText = label;
}
if ( !label.isEmpty() )
{
itemText = label;
}
//take single value
else if ( lowerValue == upperValue || upperValue.isEmpty() )
{
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -45,16 +45,16 @@ CUSTOM_CRS_VALIDATION QgsCoordinateReferenceSystem::mCustomSrsValidation = NULL;

QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem()
: mMapUnits( QGis::UNKNOWN ),
mIsValidFlag( 0 ),
mValidationHint ( 0 )
mIsValidFlag( 0 ),
mValidationHint( 0 )
{
mCRS = OSRNewSpatialReference( NULL );
}

QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem( QString theWkt )
: mMapUnits( QGis::UNKNOWN ),
mIsValidFlag( 0 ),
mValidationHint ( 0 )
mIsValidFlag( 0 ),
mValidationHint( 0 )
{
mCRS = OSRNewSpatialReference( NULL );
createFromWkt( theWkt );
Expand All @@ -63,8 +63,8 @@ QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem( QString theWkt )

QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem( const long theId, CRS_TYPE theType )
: mMapUnits( QGis::UNKNOWN ),
mIsValidFlag( 0 ),
mValidationHint ( 0 )
mIsValidFlag( 0 ),
mValidationHint( 0 )
{
mCRS = OSRNewSpatialReference( NULL );
createFromId( theId, theType );
Expand Down
22 changes: 11 additions & 11 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -536,14 +536,14 @@ QString QgsMapLayer::loadNamedStyle( const QString theURI, bool &theResultFlag )
}

QString errorMsg;
theResultFlag = readSymbology(myRoot, errorMsg);
if(!theResultFlag)
{
myErrorMessage = QObject::tr( "Loading style file " ) + theURI + QObject::tr(" failed because:") + "\n" + errorMsg;
return myErrorMessage;
}
theResultFlag = readSymbology( myRoot, errorMsg );
if ( !theResultFlag )
{
myErrorMessage = QObject::tr( "Loading style file " ) + theURI + QObject::tr( " failed because:" ) + "\n" + errorMsg;
return myErrorMessage;
}

return "";
return "";
}

QString QgsMapLayer::saveDefaultStyle( bool & theResultFlag )
Expand All @@ -565,10 +565,10 @@ QString QgsMapLayer::saveNamedStyle( const QString theURI, bool & theResultFlag
myDocument.appendChild( myRootNode );

QString errorMsg;
if(!writeSymbology(myRootNode, myDocument, errorMsg))
{
return QObject::tr("Could not save symbology because:") + "\n" + errorMsg;
}
if ( !writeSymbology( myRootNode, myDocument, errorMsg ) )
{
return QObject::tr( "Could not save symbology because:" ) + "\n" + errorMsg;
}

// check if the uri is a file or ends with .qml,
// which indicates that it should become one
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsmaplayer.h
Expand Up @@ -244,20 +244,20 @@ class CORE_EXPORT QgsMapLayer : public QObject
*/
virtual QString saveNamedStyle( const QString theURI, bool & theResultFlag );

/** Read the symbology for the current layer from the Dom node supplied.
/** Read the symbology for the current layer from the Dom node supplied.
* @param QDomNode node that will contain the symbology definition for this layer.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
*/
virtual bool readSymbology(const QDomNode& node, QString& errorMessage) = 0;
virtual bool readSymbology( const QDomNode& node, QString& errorMessage ) = 0;

/** Write the symbology for the layer into the docment provided.
* @param QDomNode the node that will have the style element added to it.
* @param QDomDocument the document that will have the QDomNode added.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
*/
virtual bool writeSymbology(QDomNode&, QDomDocument& doc, QString& errorMessage) const = 0;
virtual bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage ) const = 0;

public slots:

Expand Down
112 changes: 56 additions & 56 deletions src/core/qgsprojectfiletransform.cpp
Expand Up @@ -38,7 +38,7 @@ QgsProjectFileTransform::transform QgsProjectFileTransform::transformers[] =
{PFV( 0, 9, 1 ), PFV( 0, 10, 0 ), &QgsProjectFileTransform::transform091to0100},
{PFV( 0, 9, 2 ), PFV( 0, 10, 0 ), &QgsProjectFileTransform::transformNull},
{PFV( 0, 10, 0 ), PFV( 0, 11, 0 ), &QgsProjectFileTransform::transform0100to0110},
{PFV( 0, 11, 0 ), PFV( 1, 0, 0), &QgsProjectFileTransform::transform0110to1000}
{PFV( 0, 11, 0 ), PFV( 1, 0, 0 ), &QgsProjectFileTransform::transform0110to1000}
};

bool QgsProjectFileTransform::updateRevision( QgsProjectVersion newVersion )
Expand Down Expand Up @@ -287,62 +287,62 @@ void QgsProjectFileTransform::transform0110to1000()
{
if ( ! mDom.isNull() )
{
QDomNodeList layerList = mDom.elementsByTagName("maplayer");
for(int i = 0; i < layerList.size(); ++i)
QDomNodeList layerList = mDom.elementsByTagName( "maplayer" );
for ( int i = 0; i < layerList.size(); ++i )
{
QDomElement layerElem = layerList.at( i ).toElement();
QString typeString = layerElem.attribute( "type" );
if ( typeString != "vector" )
{
continue;
}

//datasource
QDomNode dataSourceNode = layerElem.namedItem( "datasource" );
if ( dataSourceNode.isNull() )
{
return;
}
QString dataSource = dataSourceNode.toElement().text();

//provider key
QDomNode providerNode = layerElem.namedItem( "provider" );
if ( providerNode.isNull() )
{
return;
}
QString providerKey = providerNode.toElement().text();

//create the layer to get the provider for int->fieldName conversion
QgsVectorLayer* theLayer = new QgsVectorLayer( dataSource, "", providerKey, false );
if ( !theLayer->isValid() )
{
QDomElement layerElem = layerList.at(i).toElement();
QString typeString = layerElem.attribute("type");
if(typeString != "vector")
{
continue;
}

//datasource
QDomNode dataSourceNode = layerElem.namedItem("datasource");
if(dataSourceNode.isNull())
{
return;
}
QString dataSource = dataSourceNode.toElement().text();

//provider key
QDomNode providerNode = layerElem.namedItem("provider");
if(providerNode.isNull())
{
return;
}
QString providerKey = providerNode.toElement().text();

//create the layer to get the provider for int->fieldName conversion
QgsVectorLayer* theLayer = new QgsVectorLayer(dataSource, "", providerKey, false);
if(!theLayer->isValid())
{
delete theLayer;
return;
}

QgsVectorDataProvider* theProvider = theLayer->dataProvider();
if(!theProvider)
{
return;
}
QgsFieldMap theFieldMap = theProvider->fields();

//read classificationfield
QDomNodeList classificationFieldList = layerElem.elementsByTagName("classificationfield");
for(int j = 0; j < classificationFieldList.size(); ++j)
{
QDomElement classificationFieldElem = classificationFieldList.at(j).toElement();
int fieldNumber = classificationFieldElem.text().toInt();
QgsFieldMap::const_iterator field_it = theFieldMap.find(fieldNumber);
if(field_it != theFieldMap.constEnd())
{
QDomText fieldName = mDom.createTextNode(field_it.value().name());
QDomNode nameNode = classificationFieldElem.firstChild();
classificationFieldElem.replaceChild(fieldName, nameNode);
}
}

delete theLayer;
return;
}

QgsVectorDataProvider* theProvider = theLayer->dataProvider();
if ( !theProvider )
{
return;
}
QgsFieldMap theFieldMap = theProvider->fields();

//read classificationfield
QDomNodeList classificationFieldList = layerElem.elementsByTagName( "classificationfield" );
for ( int j = 0; j < classificationFieldList.size(); ++j )
{
QDomElement classificationFieldElem = classificationFieldList.at( j ).toElement();
int fieldNumber = classificationFieldElem.text().toInt();
QgsFieldMap::const_iterator field_it = theFieldMap.find( fieldNumber );
if ( field_it != theFieldMap.constEnd() )
{
QDomText fieldName = mDom.createTextNode( field_it.value().name() );
QDomNode nameNode = classificationFieldElem.firstChild();
classificationFieldElem.replaceChild( fieldName, nameNode );
}
}

}
}
}
8 changes: 4 additions & 4 deletions src/core/qgsvectordataprovider.cpp
Expand Up @@ -238,10 +238,10 @@ QMap<QString, int> QgsVectorDataProvider::fieldNameMap() const

const QgsFieldMap& theFields = fields();
QgsFieldMap::const_iterator field_it = theFields.constBegin();
for(; field_it != theFields.constEnd(); ++field_it)
{
resultMap.insert(field_it.value().name(), field_it.key());
}
for ( ; field_it != theFields.constEnd(); ++field_it )
{
resultMap.insert( field_it.value().name(), field_it.key() );
}

return resultMap;
}
Expand Down
54 changes: 27 additions & 27 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -2085,10 +2085,10 @@ bool QgsVectorLayer::readXml( QDomNode & layer_node )
}

QString errorMsg;
if(!readSymbology(layer_node, errorMsg))
{
return false;
}
if ( !readSymbology( layer_node, errorMsg ) )
{
return false;
}

// Test if labeling is on or off
QDomNode labelnode = layer_node.namedItem( "label" );
Expand Down Expand Up @@ -2319,10 +2319,10 @@ bool QgsVectorLayer::writeXml( QDomNode & layer_node,
// renderer specific settings

QString errorMsg;
if(!writeSymbology( layer_node, document, errorMsg ))
{
return false;
}
if ( !writeSymbology( layer_node, document, errorMsg ) )
{
return false;
}

// Now we get to do all that all over again for QgsLabel

Expand Down Expand Up @@ -2396,7 +2396,7 @@ bool QgsVectorLayer::writeXml( QDomNode & layer_node,
return true;
} // bool QgsVectorLayer::writeXml

bool QgsVectorLayer::readSymbology(const QDomNode& node, QString& errorMessage)
bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage )
{
// create and bind a renderer to this layer

Expand Down Expand Up @@ -2428,34 +2428,34 @@ bool QgsVectorLayer::readSymbology(const QDomNode& node, QString& errorMessage)
renderer = new QgsUniqueValueRenderer( vectorType() );
returnCode = renderer->readXML( uniquevaluenode, *this );
}

if(!renderer)
{
return false;
}

if(returnCode == 1)
{
errorMessage = tr("No renderer object"); delete renderer; return false;
}
else if(returnCode == 2)
{
errorMessage = tr("Classification field not found"); delete renderer; return false;
}
if ( !renderer )
{
return false;
}

if ( returnCode == 1 )
{
errorMessage = tr( "No renderer object" ); delete renderer; return false;
}
else if ( returnCode == 2 )
{
errorMessage = tr( "Classification field not found" ); delete renderer; return false;
}

mRenderer = renderer;
return true;
}

bool QgsVectorLayer::writeSymbology(QDomNode& node, QDomDocument& doc, QString& errorMessage) const
bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const
{
const QgsRenderer * myRenderer = renderer();
if ( myRenderer )
{
if(!myRenderer->writeXML( node, doc, *this ))
{
return false;
}
if ( !myRenderer->writeXML( node, doc, *this ) )
{
return false;
}
}
else
{
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsvectorlayer.h
Expand Up @@ -173,20 +173,20 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
*/
virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );

/** Read the symbology for the current layer from the Dom node supplied.
* @param QDomNode node that will contain the symbology definition for this layer.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
/** Read the symbology for the current layer from the Dom node supplied.
* @param QDomNode node that will contain the symbology definition for this layer.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
*/
bool readSymbology(const QDomNode& node, QString& errorMessage);
bool readSymbology( const QDomNode& node, QString& errorMessage );

/** Write the symbology for the layer into the docment provided.
* @param QDomNode the node that will have the style element added to it.
* @param QDomDocument the document that will have the QDomNode added.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
*/
bool writeSymbology(QDomNode&, QDomDocument& doc, QString& errorMessage) const;
bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage ) const;


/**
Expand Down

0 comments on commit 7c0aa7c

Please sign in to comment.