Skip to content
Permalink
Browse files
indentation update
  • Loading branch information
jef-n committed May 29, 2015
1 parent 04388f7 commit dd53fda8466f7ab7ead47415b3bdf5571c579148
@@ -195,9 +195,9 @@ class QgsExpression
{
public:
Function( const QString& fnname, int params, const QString& group, const QString& helpText = QString(), bool usesGeometry = false, QStringList referencedColumns = QStringList(), bool lazyEval = false );

virtual ~Function();

/** The name of the function. */
QString name();
/** The number of parameters this function takes. */
@@ -93,7 +93,7 @@ QMap<QString, QVariant> QgisAppStyleSheet::defaultOptions()
settings.endGroup(); // "qgis/stylesheet"

opts.insert( "iconSize", settings.value( "/IconSize", QGIS_ICON_SIZE ) );

return opts;
}

@@ -181,18 +181,18 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant>& opts )
{
iconSize -= 16;
}
else if ( iconSize == 32 )
else if ( iconSize == 32 )
{
iconSize = 24;
}
else
{
iconSize = 16;
}

QgsDebugMsg( QString( "iconSize: %1" ).arg( iconSize ) );
ss += QString( "QDockWidget QToolButton { icon-size: %1px; }" ).arg( iconSize );

QgsDebugMsg( QString( "Stylesheet built: %1" ).arg( ss ) );

emit appStyleSheetChanged( ss );
@@ -161,7 +161,7 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib
void updateButtonStatus( QString fieldName, bool isValid );

/* replace the search widget with a new one */
void replaceSearchWidget(QWidget* oldw, QWidget* neww);
void replaceSearchWidget( QWidget* oldw, QWidget* neww );

