Skip to content
Permalink
Browse files
indentation update
  • Loading branch information
jef-n committed Dec 1, 2012
1 parent 4571b1d commit c254be1868c587c67d2aeacbf869b29d1e93663b
@@ -31,9 +31,9 @@ QgsMapToolSvgAnnotation::~QgsMapToolSvgAnnotation()

QgsAnnotationItem* QgsMapToolSvgAnnotation::createItem( QMouseEvent* e )
{
QgsSvgAnnotationItem* svgItem = new QgsSvgAnnotationItem( mCanvas );
svgItem->setMapPosition( toMapCoordinates( e->pos() ) );
svgItem->setSelected( true );
svgItem->setFrameSize( QSizeF( 200, 100 ) );
return svgItem;
QgsSvgAnnotationItem* svgItem = new QgsSvgAnnotationItem( mCanvas );
svgItem->setMapPosition( toMapCoordinates( e->pos() ) );
svgItem->setSelected( true );
svgItem->setFrameSize( QSizeF( 200, 100 ) );
return svgItem;
}
@@ -22,11 +22,11 @@

class QgsMapToolSvgAnnotation: public QgsMapToolAnnotation
{
public:
QgsMapToolSvgAnnotation( QgsMapCanvas* canvas );
~QgsMapToolSvgAnnotation();
protected:
QgsAnnotationItem* createItem( QMouseEvent* e );
public:
QgsMapToolSvgAnnotation( QgsMapCanvas* canvas );
~QgsMapToolSvgAnnotation();
protected:
QgsAnnotationItem* createItem( QMouseEvent* e );
};

#endif // QGSMAPTOOLSVGANNOTATION_H
@@ -26,20 +26,20 @@ class QgsAnnotationWidget;
class QgsSvgAnnotationDialog: public QDialog, private Ui::QgsFormAnnotationDialogBase
{
Q_OBJECT
public:
QgsSvgAnnotationDialog( QgsSvgAnnotationItem* item, QWidget * parent = 0, Qt::WindowFlags f = 0);
~QgsSvgAnnotationDialog();
public:
QgsSvgAnnotationDialog( QgsSvgAnnotationItem* item, QWidget * parent = 0, Qt::WindowFlags f = 0 );
~QgsSvgAnnotationDialog();

private slots:
void on_mBrowseToolButton_clicked();
void applySettingsToItem();
void deleteItem();
private slots:
void on_mBrowseToolButton_clicked();
void applySettingsToItem();
void deleteItem();

private:
QgsSvgAnnotationDialog(); //forbidden
private:
QgsSvgAnnotationDialog(); //forbidden

QgsSvgAnnotationItem* mItem;
QgsAnnotationWidget* mEmbeddedWidget;
QgsSvgAnnotationItem* mItem;
QgsAnnotationWidget* mEmbeddedWidget;
};

