6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgssymbollayerv2registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ QgsSymbolLayerV2Registry::QgsSymbolLayerV2Registry()
QgsSvgMarkerSymbolLayerV2::create ) );
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "FontMarker", QObject::tr( "Font marker" ), QgsSymbolV2::Marker,
QgsFontMarkerSymbolLayerV2::create ) );
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "EllipseMarker", QObject::tr("Ellipse marker"), QgsSymbolV2::Marker,
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "EllipseMarker", QObject::tr( "Ellipse marker" ), QgsSymbolV2::Marker,
QgsEllipseSymbolLayerV2::create ) );

addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleFill", QObject::tr( "Simple fill" ), QgsSymbolV2::Fill,
Expand All @@ -33,9 +33,9 @@ QgsSymbolLayerV2Registry::QgsSymbolLayerV2Registry()
QgsSVGFillSymbolLayer::create ) );
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "CentroidFill", QObject::tr( "Centroid fill" ), QgsSymbolV2::Fill,
QgsCentroidFillSymbolLayerV2::create ) );
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "LinePatternFill", QObject::tr("Line pattern fill"), QgsSymbolV2::Fill,
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "LinePatternFill", QObject::tr( "Line pattern fill" ), QgsSymbolV2::Fill,
QgsLinePatternFillSymbolLayer::create ) );
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "PointPatternFill", QObject::tr("Point pattern fill"), QgsSymbolV2::Fill,
addSymbolLayerType( new QgsSymbolLayerV2Metadata( "PointPatternFill", QObject::tr( "Point pattern fill" ), QgsSymbolV2::Fill,
QgsPointPatternFillSymbolLayer::create ) );
}

Expand Down
48 changes: 24 additions & 24 deletions src/core/symbology-ng/qgssymbollayerv2utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,39 +768,39 @@ void QgsSymbolLayerV2Utils::multiplyImageOpacity( QImage* image, qreal alpha )