signals:
/**
@@ -925,7 +925,7 @@ void QgsOptions::on_pbnTemplateFolderReset_pressed()
void QgsOptions::iconSizeChanged( const QString &iconSize )
{
QgisApp::instance()->setIconSizes( iconSize.toInt() );

mStyleSheetNewOpts.insert( "iconSize", QVariant( iconSize.toInt() ) );
mStyleSheetBuilder->buildStyleSheet( mStyleSheetNewOpts );
}
@@ -1530,7 +1530,7 @@ void QgsComposerMap::storeCurrentLayerSet()
}


void QgsComposerMap::setLayerStyleOverrides(const QMap<QString, QString>& overrides)
void QgsComposerMap::setLayerStyleOverrides( const QMap<QString, QString>& overrides )
{
if ( overrides == mLayerStyleOverrides )
return;
@@ -542,10 +542,10 @@ class CORE_EXPORT QgsExpression

virtual QStringList referencedColumns() const override { QStringList lst( mNode->referencedColumns() ); foreach ( Node* n, mList->list() ) lst.append( n->referencedColumns() ); return lst; }
virtual bool needsGeometry() const override { bool needs = false; foreach ( Node* n, mList->list() ) needs |= n->needsGeometry(); return needs; }
virtual void accept( Visitor& v ) const override { v.visit( *this ); }
virtual void accept( Visitor& v ) const override { v.visit( *this ); }

protected:
Node* mNode;
protected:
Node* mNode;
NodeList* mList;
bool mNotIn;
};
@@ -2185,7 +2185,7 @@ bool QgsVectorLayer::deleteAttributes( QList<int> attrs )

qSort( attrs.begin(), attrs.end(), qGreater<int>() );

Q_FOREACH( int attr, attrs )
Q_FOREACH ( int attr, attrs )
{
if ( deleteAttribute( attr ) )
{
@@ -2955,7 +2955,7 @@ void QgsVectorLayer::uniqueValues( int index, QList<QVariant> &uniqueValues, int
if ( mEditBuffer )
{
QSet<QString> vals;
Q_FOREACH( const QVariant& v, uniqueValues )
Q_FOREACH ( const QVariant& v, uniqueValues )
{
vals << v.toString();
}
@@ -3763,7 +3763,7 @@ void QgsVectorLayer::invalidateSymbolCountedFlag()

void QgsVectorLayer::onRelationsLoaded()
{
Q_FOREACH( QgsAttributeEditorElement* elem, mAttributeEditorElements )
Q_FOREACH ( QgsAttributeEditorElement* elem, mAttributeEditorElements )
{
if ( elem->type() == QgsAttributeEditorElement::AeTypeContainer )
{
@@ -3772,7 +3772,7 @@ void QgsVectorLayer::onRelationsLoaded()
continue;

QList<QgsAttributeEditorElement*> relations = cont->findElements( QgsAttributeEditorElement::AeTypeRelation );
Q_FOREACH( QgsAttributeEditorElement* relElem, relations )
Q_FOREACH ( QgsAttributeEditorElement* relElem, relations )
{
QgsAttributeEditorRelation* rel = dynamic_cast< QgsAttributeEditorRelation* >( relElem );
if ( !rel )
@@ -3841,7 +3841,7 @@ QDomElement QgsAttributeEditorContainer::toDomElement( QDomDocument& doc ) const
QDomElement elem = doc.createElement( "attributeEditorContainer" );
elem.setAttribute( "name", mName );

Q_FOREACH( QgsAttributeEditorElement* child, mChildren )
Q_FOREACH ( QgsAttributeEditorElement* child, mChildren )
{
elem.appendChild( child->toDomElement( doc ) );
}
@@ -3857,7 +3857,7 @@ QList<QgsAttributeEditorElement*> QgsAttributeEditorContainer::findElements( Qgs
{
QList<QgsAttributeEditorElement*> results;

Q_FOREACH( QgsAttributeEditorElement* elem, mChildren )
Q_FOREACH ( QgsAttributeEditorElement* elem, mChildren )
{
if ( elem->type() == type )
{
@@ -120,7 +120,7 @@ void QgsDualView::columnBoxInit()
// ... If there are primary key(s) defined
QStringList pkFields;

Q_FOREACH( int attr, pkAttrs )
Q_FOREACH ( int attr, pkAttrs )
{
pkFields.append( "COALESCE(\"" + fields[attr].name() + "\", '<NULL>')" );
}
@@ -151,7 +151,7 @@ void QgsDualView::columnBoxInit()
mFeatureListPreviewButton->addAction( mActionExpressionPreview );
mFeatureListPreviewButton->addAction( mActionPreviewColumnsMenu );

Q_FOREACH( const QgsField& field, fields )
Q_FOREACH ( const QgsField& field, fields )
{
int fieldIndex = mLayerCache->layer()->fieldNameIndex( field.name() );
if ( fieldIndex == -1 )
@@ -29,31 +29,33 @@ QgsDefaultSearchWidgetWrapper::QgsDefaultSearchWidgetWrapper( QgsVectorLayer* vl

QVariant QgsDefaultSearchWidgetWrapper::value()
{
return mLineEdit->text();
return mLineEdit->text();
}

QWidget* QgsDefaultSearchWidgetWrapper::createWidget( QWidget* parent )
{
return new QgsFilterLineEdit( parent );
return new QgsFilterLineEdit( parent );
}

void QgsDefaultSearchWidgetWrapper::initWidget( QWidget* widget )
{
mLineEdit = qobject_cast<QgsFilterLineEdit*>( widget );
mLineEdit->setSizePolicy(QSizePolicy ::Expanding , QSizePolicy ::Fixed );
connect( widget, SIGNAL( textChanged( QString ) ), this, SLOT( valueChanged( QString ) ) );
mLineEdit = qobject_cast<QgsFilterLineEdit*>( widget );
mLineEdit->setSizePolicy( QSizePolicy ::Expanding , QSizePolicy ::Fixed );
connect( widget, SIGNAL( textChanged( QString ) ), this, SLOT( valueChanged( QString ) ) );
}

void QgsDefaultSearchWidgetWrapper::setValue( const QVariant& value )
{
mLineEdit->setText( value.toString() ); //FIXME no null check :(
mLineEdit->setText( value.toString() ); //FIXME no null check :(
}

void QgsDefaultSearchWidgetWrapper::setEnabled( bool enabled )
{
mLineEdit->setReadOnly( !enabled );
//if ( enabled )
//mLineEdit->setPalette( mWritablePalette );
//else
//mLineEdit->setPalette( mReadOnlyPalette );
mLineEdit->setReadOnly( !enabled );
#if 0
if ( enabled )
mLineEdit->setPalette( mWritablePalette );
else
mLineEdit->setPalette( mReadOnlyPalette );
#endif
}
@@ -14,14 +14,14 @@
***************************************************************************/

#ifndef QGSDEFAULTSEARCHWIDGETWRAPPER_H
#define QGSDEFAULTSEARCHWIDGETWRAPPER_H
#define QGSDEFAULTSEARCHWIDGETWRAPPER_H

#include "qgseditorwidgetwrapper.h"
#include <qgsfilterlineedit.h>


/**
* Wraps a search widget. Default form is just a QgsLineFilterEdit
* Wraps a search widget. Default form is just a QgsLineFilterEdit
*
*/

@@ -34,7 +34,7 @@ QgsEditorWidgetFactory::~QgsEditorWidgetFactory()
*/
QgsEditorWidgetWrapper* QgsEditorWidgetFactory::createSearchWidget( QgsVectorLayer* vl, int fieldIdx, QWidget* parent ) const
{
return new QgsDefaultSearchWidgetWrapper(vl, fieldIdx, 0, parent);
return new QgsDefaultSearchWidgetWrapper( vl, fieldIdx, 0, parent );
}

QString QgsEditorWidgetFactory::name()
@@ -84,11 +84,11 @@ class GUI_EXPORT QgsEditorWidgetRegistry : public QObject
const QgsAttributeEditorContext& context = QgsAttributeEditorContext() );