#endif // QGSSVGANNOTATIONDIALOG_H
@@ -329,7 +329,7 @@ static QgsExpression::Interval getInterval( const QVariant& value, QgsExpression

return QgsExpression::Interval::invalidInterVal();
}
static QgsGeometry getGeometry( const QVariant& value, QgsExpression* parent)
static QgsGeometry getGeometry( const QVariant& value, QgsExpression* parent )
{
if ( value.canConvert<QgsGeometry>() )
return value.value<QgsGeometry>();
@@ -775,7 +775,7 @@ static QVariant fcnGeometry( const QVariantList& , QgsFeature* f, QgsExpression*
}
static QVariant fcnGeomFromWKT( const QVariantList& values, QgsFeature*, QgsExpression* parent )
{
QString wkt = getStringValue( values.at( 0 ), parent );
QString wkt = getStringValue( values.at( 0 ), parent );
QgsGeometry* geom = QgsGeometry::fromWkt( wkt );
if ( geom )
return QVariant::fromValue( *geom );
@@ -786,7 +786,7 @@ static QVariant fcnGeomFromGML2( const QVariantList& values, QgsFeature*, QgsExp
{
QDomDocument doc;
QString errorMsg;
QString gml = getStringValue( values.at( 0 ), parent );
QString gml = getStringValue( values.at( 0 ), parent );
if ( !doc.setContent( gml, true, &errorMsg ) )
return QVariant();

@@ -879,7 +879,7 @@ static QVariant fcnBuffer( const QVariantList& values, QgsFeature*, QgsExpressio
return QVariant();

QgsGeometry fGeom = getGeometry( values.at( 0 ), parent );
double dist = getDoubleValue( values.at( 1 ), parent );
double dist = getDoubleValue( values.at( 1 ), parent );
int seg = 8;
if ( values.length() == 3 )
seg = getIntValue( values.at( 2 ), parent );
@@ -1033,7 +1033,7 @@ const QStringList &QgsExpression::BuiltinFunctions()
{
gmBuiltinFunctions << "sqrt"
<< "sqrt" << "cos" << "sin" << "tan"
<< "asin" << "acos" << "atan" << "atan2"
<< "asin" << "acos" << "atan" << "atan2"
<< "exp" << "ln" << "log10" << "log"
<< "round" << "toint" << "toreal" << "tostring"
<< "todatetime" << "todate" << "totime" << "tointerval"
@@ -2254,7 +2254,7 @@ void QgsExpression::NodeFunction::toOgcFilter( QDomDocument &doc, QDomElement &e
if ( fd->name() == ogcOperatorName.toLower() )
{
isSpatial = true;
QDomElement funcElem = doc.createElement( "ogc:"+ogcOperatorName );
QDomElement funcElem = doc.createElement( "ogc:" + ogcOperatorName );
QDomElement geomProperty = doc.createElement( "ogc:PropertyName" );
geomProperty.appendChild( doc.createTextNode( "geometry" ) );
funcElem.appendChild( geomProperty );
@@ -2279,14 +2279,14 @@ void QgsExpression::NodeFunction::toOgcFilter( QDomDocument &doc, QDomElement &e
{
QDomDocument geomDoc;
QString errorMsg;
QString gml = childElem.firstChildElement().text();
QString gml = childElem.firstChildElement().text();
if ( geomDoc.setContent( gml, true, &errorMsg ) )
funcElem.appendChild( doc.documentElement() );
}
}
childElem = childElem.nextSiblingElement();
}

element.appendChild( funcElem );
}
}
@@ -2329,7 +2329,7 @@ QgsExpression::Node* QgsExpression::NodeFunction::createFromOgcFilter( QDomEleme
opeIdx = j;
}

if (geomIdx == 0 || gml2Idx == 0 || opeIdx == 0 )
if ( geomIdx == 0 || gml2Idx == 0 || opeIdx == 0 )
{
errorMessage = QString( "spatial functions not find %1, got %2, %3, %4" ).arg( ogcOperatorName ).arg( geomIdx ).arg( gml2Idx ).arg( opeIdx );
return NULL;
@@ -2338,7 +2338,8 @@ QgsExpression::Node* QgsExpression::NodeFunction::createFromOgcFilter( QDomEleme
QgsExpression::NodeList *gml2Args = new QgsExpression::NodeList();
QDomElement childElem = element.firstChildElement();
QString gml2Str = "";
while ( !childElem.isNull() && gml2Str == "" ) {
while ( !childElem.isNull() && gml2Str == "" )
{
if ( childElem.tagName() != "PropertyName" )
{
QTextStream gml2Stream( &gml2Str );
@@ -227,61 +227,61 @@ class CORE_EXPORT QgsExpression
class CORE_EXPORT Function
{
public:
Function( QString fnname, int params, QString group, QString helpText = QString(), bool usesGeometry = false )
: mName( fnname ), mParams( params ), mUsesGeometry( usesGeometry ), mGroup( group ), mHelpText( helpText ) {}
/** The name of the function. */
QString name() { return mName; }
/** The number of parameters this function takes. */
int params() { return mParams; }
/** Does this function use a geometry object. */
bool usesgeometry() { return mUsesGeometry; }
/** The group the function belongs to. */
QString group() { return mGroup; }
/** The help text for the function. */
QString helptext() { return mHelpText; }

virtual QVariant func(const QVariantList& values, QgsFeature* f, QgsExpression* parent) = 0;

bool operator==(const Function& other) const
{
if ( QString::compare( mName, other.mName, Qt::CaseInsensitive ) == 0 )
return true;

return false;
}

private:
QString mName;
int mParams;
bool mUsesGeometry;
QString mGroup;
QString mHelpText;
Function( QString fnname, int params, QString group, QString helpText = QString(), bool usesGeometry = false )
: mName( fnname ), mParams( params ), mUsesGeometry( usesGeometry ), mGroup( group ), mHelpText( helpText ) {}
/** The name of the function. */
QString name() { return mName; }
/** The number of parameters this function takes. */
int params() { return mParams; }
/** Does this function use a geometry object. */
bool usesgeometry() { return mUsesGeometry; }
/** The group the function belongs to. */
QString group() { return mGroup; }
/** The help text for the function. */
QString helptext() { return mHelpText; }

virtual QVariant func( const QVariantList& values, QgsFeature* f, QgsExpression* parent ) = 0;

bool operator==( const Function& other ) const
{
if ( QString::compare( mName, other.mName, Qt::CaseInsensitive ) == 0 )
return true;

return false;
}

private:
QString mName;
int mParams;
bool mUsesGeometry;
QString mGroup;
QString mHelpText;
};

class StaticFunction : public Function
{
public:
StaticFunction( QString fnname, int params, FcnEval fcn, QString group, QString helpText = QString(), bool usesGeometry = false )
: Function( fnname, params, group, helpText, usesGeometry), mFnc( fcn ) {}
: Function( fnname, params, group, helpText, usesGeometry ), mFnc( fcn ) {}

virtual QVariant func(const QVariantList& values, QgsFeature* f, QgsExpression* parent)
{
return mFnc(values,f, parent);
}
virtual QVariant func( const QVariantList& values, QgsFeature* f, QgsExpression* parent )
{
return mFnc( values, f, parent );
}

private:
FcnEval mFnc;
};

const static QList<Function*> &Functions();
static QList<Function*> gmFunctions;

static QStringList gmBuiltinFunctions;
const static QStringList &BuiltinFunctions();

static bool registerFunction(Function* function);
static bool unregisterFunction(QString name);
static bool registerFunction( Function* function );
static bool unregisterFunction( QString name );

// tells whether the identifier is a name of existing function
static bool isFunctionName( QString name );

@@ -2985,7 +2985,7 @@ double QgsGeometry::closestVertexWithContext( const QgsPoint& point, int& atVert

if ( !mGeos )
{
return -1;
return -1;
}

const GEOSGeometry *g = GEOSGetExteriorRing( mGeos );
@@ -3290,7 +3290,7 @@ int QgsGeometry::addRing( const QList<QgsPoint>& ring )

if ( !mGeos )
{
return 6;
return 6;
}

int type = GEOSGeomTypeId( mGeos );
@@ -70,19 +70,19 @@ class CORE_EXPORT QgsVectorFileWriter

/** Write contents of vector layer to an (OGR supported) vector formt
@note: this method was added in version 1.5
@param layer layer to write
@param fileName file name to write to
@param fileEncoding encoding to use
@param destCRS pointer to CRS to reproject exported geometries to
@param driverName OGR driver to use
@param onlySelected write only selected features of layer
@param errorMessage pointer to buffer fo error message
@param datasourceOptions list of OGR data source creation options
@param layerOptions list of OGR layer creation options
@param skipAttributeCreation only write geometries
@param newFilename QString pointer which will contain the new file name created
(in case it is different to fileName).
*/
@param layer layer to write
@param fileName file name to write to
@param fileEncoding encoding to use
@param destCRS pointer to CRS to reproject exported geometries to
@param driverName OGR driver to use
@param onlySelected write only selected features of layer
@param errorMessage pointer to buffer fo error message
@param datasourceOptions list of OGR data source creation options
@param layerOptions list of OGR layer creation options
@param skipAttributeCreation only write geometries
@param newFilename QString pointer which will contain the new file name created
(in case it is different to fileName).
*/
static WriterError writeAsVectorFormat( QgsVectorLayer* layer,
const QString& fileName,
const QString& fileEncoding,
@@ -508,7 +508,7 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
QMap<int, QWidget*>::const_iterator it = proxyWidgets.find( idx );
if ( it != proxyWidgets.end() )
{
QObject* obj = qvariant_cast<QObject*>( (*it)->property( "QgisAttrEditProxy" ) );
QObject* obj = qvariant_cast<QObject*>(( *it )->property( "QgisAttrEditProxy" ) );
relay = qobject_cast<QgsStringRelay*>( obj );
}
else
@@ -82,21 +82,21 @@ class GUI_EXPORT QgsAttributeEditor : public QObject

class QgsStringRelay : public QObject
{
Q_OBJECT
Q_OBJECT

public:
public:

QgsStringRelay( QObject* parent = NULL )
: QObject( parent ) {}
QgsStringRelay( QObject* parent = NULL )
: QObject( parent ) {}

public slots:
void changeText( QString str )
{
emit textChanged( str );
}
public slots:
void changeText( QString str )
{
emit textChanged( str );
}

signals:
void textChanged( QString );
signals:
void textChanged( QString );
};

#endif
@@ -19,7 +19,7 @@


QgsCharacterSelectorDialog::QgsCharacterSelectorDialog( QWidget *parent, Qt::WFlags fl )
: QDialog( parent, fl ), mChar( QChar::Null )
: QDialog( parent, fl ), mChar( QChar::Null )
{
setupUi( this );
mCharWidget = new CharacterWidget( this );

0 comments on commit c254be1

Please sign in to comment.