static bool _QVariantLessThan( const QVariant& lhs, const QVariant& rhs )
{
switch( lhs.type() )
{
case QVariant::Int:
return lhs.toInt() < rhs.toInt();
case QVariant::UInt:
return lhs.toUInt() < rhs.toUInt();
case QVariant::LongLong:
return lhs.toLongLong() < rhs.toLongLong();
case QVariant::ULongLong:
return lhs.toULongLong() < rhs.toULongLong();
case QVariant::Double:
return lhs.toDouble() < rhs.toDouble();
case QVariant::Char:
return lhs.toChar() < rhs.toChar();
case QVariant::Date:
return lhs.toDate() < rhs.toDate();
case QVariant::Time:
return lhs.toTime() < rhs.toTime();
case QVariant::DateTime:
return lhs.toDateTime() < rhs.toDateTime();
default:
return QString::localeAwareCompare( lhs.toString(), rhs.toString() ) < 0;
switch ( lhs.type() )
{
case QVariant::Int:
return lhs.toInt() < rhs.toInt();
case QVariant::UInt:
return lhs.toUInt() < rhs.toUInt();
case QVariant::LongLong:
return lhs.toLongLong() < rhs.toLongLong();
case QVariant::ULongLong:
return lhs.toULongLong() < rhs.toULongLong();
case QVariant::Double:
return lhs.toDouble() < rhs.toDouble();
case QVariant::Char:
return lhs.toChar() < rhs.toChar();
case QVariant::Date:
return lhs.toDate() < rhs.toDate();
case QVariant::Time:
return lhs.toTime() < rhs.toTime();
case QVariant::DateTime:
return lhs.toDateTime() < rhs.toDateTime();
default:
return QString::localeAwareCompare( lhs.toString(), rhs.toString() ) < 0;
}
}

static bool _QVariantGreaterThan( const QVariant& lhs, const QVariant& rhs )
{
return ! _QVariantLessThan( lhs, rhs);
return ! _QVariantLessThan( lhs, rhs );
}

void QgsSymbolLayerV2Utils::sortVariantList( QList<QVariant>& list, Qt::SortOrder order )
{
if (order == Qt::AscendingOrder)
if ( order == Qt::AscendingOrder )
{
qSort( list.begin(), list.end(), _QVariantLessThan );
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgssymbolv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,11 @@ QSet<QString> QgsSymbolV2::usedAttributes() const
{
QSet<QString> attributes;
QgsSymbolLayerV2List::const_iterator sIt = mLayers.constBegin();
for(; sIt != mLayers.constEnd(); ++sIt )
for ( ; sIt != mLayers.constEnd(); ++sIt )
{
if( *sIt )
if ( *sIt )
{
attributes.unite( (*sIt)->usedAttributes() );
attributes.unite(( *sIt )->usedAttributes() );
}
}
return attributes;
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgssymbolv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class CORE_EXPORT QgsSymbolV2RenderContext
//! @note added in 1.5
void setRenderHints( int hints ) { mRenderHints = hints; }

void setFeature( const QgsFeature* f ){ mFeature = f; }
void setFeature( const QgsFeature* f ) { mFeature = f; }
const QgsFeature* feature() const { return mFeature; }

// Color used for selections
Expand Down
1 change: 0 additions & 1 deletion src/gui/qgsquerybuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class GUI_EXPORT QgsQueryBuilder : public QDialog, private Ui::QgsQueryBuilderBa
* The number of rows that would be returned is displayed in a message box.
* The test uses a "select count(*) from ..." query to test the SQL
* statement.
* @param showResults If true, the results are displayed in a QMessageBox
*/
void test();
/*!
Expand Down
70 changes: 35 additions & 35 deletions src/gui/symbology-ng/qgsellipsesymbollayerv2widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ QgsEllipseSymbolLayerV2Widget::QgsEllipseSymbolLayerV2Widget( const QgsVectorLay
QSize iconSize = mShapeListWidget->iconSize();

QStringList::const_iterator nameIt = names.constBegin();
for(; nameIt != names.constEnd(); ++nameIt )
for ( ; nameIt != names.constEnd(); ++nameIt )
{
QgsEllipseSymbolLayerV2* lyr = new QgsEllipseSymbolLayerV2();
lyr->setSymbolName( *nameIt );
lyr->setOutlineColor( QColor( 0, 0, 0 ) );
lyr->setFillColor( QColor( 200, 200, 200 ) );
lyr->setSymbolWidth(4);
lyr->setSymbolHeight(2);
lyr->setSymbolWidth( 4 );
lyr->setSymbolHeight( 2 );
QIcon icon = QgsSymbolLayerV2Utils::symbolLayerPreviewIcon( lyr, QgsSymbolV2::MM, iconSize );
QListWidgetItem* item = new QListWidgetItem( icon, "", mShapeListWidget );
item->setToolTip( *nameIt );
Expand All @@ -34,7 +34,7 @@ QgsEllipseSymbolLayerV2Widget::QgsEllipseSymbolLayerV2Widget( const QgsVectorLay

void QgsEllipseSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
{
if( layer->layerType() != "EllipseMarker" )
if ( layer->layerType() != "EllipseMarker" )
{
return;
}
Expand All @@ -46,40 +46,40 @@ void QgsEllipseSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
mOutlineWidthSpinBox->setValue( mLayer->outlineWidth() );

QList<QListWidgetItem *> symbolItemList = mShapeListWidget->findItems( mLayer->symbolName(), Qt::MatchExactly );
if( symbolItemList.size() > 0 )
if ( symbolItemList.size() > 0 )
{
mShapeListWidget->setCurrentItem( symbolItemList.at( 0 ) );
}

//set combo entries to current values
blockComboSignals( true );
if( mLayer )
if ( mLayer )
{
if( mLayer->widthField().first != -1 )
if ( mLayer->widthField().first != -1 )
{
mDDSymbolWidthComboBox->setCurrentIndex( mDDSymbolWidthComboBox->findText( mLayer->widthField().second ) );
}
if( mLayer->heightField().first != -1 )
if ( mLayer->heightField().first != -1 )
{
mDDSymbolHeightComboBox->setCurrentIndex( mDDSymbolHeightComboBox->findText( mLayer->heightField().second ) );
}
if( mLayer->rotationField().first != -1 )
if ( mLayer->rotationField().first != -1 )
{
mDDRotationComboBox->setCurrentIndex( mDDRotationComboBox->findText( mLayer->rotationField().second ) );
}
if( mLayer->outlineWidthField().first != -1 )
if ( mLayer->outlineWidthField().first != -1 )
{
mDDOutlineWidthComboBox->setCurrentIndex( mDDOutlineWidthComboBox->findText( mLayer->outlineWidthField().second ) );
}
if( mLayer->fillColorField().first != -1 )
if ( mLayer->fillColorField().first != -1 )
{
mDDFillColorComboBox->setCurrentIndex( mDDFillColorComboBox->findText( mLayer->fillColorField().second ) );
}
if( mLayer->outlineColorField().first != -1 )
if ( mLayer->outlineColorField().first != -1 )
{
mDDOutlineColorComboBox->setCurrentIndex( mDDOutlineColorComboBox->findText( mLayer->outlineColorField().second ) );
}
if( mLayer->symbolNameField().first != -1 )
if ( mLayer->symbolNameField().first != -1 )
{
mDDShapeComboBox->setCurrentIndex( mDDShapeComboBox->findText( mLayer->symbolNameField().second ) );
}
Expand All @@ -94,10 +94,10 @@ QgsSymbolLayerV2* QgsEllipseSymbolLayerV2Widget::symbolLayer()

void QgsEllipseSymbolLayerV2Widget::on_mShapeListWidget_itemSelectionChanged()
{
if( mLayer )
if ( mLayer )
{
QListWidgetItem* item = mShapeListWidget->currentItem();
if( item )
if ( item )
{
mLayer->setSymbolName( item->data( Qt::UserRole ).toString() );
emit changed();
Expand All @@ -107,7 +107,7 @@ void QgsEllipseSymbolLayerV2Widget::on_mShapeListWidget_itemSelectionChanged()

void QgsEllipseSymbolLayerV2Widget::on_mWidthSpinBox_valueChanged( double d )
{
if( mLayer )
if ( mLayer )
{
mLayer->setSymbolWidth( d );
emit changed();
Expand All @@ -116,7 +116,7 @@ void QgsEllipseSymbolLayerV2Widget::on_mWidthSpinBox_valueChanged( double d )

void QgsEllipseSymbolLayerV2Widget::on_mHeightSpinBox_valueChanged( double d )
{
if( mLayer )
if ( mLayer )
{
mLayer->setSymbolHeight( d );
emit changed();
Expand All @@ -125,7 +125,7 @@ void QgsEllipseSymbolLayerV2Widget::on_mHeightSpinBox_valueChanged( double d )

void QgsEllipseSymbolLayerV2Widget::on_mRotationSpinBox_valueChanged( double d )
{
if( mLayer )
if ( mLayer )
{
mLayer->setAngle( d );
emit changed();
Expand All @@ -134,7 +134,7 @@ void QgsEllipseSymbolLayerV2Widget::on_mRotationSpinBox_valueChanged( double d )

void QgsEllipseSymbolLayerV2Widget::on_mOutlineWidthSpinBox_valueChanged( double d )
{
if( mLayer )
if ( mLayer )
{
mLayer->setOutlineWidth( d );
emit changed();
Expand All @@ -143,10 +143,10 @@ void QgsEllipseSymbolLayerV2Widget::on_mOutlineWidthSpinBox_valueChanged( double

void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorBorder_clicked()
{
if( mLayer )
if ( mLayer )
{
QColor newColor = QColorDialog::getColor( mLayer->outlineColor() );
if( newColor.isValid() )
if ( newColor.isValid() )
{
mLayer->setOutlineColor( newColor );
emit changed();
Expand All @@ -156,10 +156,10 @@ void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorBorder_clicked()

void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorFill_clicked()
{
if( mLayer )
if ( mLayer )
{
QColor newColor = QColorDialog::getColor( mLayer->fillColor() );
if( newColor.isValid() )
if ( newColor.isValid() )
{
mLayer->setFillColor( newColor );
emit changed();
Expand All @@ -184,11 +184,11 @@ void QgsEllipseSymbolLayerV2Widget::fillDataDefinedComboBoxes()
mDDShapeComboBox->clear();
mDDShapeComboBox->addItem( "", -1 );

if( mVectorLayer )
if ( mVectorLayer )
{
const QgsFieldMap& fm =mVectorLayer->pendingFields();
const QgsFieldMap& fm = mVectorLayer->pendingFields();
QgsFieldMap::const_iterator fieldIt = fm.constBegin();
for(; fieldIt != fm.constEnd(); ++fieldIt )
for ( ; fieldIt != fm.constEnd(); ++fieldIt )
{
QString fieldName = fieldIt.value().name();
int index = fieldIt.key();
Expand All @@ -206,7 +206,7 @@ void QgsEllipseSymbolLayerV2Widget::fillDataDefinedComboBoxes()

void QgsEllipseSymbolLayerV2Widget::on_mDDSymbolWidthComboBox_currentIndexChanged( int idx )
{
if( mLayer )
if ( mLayer )
{
mLayer->setWidthField( mDDSymbolWidthComboBox->itemData( idx ).toInt(), mDDSymbolWidthComboBox->itemText( idx ) );
emit changed();
Expand All @@ -215,16 +215,16 @@ void QgsEllipseSymbolLayerV2Widget::on_mDDSymbolWidthComboBox_currentIndexChange

void QgsEllipseSymbolLayerV2Widget::on_mDDSymbolHeightComboBox_currentIndexChanged( int idx )
{
if( mLayer )
if ( mLayer )
{
mLayer->setHeightField( mDDSymbolHeightComboBox->itemData( idx ).toInt(), mDDSymbolHeightComboBox->itemText( idx ));
mLayer->setHeightField( mDDSymbolHeightComboBox->itemData( idx ).toInt(), mDDSymbolHeightComboBox->itemText( idx ) );
emit changed();
}
}

void QgsEllipseSymbolLayerV2Widget::on_mDDRotationComboBox_currentIndexChanged( int idx )
{
if( mLayer )
if ( mLayer )
{
mLayer->setRotationField( mDDRotationComboBox->itemData( idx ).toInt(), mDDRotationComboBox->itemText( idx ) );
emit changed();
Expand All @@ -233,7 +233,7 @@ void QgsEllipseSymbolLayerV2Widget::on_mDDRotationComboBox_currentIndexChanged(

void QgsEllipseSymbolLayerV2Widget::on_mDDOutlineWidthComboBox_currentIndexChanged( int idx )
{
if( mLayer )
if ( mLayer )
{
mLayer->setOutlineWidthField( mDDOutlineWidthComboBox->itemData( idx ).toInt(), mDDOutlineWidthComboBox->itemText( idx ) );
emit changed();
Expand All @@ -242,7 +242,7 @@ void QgsEllipseSymbolLayerV2Widget::on_mDDOutlineWidthComboBox_currentIndexChang

void QgsEllipseSymbolLayerV2Widget::on_mDDFillColorComboBox_currentIndexChanged( int idx )
{
if( mLayer )
if ( mLayer )
{
mLayer->setFillColorField( mDDFillColorComboBox->itemData( idx ).toInt(), mDDFillColorComboBox->itemText( idx ) );
emit changed();
Expand All @@ -251,7 +251,7 @@ void QgsEllipseSymbolLayerV2Widget::on_mDDFillColorComboBox_currentIndexChanged(

void QgsEllipseSymbolLayerV2Widget::on_mDDOutlineColorComboBox_currentIndexChanged( int idx )
{
if( mLayer )
if ( mLayer )
{
mLayer->setOutlineColorField( mDDOutlineColorComboBox->itemData( idx ).toInt(), mDDOutlineColorComboBox->itemText( idx ) );
emit changed();
Expand All @@ -260,7 +260,7 @@ void QgsEllipseSymbolLayerV2Widget::on_mDDOutlineColorComboBox_currentIndexChang

void QgsEllipseSymbolLayerV2Widget::on_mDDShapeComboBox_currentIndexChanged( int idx )
{
if( mLayer )
if ( mLayer )
{
mLayer->setSymbolNameField( mDDShapeComboBox->itemData( idx ).toInt(), mDDShapeComboBox->itemText( idx ) );
}
Expand All @@ -273,6 +273,6 @@ void QgsEllipseSymbolLayerV2Widget::blockComboSignals( bool block )
mDDRotationComboBox->blockSignals( block );
mDDOutlineWidthComboBox->blockSignals( block );
mDDFillColorComboBox->blockSignals( block );
mDDOutlineColorComboBox->blockSignals( block);
mDDOutlineColorComboBox->blockSignals( block );
mDDShapeComboBox->blockSignals( block );
}
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgsellipsesymbollayerv2widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class QgsEllipseSymbolLayerV2;

class GUI_EXPORT QgsEllipseSymbolLayerV2Widget: public QgsSymbolLayerV2Widget, private Ui::WidgetEllipseBase
{
Q_OBJECT
Q_OBJECT

public:
QgsEllipseSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = 0 );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void QgsRendererV2PropertiesDialog::showSymbolLevels()

if ( r->type() == "RuleRenderer" )
{
if( dlg.usingLevels() )
if ( dlg.usingLevels() )
{
r->setUsingFirstRule( true );
emit forceChkUsingFirstRule();
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/grass/qgsgrassbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ void QgsGrassBrowser::deleteMap()
for ( int i = 0; i < layers.count(); i++ )
{
QString uri = gisbase + "/" + location + "/"
+ mapset + "/" + map + "/" + layers[i];
+ mapset + "/" + map + "/" + layers[i];

foreach( QgsMapLayer *layer, mIface->legendInterface()->layers() )
{
Expand All @@ -415,13 +415,13 @@ void QgsGrassBrowser::deleteMap()
// the layer is loaded in canvas,
// freeze it! (this allow to delete it from the mapset)
QgsGrassProvider * grassProvider =
qobject_cast<QgsGrassProvider *>( vl->dataProvider() );
qobject_cast<QgsGrassProvider *>( vl->dataProvider() );
if ( grassProvider )
grassProvider->freeze();
#else
QMessageBox::information( this, tr( "Information" ),
tr( "Remove the selected layer(s) from QGis canvas before continue." ) );
return;
QMessageBox::information( this, tr( "Information" ),
tr( "Remove the selected layer(s) from QGis canvas before continue." ) );
return;
#endif
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ void QgsGdalProvider::registerGdalDrivers()
QString myJoinedList = mySettings.value( "gdal/skipList", "" ).toString();
if ( !myJoinedList.isEmpty() )
{
QStringList myList = myJoinedList.split(" ");
QStringList myList = myJoinedList.split( " " );
for ( int i = 0; i < myList.size(); ++i )
{
QgsApplication::skipGdalDriver( myList.at( i ) );
Expand Down
28 changes: 14 additions & 14 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ bool QgsOgrProvider::convertField( QgsField &field, const QTextCodec &encoding )


QgsVectorLayerImport::ImportError QgsOgrProvider::createEmptyLayer(
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage,
const QMap<QString,QVariant> *options )
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage,
const QMap<QString, QVariant> *options )
{
QString encoding;
QString driverName = "ESRI Shapefile";
Expand Down Expand Up @@ -170,8 +170,8 @@ QgsVectorLayerImport::ImportError QgsOgrProvider::createEmptyLayer(
}

QgsVectorFileWriter *writer = new QgsVectorFileWriter(
uri, encoding, fields, wkbType,
srs, driverName, dsOptions, layerOptions );
uri, encoding, fields, wkbType,
srs, driverName, dsOptions, layerOptions );

QgsVectorFileWriter::WriterError error = writer->hasError();
if ( error )
Expand Down Expand Up @@ -2491,10 +2491,10 @@ QGISEXTERN QgsVectorLayerImport::ImportError createEmptyLayer(
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage,
const QMap<QString,QVariant> *options )
const QMap<QString, QVariant> *options )
{
return QgsOgrProvider::createEmptyLayer(
uri, fields, wkbType, srs, overwrite,
oldToNewAttrIdxMap, errorMessage, options
);
uri, fields, wkbType, srs, overwrite,
oldToNewAttrIdxMap, errorMessage, options
);
}
18 changes: 9 additions & 9 deletions src/providers/ogr/qgsogrprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ class QgsOgrProvider : public QgsVectorDataProvider

/** convert a vector layer to a vector file */
static QgsVectorLayerImport::ImportError createEmptyLayer(
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage = 0,
const QMap<QString,QVariant> *options = 0
);
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage = 0,
const QMap<QString, QVariant> *options = 0
);

/**
* Constructor of the vector provider
Expand Down
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspgsourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void QgsPgSourceSelect::on_btnConnect_clicked()
if ( pgProvider->supportedLayers( layers, searchGeometryColumnsOnly, searchPublicOnly, allowGeometrylessTables ) )
{
// Add the supported layers to the table
foreach ( QgsPostgresLayerProperty layer, layers)
foreach( QgsPostgresLayerProperty layer, layers )
{
QString type = layer.type;
if ( !searchGeometryColumnsOnly && layer.geometryColName != QString::null )
Expand All @@ -468,7 +468,7 @@ void QgsPgSourceSelect::on_btnConnect_clicked()
type = tr( "Waiting" );
}
}
QgsDebugMsg( QString( "adding table %1.%2" ).arg(layer.schemaName).arg(layer.tableName) );
QgsDebugMsg( QString( "adding table %1.%2" ).arg( layer.schemaName ).arg( layer.tableName ) );
mTableModel.addTableEntry( type, layer.schemaName, layer.tableName, layer.geometryColName, layer.pkCols, layer.sql );
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspgsourceselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase

signals:
void addDatabaseLayers( QStringList const & layerPathList,
QString const & providerKey );
QString const & providerKey );
void connectionsChanged();

public slots:
Expand Down
60 changes: 30 additions & 30 deletions src/providers/postgres/qgspostgresprovider.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bool QgsPostgresProvider::convertField( QgsField &field )
break;

case QVariant::Double:
if ( fieldSize <= 0 || fieldPrec <= 0)
if ( fieldSize <= 0 || fieldPrec <= 0 )
{
fieldType = "float";
fieldSize = -1;
Expand All @@ -105,14 +105,14 @@ bool QgsPostgresProvider::convertField( QgsField &field )
}

QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer(
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage,
const QMap<QString,QVariant> *options )
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage,
const QMap<QString, QVariant> *options )
{
Q_UNUSED( options );

Expand Down Expand Up @@ -233,9 +233,9 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer(
}

sql = QString( "CREATE TABLE %1 (%2 %3 PRIMARY KEY)" )
.arg( schemaTableName )
.arg( quotedIdentifier( primaryKey ) )
.arg( primaryKeyType );
.arg( schemaTableName )
.arg( quotedIdentifier( primaryKey ) )
.arg( primaryKeyType );

result = conn->PQexec( sql );
if ( PQresultStatus( result ) == PGRES_FATAL_ERROR )
Expand All @@ -247,7 +247,7 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer(
int dim = 2;
long srid = srs->postgisSrid();

switch( wkbType )
switch ( wkbType )
{
case QGis::WKBPoint25D:
dim = 3;
Expand Down Expand Up @@ -369,11 +369,11 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer(
continue;
}

if ( fld.name() == geometryColumn )
{
QgsDebugMsg( "Found a field with the same name of the geometry column. Skip it!" );
continue;
}
if ( fld.name() == geometryColumn )
{
QgsDebugMsg( "Found a field with the same name of the geometry column. Skip it!" );
continue;
}

if ( !convertField( fld ) )
{
Expand Down Expand Up @@ -478,7 +478,7 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
// no table/query passed, the provider could be used to get tables
if ( mQuery.isEmpty() )
{
return;
return;
}

connectionRO = Conn::connectDb( mUri.connectionInfo(), true );
Expand Down Expand Up @@ -1019,9 +1019,9 @@ bool QgsPostgresProvider::getTableInfo( bool searchGeometryColumnsOnly, bool sea
}

bool QgsPostgresProvider::supportedLayers( QVector<QgsPostgresLayerProperty> &layers,
bool searchGeometryColumnsOnly,
bool searchPublicOnly,
bool allowGeometrylessTables )
bool searchGeometryColumnsOnly,
bool searchPublicOnly,
bool allowGeometrylessTables )
{
QgsDebugMsg( "Entering." );

Expand All @@ -1031,7 +1031,7 @@ bool QgsPostgresProvider::supportedLayers( QVector<QgsPostgresLayerProperty> &la
connectionRO = Conn::connectDb( mUri.connectionInfo(), true );
if ( connectionRO == NULL )
{
return false;
return false;
}
}
QgsDebugMsg( "before getTableInfo." );
Expand Down Expand Up @@ -4436,7 +4436,7 @@ QVector<QgsDataItem*> QgsPGConnectionItem::createChildren()
}

QMap<QString, QVector<QgsPostgresLayerProperty> >::const_iterator it = schemasMap.constBegin();
for( ; it != schemasMap.constEnd(); it++ )
for ( ; it != schemasMap.constEnd(); it++ )
{
QgsDebugMsg( "schema: " + it.key() );
QgsPGSchemaItem * schema = new QgsPGSchemaItem( this, it.key(), mPath + "/" + it.key(), mConnInfo, it.value() );
Expand Down Expand Up @@ -4471,9 +4471,9 @@ QgsPGLayerItem::~QgsPGLayerItem()

QString QgsPGLayerItem::createUri()
{
QString pkColName = mLayerProperty.pkCols.size() > 0 ? mLayerProperty.pkCols.at(0) : QString::null;
QString pkColName = mLayerProperty.pkCols.size() > 0 ? mLayerProperty.pkCols.at( 0 ) : QString::null;
QgsDataSourceURI uri( mConnInfo );
uri.setDataSource( mLayerProperty.schemaName, mLayerProperty.tableName, mLayerProperty.geometryColName, mLayerProperty.sql, pkColName);
uri.setDataSource( mLayerProperty.schemaName, mLayerProperty.tableName, mLayerProperty.geometryColName, mLayerProperty.sql, pkColName );
return uri.uri();
}

Expand Down Expand Up @@ -4571,10 +4571,10 @@ QGISEXTERN QgsVectorLayerImport::ImportError createEmptyLayer(
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage,
const QMap<QString,QVariant> *options )
const QMap<QString, QVariant> *options )
{
return QgsPostgresProvider::createEmptyLayer(
uri, fields, wkbType, srs, overwrite,
oldToNewAttrIdxMap, errorMessage, options
);
uri, fields, wkbType, srs, overwrite,
oldToNewAttrIdxMap, errorMessage, options
);
}
22 changes: 11 additions & 11 deletions src/providers/postgres/qgspostgresprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ class QgsPostgresProvider : public QgsVectorDataProvider

/** Import a vector layer into the database */
static QgsVectorLayerImport::ImportError createEmptyLayer(
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage = 0,
const QMap<QString,QVariant> *options = 0
);
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage = 0,
const QMap<QString, QVariant> *options = 0
);

/**
* Constructor for the provider. The uri must be in the following format:
Expand Down Expand Up @@ -793,7 +793,7 @@ class QgsPGLayerItem : public QgsLayerItem
Q_OBJECT
public:
QgsPGLayerItem( QgsDataItem* parent, QString name, QString path,
QString connInfo, QgsLayerItem::LayerType layerType, QgsPostgresLayerProperty layerProperties );
QString connInfo, QgsLayerItem::LayerType layerType, QgsPostgresLayerProperty layerProperties );
~QgsPGLayerItem();

QString createUri();
Expand All @@ -807,7 +807,7 @@ class QgsPGSchemaItem : public QgsDataCollectionItem
Q_OBJECT
public:
QgsPGSchemaItem( QgsDataItem* parent, QString name, QString path,
QString connInfo, QVector<QgsPostgresLayerProperty> layerProperties );
QString connInfo, QVector<QgsPostgresLayerProperty> layerProperties );
~QgsPGSchemaItem();
};

Expand Down
50 changes: 25 additions & 25 deletions src/providers/spatialite/qgsspatialiteprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bool QgsSpatiaLiteProvider::convertField( QgsField &field )
break;

case QVariant::Double:
if ( fieldSize <= 0 || fieldPrec <= 0)
if ( fieldSize <= 0 || fieldPrec <= 0 )
{
fieldType = "REAL";
fieldSize = -1;
Expand All @@ -89,14 +89,14 @@ bool QgsSpatiaLiteProvider::convertField( QgsField &field )

QgsVectorLayerImport::ImportError
QgsSpatiaLiteProvider::createEmptyLayer(
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage,
const QMap<QString,QVariant> *options )
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage,
const QMap<QString, QVariant> *options )
{
Q_UNUSED( options );

Expand Down Expand Up @@ -193,24 +193,24 @@ QgsSpatiaLiteProvider::createEmptyLayer(
{
// delete the table if exists and the related entry in geometry_columns, then re-create it
sql = QString( "DROP TABLE IF EXISTS %1" )
.arg( quotedIdentifier( tableName ) );
.arg( quotedIdentifier( tableName ) );

ret = sqlite3_exec( sqliteHandle, sql.toUtf8().constData(), NULL, NULL, &errMsg );
if ( ret != SQLITE_OK )
throw SLException( errMsg );

sql = QString( "DELETE FROM geometry_columns WHERE f_table_name = %1" )
.arg( quotedValue( tableName ) );
.arg( quotedValue( tableName ) );

ret = sqlite3_exec( sqliteHandle, sql.toUtf8().constData(), NULL, NULL, &errMsg );
if ( ret != SQLITE_OK )
throw SLException( errMsg );
}

sql = QString( "CREATE TABLE %1 (%2 %3 PRIMARY KEY)" )
.arg( quotedIdentifier( tableName ) )
.arg( quotedIdentifier( primaryKey ) )
.arg( primaryKeyType );
.arg( quotedIdentifier( tableName ) )
.arg( quotedIdentifier( primaryKey ) )
.arg( primaryKeyType );

ret = sqlite3_exec( sqliteHandle, sql.toUtf8().constData(), NULL, NULL, &errMsg );
if ( ret != SQLITE_OK )
Expand All @@ -220,7 +220,7 @@ QgsSpatiaLiteProvider::createEmptyLayer(
int dim = 2;
long srid = srs->postgisSrid();

switch( wkbType )
switch ( wkbType )
{
case QGis::WKBPoint25D:
dim = 3;
Expand Down Expand Up @@ -292,7 +292,7 @@ QgsSpatiaLiteProvider::createEmptyLayer(
throw SLException( errMsg );

}
catch( SLException &e )
catch ( SLException &e )
{
QgsDebugMsg( QString( "creation of data source %1 failed. %2" )
.arg( tableName )
Expand Down Expand Up @@ -351,11 +351,11 @@ QgsSpatiaLiteProvider::createEmptyLayer(
if ( fld.name() == primaryKey )
continue;

if ( fld.name() == geometryColumn )
{
QgsDebugMsg( "Found a field with the same name of the geometry column. Skip it!" );
continue;
}
if ( fld.name() == geometryColumn )
{
QgsDebugMsg( "Found a field with the same name of the geometry column. Skip it!" );
continue;
}

if ( !convertField( fld ) )
{
Expand Down Expand Up @@ -4888,10 +4888,10 @@ QGISEXTERN QgsVectorLayerImport::ImportError createEmptyLayer(
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage,
const QMap<QString,QVariant> *options )
const QMap<QString, QVariant> *options )
{
return QgsSpatiaLiteProvider::createEmptyLayer(
uri, fields, wkbType, srs, overwrite,
oldToNewAttrIdxMap, errorMessage, options
);
uri, fields, wkbType, srs, overwrite,
oldToNewAttrIdxMap, errorMessage, options
);
}
18 changes: 9 additions & 9 deletions src/providers/spatialite/qgsspatialiteprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider

/** Import a vector layer into the database */
static QgsVectorLayerImport::ImportError createEmptyLayer(
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage = 0,
const QMap<QString,QVariant> *options = 0
);
const QString& uri,
const QgsFieldMap &fields,
QGis::WkbType wkbType,
const QgsCoordinateReferenceSystem *srs,
bool overwrite,
QMap<int, int> *oldToNewAttrIdxMap,
QString *errorMessage = 0,
const QMap<QString, QVariant> *options = 0
);

/**
* Constructor of the vector provider
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void TestQgsApplication::initTestCase()
// init QGIS's paths - true means that all path will be inited from prefix
QString qgisPath = QCoreApplication::applicationDirPath();
QgsApplication::setPrefixPath( INSTALL_PREFIX, true );
qDebug( QgsApplication::showSettings().toUtf8() );
qDebug( "%s", QgsApplication::showSettings().toUtf8() );
};

void TestQgsApplication::checkTheme()
Expand Down