QgsEditorWidgetWrapper* createSearchWidget( const QString& widgetId,
QgsVectorLayer* vl,
int fieldIdx,
const QgsEditorWidgetConfig& config,
QWidget* parent,
const QgsAttributeEditorContext& context = QgsAttributeEditorContext() );
QgsVectorLayer* vl,
int fieldIdx,
const QgsEditorWidgetConfig& config,
QWidget* parent,
const QgsAttributeEditorContext& context = QgsAttributeEditorContext() );

/**
* Creates a configuration widget
@@ -33,7 +33,7 @@ QgsEditorWidgetWrapper* QgsValueRelationWidgetFactory::create( QgsVectorLayer* v
return new QgsValueRelationWidgetWrapper( vl, fieldIdx, editor, parent );
}

QgsEditorWidgetWrapper *QgsValueRelationWidgetFactory::createSearchWidget(QgsVectorLayer *vl, int fieldIdx, QWidget *parent) const
QgsEditorWidgetWrapper *QgsValueRelationWidgetFactory::createSearchWidget( QgsVectorLayer *vl, int fieldIdx, QWidget *parent ) const
{
return new QgsValueRelationWidgetWrapper( vl, fieldIdx, 0, parent );
}
@@ -40,7 +40,7 @@ class ItemDelegate : public QItemDelegate
QSize sizeHint( const QStyleOptionViewItem& /*option*/, const QModelIndex & index ) const override
{
return mModel->item( index.row() )->icon().actualSize( QSize( 512, 512 ) );
}
}

private:
QStandardItemModel* mModel;
@@ -18,23 +18,23 @@
#include "qgsgrassoptions.h"
#include "ui_qgsgrassoptionsbase.h"

QgsGrassOptions::QgsGrassOptions(QWidget *parent)
: QDialog(parent)
, QgsGrassOptionsBase()
, mImportSettingsPath("/GRASS/browser/import")
QgsGrassOptions::QgsGrassOptions( QWidget *parent )
: QDialog( parent )
, QgsGrassOptionsBase()
, mImportSettingsPath( "/GRASS/browser/import" )
{
setupUi(this);
setupUi( this );

connect( this, SIGNAL( accepted() ), this, SLOT( saveOptions() ) );

QSettings settings;

QgsRasterProjector::Precision crsTransform = (QgsRasterProjector::Precision) settings.value( mImportSettingsPath + "/crsTransform", QgsRasterProjector::Approximate).toInt();
mCrsTransformationComboBox->addItem ( QgsRasterProjector::precisionLabel(QgsRasterProjector::Approximate), QgsRasterProjector::Approximate);
mCrsTransformationComboBox->addItem ( QgsRasterProjector::precisionLabel(QgsRasterProjector::Exact), QgsRasterProjector::Exact);
mCrsTransformationComboBox->setCurrentIndex ( mCrsTransformationComboBox->findData(crsTransform) );
QgsRasterProjector::Precision crsTransform = ( QgsRasterProjector::Precision ) settings.value( mImportSettingsPath + "/crsTransform", QgsRasterProjector::Approximate ).toInt();
mCrsTransformationComboBox->addItem( QgsRasterProjector::precisionLabel( QgsRasterProjector::Approximate ), QgsRasterProjector::Approximate );
mCrsTransformationComboBox->addItem( QgsRasterProjector::precisionLabel( QgsRasterProjector::Exact ), QgsRasterProjector::Exact );
mCrsTransformationComboBox->setCurrentIndex( mCrsTransformationComboBox->findData( crsTransform ) );

mImportExternalCheckBox->setChecked( settings.value(mImportSettingsPath + "/external", true).toBool() );
mImportExternalCheckBox->setChecked( settings.value( mImportSettingsPath + "/external", true ).toBool() );
}

QgsGrassOptions::~QgsGrassOptions()
@@ -46,7 +46,7 @@ void QgsGrassOptions::saveOptions()
QSettings settings;

settings.setValue( mImportSettingsPath + "/crsTransform",
mCrsTransformationComboBox->itemData( mCrsTransformationComboBox->currentIndex() ).toInt() );
mCrsTransformationComboBox->itemData( mCrsTransformationComboBox->currentIndex() ).toInt() );

settings.setValue( mImportSettingsPath + "/external", mImportExternalCheckBox->isChecked() );
}
@@ -22,10 +22,10 @@

class GRASS_LIB_EXPORT QgsGrassOptions : public QDialog, private Ui::QgsGrassOptionsBase
{
Q_OBJECT
Q_OBJECT

public:
explicit QgsGrassOptions(QWidget *parent = 0);
explicit QgsGrassOptions( QWidget *parent = 0 );
~QgsGrassOptions();

private slots:

0 comments on commit dd53fda

Please sign in to comment.