diff --git a/src/app/legend/qgslegendlayer.cpp b/src/app/legend/qgslegendlayer.cpp index d51fd39b3af..2432c20e45a 100644 --- a/src/app/legend/qgslegendlayer.cpp +++ b/src/app/legend/qgslegendlayer.cpp @@ -61,11 +61,11 @@ QgsLegendLayer::QgsLegendLayer( QgsMapLayer* layer ) Qt::ItemFlags flags = Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable; QgsVectorLayer *vlayer = qobject_cast( layer ); - if( !vlayer || vlayer->geometryType() != QGis::NoGeometry ) + if ( !vlayer || vlayer->geometryType() != QGis::NoGeometry ) { flags |= Qt::ItemIsUserCheckable; } - + setFlags( flags ); setCheckState( 0, Qt::Checked ); @@ -105,7 +105,7 @@ QgsLegendLayer::~QgsLegendLayer() void QgsLegendLayer::setCheckState( int column, Qt::CheckState state ) { - if( flags() & Qt::ItemIsUserCheckable ) + if ( flags() & Qt::ItemIsUserCheckable ) { QTreeWidgetItem::setCheckState( column, state ); } diff --git a/src/app/qgsrasterlayerproperties.cpp b/src/app/qgsrasterlayerproperties.cpp index d942c6d0d63..8f7f2f47e74 100644 --- a/src/app/qgsrasterlayerproperties.cpp +++ b/src/app/qgsrasterlayerproperties.cpp @@ -205,7 +205,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv pbtnLoadColorMapFromFile->setIcon( QgisApp::getThemeIcon( "/mActionFileOpen.png" ) ); mSaveAsImageButton->setIcon( QgisApp::getThemeIcon( "/mActionFileSave.png" ) ); - + mMapCanvas = theCanvas; mPixelSelectorTool = 0; if ( mMapCanvas ) @@ -1863,16 +1863,16 @@ void QgsRasterLayerProperties::refreshHistogram() QgsDebugMsg( "entered." ); //ensure all children get removed mpPlot->setAutoDelete( true ); - mpPlot->setTitle( QObject::tr( "Raster Histogram") ); + mpPlot->setTitle( QObject::tr( "Raster Histogram" ) ); mpPlot->insertLegend( new QwtLegend(), QwtPlot::BottomLegend ); // Set axis titles - mpPlot->setAxisTitle( QwtPlot::xBottom, QObject::tr("Pixel Value") ); - mpPlot->setAxisTitle( QwtPlot::yLeft, QObject::tr("Frequency") ); + mpPlot->setAxisTitle( QwtPlot::xBottom, QObject::tr( "Pixel Value" ) ); + mpPlot->setAxisTitle( QwtPlot::yLeft, QObject::tr( "Frequency" ) ); mpPlot->setAxisAutoScale( QwtPlot::yLeft ); // x axis scale only set after computing global min/max across bands (see below) // add a grid QwtPlotGrid * myGrid = new QwtPlotGrid(); - myGrid->attach(mpPlot); + myGrid->attach( mpPlot ); // Explanation: // We use the gdal histogram creation routine is called for each selected // layer. Currently the hist is hardcoded @@ -1921,8 +1921,8 @@ void QgsRasterLayerProperties::refreshHistogram() myX2Data.append( double( myBin ) ); myY2Data.append( double( myBinValue ) ); } - mypCurve->setData(myX2Data,myY2Data); - mypCurve->attach(mpPlot); + mypCurve->setData( myX2Data, myY2Data ); + mypCurve->attach( mpPlot ); if ( myFirstIteration || myGlobalMin < myRasterBandStats.minimumValue ) { myGlobalMin = myRasterBandStats.minimumValue; @@ -1936,13 +1936,13 @@ void QgsRasterLayerProperties::refreshHistogram() // for x axis use band pixel values rather than gdal hist. bin values // subtract -0.5 to prevent rounding errors // see http://www.gdal.org/classGDALRasterBand.html#3f8889607d3b2294f7e0f11181c201c8 - mpPlot->setAxisScale ( QwtPlot::xBottom, - myGlobalMin - 0.5, - myGlobalMax + 0.5 ); + mpPlot->setAxisScale( QwtPlot::xBottom, + myGlobalMin - 0.5, + myGlobalMax + 0.5 ); mpPlot->replot(); disconnect( mRasterLayer, SIGNAL( progressUpdate( int ) ), mHistogramProgress, SLOT( setValue( int ) ) ); mHistogramProgress->hide(); - mpPlot->canvas()->setCursor(Qt::ArrowCursor); + mpPlot->canvas()->setCursor( Qt::ArrowCursor ); QApplication::restoreOverrideCursor(); } @@ -1952,18 +1952,18 @@ void QgsRasterLayerProperties::on_mSaveAsImageButton_clicked() { return; } - - QPixmap myPixmap(600, 600); - myPixmap.fill(Qt::white); // Qt::transparent ? + + QPixmap myPixmap( 600, 600 ); + myPixmap.fill( Qt::white ); // Qt::transparent ? QwtPlotPrintFilter myFilter; int myOptions = QwtPlotPrintFilter::PrintAll; myOptions &= ~QwtPlotPrintFilter::PrintBackground; myOptions |= QwtPlotPrintFilter::PrintFrameWithScales; - myFilter.setOptions(myOptions); + myFilter.setOptions( myOptions ); - mpPlot->print(myPixmap, myFilter); - QPair< QString,QString> myFileNameAndFilter = QgisGui::getSaveAsImageName( this, tr( "Choose a file name to save the map image as" ) ); + mpPlot->print( myPixmap, myFilter ); + QPair< QString, QString> myFileNameAndFilter = QgisGui::getSaveAsImageName( this, tr( "Choose a file name to save the map image as" ) ); if ( myFileNameAndFilter.first != "" ) { myPixmap.save( myFileNameAndFilter.first ); diff --git a/src/app/qgsspatialitesourceselect.cpp b/src/app/qgsspatialitesourceselect.cpp index 896c5e7cbd7..d29dce1eb5b 100644 --- a/src/app/qgsspatialitesourceselect.cpp +++ b/src/app/qgsspatialitesourceselect.cpp @@ -700,7 +700,7 @@ bool QgsSpatiaLiteSourceSelect::checkVirtsGeometryColumns( sqlite3 * handle ) return exists; } -bool QgsSpatiaLiteSourceSelect::isRasterlite1Datasource (sqlite3 * handle, const char *table) +bool QgsSpatiaLiteSourceSelect::isRasterlite1Datasource( sqlite3 * handle, const char *table ) { // testing for RasterLite-1 datasources int ret; @@ -713,12 +713,12 @@ bool QgsSpatiaLiteSourceSelect::isRasterlite1Datasource (sqlite3 * handle, const char table_raster[4192]; char sql[4192]; - strcpy ( table_raster, table ); + strcpy( table_raster, table ); len = strlen( table_raster ); - if (strlen( table_raster ) < 9) - return false; - if (strcmp( table_raster + len - 9, "_metadata" ) != 0) - return false; + if ( strlen( table_raster ) < 9 ) + return false; + if ( strcmp( table_raster + len - 9, "_metadata" ) != 0 ) + return false; // ok, possible candidate strcpy( table_raster + len - 9, "_rasters" ); diff --git a/src/core/raster/qgsrasterlayer.h b/src/core/raster/qgsrasterlayer.h index 049064c5325..d03f19f92b3 100644 --- a/src/core/raster/qgsrasterlayer.h +++ b/src/core/raster/qgsrasterlayer.h @@ -619,7 +619,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer /** \brief Draws a thumbnail of the rasterlayer into the supplied pixmap pointer */ void thumbnailAsPixmap( QPixmap * theQPixmap ); - /** \brief Draws a thumbnail of the rasterlayer into the supplied QImage pointer + /** \brief Draws a thumbnail of the rasterlayer into the supplied QImage pointer * @note added in QGIS 1.6 * */ void thumbnailAsImage( QImage * thepImage ); diff --git a/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp b/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp index 8b91272071d..337c5c6588d 100644 --- a/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp +++ b/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp @@ -327,10 +327,10 @@ static QList _calcQuantileBreaks( QList values, int classes ) for ( int i = 1; i < classes; i++ ) { - if( n > 1 ) + if ( n > 1 ) { double q = i / ( double ) classes; - double a = q * (n-1); + double a = q * ( n - 1 ); int aa = ( int )( a ); double r = a - aa; diff --git a/src/gui/qgisgui.cpp b/src/gui/qgisgui.cpp index 27fc18aeacc..283833c9277 100644 --- a/src/gui/qgisgui.cpp +++ b/src/gui/qgisgui.cpp @@ -38,7 +38,7 @@ namespace QgisGui haveLastUsedFilter = settings.contains( "/UI/" + filterName ); QString lastUsedFilter = settings.value( "/UI/" + filterName, - QVariant( QString::null ) ).toString(); + QVariant( QString::null ) ).toString(); QString lastUsedDir = settings.value( "/UI/" + filterName + "Dir", "." ).toString(); @@ -129,8 +129,8 @@ namespace QgisGui //create a file dialog using the the filter list generated above std::auto_ptr < QFileDialog > myQFileDialog( new QFileDialog( theParent, - QObject::tr( "Choose a file name to save the map image as" ), - myLastUsedDir, myFilters ) ); + QObject::tr( "Choose a file name to save the map image as" ), + myLastUsedDir, myFilters ) ); // allow for selection of more than one file myQFileDialog->setFileMode( QFileDialog::AnyFile ); @@ -168,7 +168,7 @@ namespace QgisGui myPair.first = myOutputFileName; myPair.second = myFilterMap[myFilterString]; return myPair; - } // + } // QString createFileFilter_( QString const &longName, QString const &glob ) { diff --git a/src/gui/qgisgui.h b/src/gui/qgisgui.h index ee7e8c7d6d5..9d9c325ca7e 100644 --- a/src/gui/qgisgui.h +++ b/src/gui/qgisgui.h @@ -76,7 +76,7 @@ namespace QgisGui QString const &filters, QStringList & selectedFiles, QString& enc, QString &title, bool cancelAll = false ); - /** A helper function to get an image name from the user. It will nicely + /** A helper function to get an image name from the user. It will nicely * provide filters with all available writable image formats. * @param QWidget - widget that should act as the parent for the file dialog * @param QString the message to display to the user @@ -84,8 +84,8 @@ namespace QgisGui * the file type * @note added in 1.6 */ - QPair GUI_EXPORT getSaveAsImageName( QWidget * theParent, QString theMessage ); - + QPair GUI_EXPORT getSaveAsImageName( QWidget * theParent, QString theMessage ); + /** Convenience function for readily creating file filters. diff --git a/src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp b/src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp index d343d21c997..a54caa2f4b2 100644 --- a/src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp +++ b/src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp @@ -24,12 +24,12 @@ QgsRendererV2Widget* QgsCategorizedSymbolRendererV2Widget::create( QgsVectorLaye } QgsCategorizedSymbolRendererV2Widget::QgsCategorizedSymbolRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) - : QgsRendererV2Widget( layer, style ) + : QgsRendererV2Widget( layer, style ) { // try to recognize the previous renderer // (null renderer means "no previous renderer") - if( !renderer || renderer->type() != "categorizedSymbol" ) + if ( !renderer || renderer->type() != "categorizedSymbol" ) { // we're not going to use it - so let's delete the renderer delete renderer; @@ -102,7 +102,7 @@ void QgsCategorizedSymbolRendererV2Widget::updateUiFromRenderer() connect( cboCategorizedColumn, SIGNAL( currentIndexChanged( int ) ), this, SLOT( categoryColumnChanged() ) ); // set source symbol - if( mRenderer->sourceSymbol() ) + if ( mRenderer->sourceSymbol() ) { delete mCategorizedSymbol; mCategorizedSymbol = mRenderer->sourceSymbol()->clone(); @@ -110,7 +110,7 @@ void QgsCategorizedSymbolRendererV2Widget::updateUiFromRenderer() } // set source color ramp - if( mRenderer->sourceColorRamp() ) + if ( mRenderer->sourceColorRamp() ) { cboCategorizedColorRamp->setSourceColorRamp( mRenderer->sourceColorRamp() ); } @@ -125,7 +125,7 @@ QgsFeatureRendererV2* QgsCategorizedSymbolRendererV2Widget::renderer() void QgsCategorizedSymbolRendererV2Widget::changeCategorizedSymbol() { QgsSymbolV2SelectorDialog dlg( mCategorizedSymbol, mStyle, this ); - if( !dlg.exec() ) + if ( !dlg.exec() ) return; updateCategorizedSymbolIcon(); @@ -150,7 +150,7 @@ void QgsCategorizedSymbolRendererV2Widget::populateCategories() // TODO: sort?? utils.sortVariantList(keys); - for( i = 0; i < count; i++ ) + for ( i = 0; i < count; i++ ) { const QgsRendererCategoryV2 &cat = mRenderer->categories()[i]; addCategory( cat ); @@ -166,7 +166,7 @@ void QgsCategorizedSymbolRendererV2Widget::populateColumns() cboCategorizedColumn->clear(); const QgsFieldMap& flds = mLayer->pendingFields(); QgsFieldMap::ConstIterator it = flds.begin(); - for( ; it != flds.end(); ++it ) + for ( ; it != flds.end(); ++it ) { cboCategorizedColumn->addItem( it->name() ); } @@ -196,21 +196,21 @@ void QgsCategorizedSymbolRendererV2Widget::categoryColumnChanged() void QgsCategorizedSymbolRendererV2Widget::categoriesDoubleClicked( const QModelIndex & idx ) { - if( idx.isValid() && idx.column() == 0 ) + if ( idx.isValid() && idx.column() == 0 ) changeCategorySymbol(); } void QgsCategorizedSymbolRendererV2Widget::changeCategorySymbol() { QVariant k = currentCategory(); - if( !k.isValid() ) + if ( !k.isValid() ) return; int catIdx = mRenderer->categoryIndexForValue( k ); QgsSymbolV2* newSymbol = mRenderer->categories()[catIdx].symbol()->clone(); QgsSymbolV2SelectorDialog dlg( newSymbol, mStyle, this ); - if( !dlg.exec() ) + if ( !dlg.exec() ) { delete newSymbol; return; @@ -228,7 +228,7 @@ static void _createCategories( QgsCategoryList& cats, QList& values, Q int num = values.count(); - for( int i = 0; i < num; i++ ) + for ( int i = 0; i < num; i++ ) { QVariant value = values[i]; double x = i / ( double ) num; @@ -253,9 +253,9 @@ void QgsCategorizedSymbolRendererV2Widget::addCategories() QgsVectorColorRampV2* ramp = cboCategorizedColorRamp->currentColorRamp(); - if( ramp == NULL ) + if ( ramp == NULL ) { - if( cboCategorizedColorRamp->count() == 0 ) + if ( cboCategorizedColorRamp->count() == 0 ) QMessageBox::critical( this, tr( "Error" ), tr( "There are no available color ramps. You can add them in Style Manager." ) ); else QMessageBox::critical( this, tr( "Error" ), tr( "The selected color ramp is not available." ) ); @@ -265,9 +265,9 @@ void QgsCategorizedSymbolRendererV2Widget::addCategories() QgsCategoryList cats; _createCategories( cats, unique_vals, mCategorizedSymbol, ramp ); - if( !mOldClassificationAttribute.isEmpty() && - attrName != mOldClassificationAttribute && - mRenderer->categories().count() > 0 ) + if ( !mOldClassificationAttribute.isEmpty() && + attrName != mOldClassificationAttribute && + mRenderer->categories().count() > 0 ) { int res = QMessageBox::question( this, tr( "Confirm Delete" ), @@ -275,24 +275,24 @@ void QgsCategorizedSymbolRendererV2Widget::addCategories() "Should the existing classes be deleted before classification?" ) .arg( mOldClassificationAttribute ).arg( attrName ), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel ); - if( res == QMessageBox::Cancel ) + if ( res == QMessageBox::Cancel ) return; bool deleteExisting = ( res == QMessageBox::Yes ); - if( !deleteExisting ) + if ( !deleteExisting ) { QgsCategoryList prevCats = mRenderer->categories(); - for( int i = 0; i < cats.size(); ++i ) + for ( int i = 0; i < cats.size(); ++i ) { bool contains = false; QVariant value = cats.at( i ).value(); - for( int j = 0; j < prevCats.size() && !contains; ++j ) + for ( int j = 0; j < prevCats.size() && !contains; ++j ) { - if( prevCats.at( j ).value() == value ) + if ( prevCats.at( j ).value() == value ) contains = true; } - if( !contains ) + if ( !contains ) prevCats.append( cats.at( i ) ); } cats = prevCats; @@ -328,7 +328,7 @@ void QgsCategorizedSymbolRendererV2Widget::addCategories() int QgsCategorizedSymbolRendererV2Widget::currentCategoryRow() { QModelIndex idx = viewCategories->selectionModel()->currentIndex(); - if( !idx.isValid() ) + if ( !idx.isValid() ) return -1; return idx.row(); } @@ -336,7 +336,7 @@ int QgsCategorizedSymbolRendererV2Widget::currentCategoryRow() QVariant QgsCategorizedSymbolRendererV2Widget::currentCategory() { int row = currentCategoryRow(); - if( row == -1 ) + if ( row == -1 ) return QVariant(); QStandardItemModel* m = qobject_cast( viewCategories->model() ); return m->item( row, 1 )->data(); @@ -345,11 +345,11 @@ QVariant QgsCategorizedSymbolRendererV2Widget::currentCategory() void QgsCategorizedSymbolRendererV2Widget::deleteCategory() { QVariant k = currentCategory(); - if( !k.isValid() ) + if ( !k.isValid() ) return; int idx = mRenderer->categoryIndexForValue( k ); - if( idx < 0 ) + if ( idx < 0 ) return; mRenderer->deleteCategory( idx ); @@ -367,19 +367,19 @@ void QgsCategorizedSymbolRendererV2Widget::changeCurrentValue( QStandardItem * i { int idx = item->row(); QString newtext = item->text(); - if( item->column() == 1 ) + if ( item->column() == 1 ) { QVariant value = newtext; // try to preserve variant type for this value QVariant::Type t = item->data().type(); - if( t == QVariant::Int ) + if ( t == QVariant::Int ) value = newtext.toInt(); - else if( t == QVariant::Double ) + else if ( t == QVariant::Double ) value = newtext.toDouble(); mRenderer->updateCategoryValue( idx, value ); item->setData( value ); } - else if( item->column() == 2 ) + else if ( item->column() == 2 ) { mRenderer->updateCategoryLabel( idx, newtext ); } diff --git a/src/gui/symbology-ng/qgscolorrampcombobox.cpp b/src/gui/symbology-ng/qgscolorrampcombobox.cpp index f7c5f6958b1..490471d46ee 100644 --- a/src/gui/symbology-ng/qgscolorrampcombobox.cpp +++ b/src/gui/symbology-ng/qgscolorrampcombobox.cpp @@ -8,7 +8,7 @@ QSize QgsColorRampComboBox::rampIconSize( 50, 16 ); QgsColorRampComboBox::QgsColorRampComboBox( QWidget *parent ) : - QComboBox( parent ), mStyle( NULL ), mSourceColorRamp( NULL ) + QComboBox( parent ), mStyle( NULL ), mSourceColorRamp( NULL ) { } @@ -19,7 +19,7 @@ QgsColorRampComboBox::~QgsColorRampComboBox() void QgsColorRampComboBox::populate( QgsStyleV2* style ) { - if( count() != 0 ) + if ( count() != 0 ) return; // already populated! mStyle = style; @@ -27,7 +27,7 @@ void QgsColorRampComboBox::populate( QgsStyleV2* style ) setIconSize( rampIconSize ); QStringList rampNames = mStyle->colorRampNames(); - for( QStringList::iterator it = rampNames.begin(); it != rampNames.end(); ++it ) + for ( QStringList::iterator it = rampNames.begin(); it != rampNames.end(); ++it ) { QgsVectorColorRampV2* ramp = style->colorRamp( *it ); QIcon icon = QgsSymbolLayerV2Utils::colorRampPreviewIcon( ramp, rampIconSize ); @@ -44,7 +44,7 @@ void QgsColorRampComboBox::populate( QgsStyleV2* style ) QgsVectorColorRampV2* QgsColorRampComboBox::currentColorRamp() { QString rampName = currentText(); - if( rampName == "[source]" && mSourceColorRamp ) + if ( rampName == "[source]" && mSourceColorRamp ) return mSourceColorRamp->clone(); else return mStyle->colorRamp( rampName ); @@ -55,7 +55,7 @@ void QgsColorRampComboBox::setSourceColorRamp( QgsVectorColorRampV2* sourceRamp mSourceColorRamp = sourceRamp->clone(); QIcon icon = QgsSymbolLayerV2Utils::colorRampPreviewIcon( mSourceColorRamp, rampIconSize ); - if( itemText( 0 ) == "[source]" ) + if ( itemText( 0 ) == "[source]" ) setItemIcon( 0, icon ); else insertItem( 0, icon, "[source]" ); @@ -64,12 +64,12 @@ void QgsColorRampComboBox::setSourceColorRamp( QgsVectorColorRampV2* sourceRamp void QgsColorRampComboBox::colorRampChanged( int index ) { - if( index != count() - 1 ) + if ( index != count() - 1 ) return; // last item: "new color ramp..." QString rampName = QgsStyleV2ManagerDialog::addColorRampStatic( this, mStyle ); - if( rampName.isEmpty() ) + if ( rampName.isEmpty() ) return; // put newly added ramp into the combo diff --git a/src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp b/src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp index 97b0cd08f31..5ffd26bbab4 100644 --- a/src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp +++ b/src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp @@ -25,12 +25,12 @@ QgsRendererV2Widget* QgsGraduatedSymbolRendererV2Widget::create( QgsVectorLayer* } QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) - : QgsRendererV2Widget( layer, style ) + : QgsRendererV2Widget( layer, style ) { // try to recognize the previous renderer // (null renderer means "no previous renderer") - if( !renderer || renderer->type() != "graduatedSymbol" ) + if ( !renderer || renderer->type() != "graduatedSymbol" ) { // we're not going to use it - so let's delete the renderer delete renderer; @@ -98,9 +98,9 @@ void QgsGraduatedSymbolRendererV2Widget::updateUiFromRenderer() populateRanges(); // update UI from the graduated renderer (update combo boxes, view) - if( mRenderer->mode() < cboGraduatedMode->count() ) + if ( mRenderer->mode() < cboGraduatedMode->count() ) cboGraduatedMode->setCurrentIndex( mRenderer->mode() ); - if( mRenderer->ranges().count() ) + if ( mRenderer->ranges().count() ) spinGraduatedClasses->setValue( mRenderer->ranges().count() ); // set column @@ -111,7 +111,7 @@ void QgsGraduatedSymbolRendererV2Widget::updateUiFromRenderer() connect( cboGraduatedColumn, SIGNAL( currentIndexChanged( int ) ), this, SLOT( graduatedColumnChanged() ) ); // set source symbol - if( mRenderer->sourceSymbol() ) + if ( mRenderer->sourceSymbol() ) { delete mGraduatedSymbol; mGraduatedSymbol = mRenderer->sourceSymbol()->clone(); @@ -119,7 +119,7 @@ void QgsGraduatedSymbolRendererV2Widget::updateUiFromRenderer() } // set source color ramp - if( mRenderer->sourceColorRamp() ) + if ( mRenderer->sourceColorRamp() ) { cboGraduatedColorRamp->setSourceColorRamp( mRenderer->sourceColorRamp() ); } @@ -133,9 +133,9 @@ void QgsGraduatedSymbolRendererV2Widget::populateColumns() cboGraduatedColumn->clear(); const QgsFieldMap& flds = mLayer->pendingFields(); QgsFieldMap::ConstIterator it = flds.begin(); - for( ; it != flds.end(); ++it ) + for ( ; it != flds.end(); ++it ) { - if( it->type() == QVariant::Double || it->type() == QVariant::Int ) + if ( it->type() == QVariant::Double || it->type() == QVariant::Int ) cboGraduatedColumn->addItem( it->name() ); } } @@ -154,9 +154,9 @@ void QgsGraduatedSymbolRendererV2Widget::classifyGraduated() QgsVectorColorRampV2* ramp = cboGraduatedColorRamp->currentColorRamp(); - if( ramp == NULL ) + if ( ramp == NULL ) { - if( cboGraduatedColorRamp->count() == 0 ) + if ( cboGraduatedColorRamp->count() == 0 ) QMessageBox::critical( this, tr( "Error" ), tr( "There are no available color ramps. You can add them in Style Manager." ) ); else QMessageBox::critical( this, tr( "Error" ), tr( "The selected color ramp is not available." ) ); @@ -164,13 +164,13 @@ void QgsGraduatedSymbolRendererV2Widget::classifyGraduated() } QgsGraduatedSymbolRendererV2::Mode mode; - if( cboGraduatedMode->currentIndex() == 0 ) + if ( cboGraduatedMode->currentIndex() == 0 ) mode = QgsGraduatedSymbolRendererV2::EqualInterval; - else if( cboGraduatedMode->currentIndex() == 2 ) + else if ( cboGraduatedMode->currentIndex() == 2 ) mode = QgsGraduatedSymbolRendererV2::Jenks; - else if( cboGraduatedMode->currentIndex() == 3 ) + else if ( cboGraduatedMode->currentIndex() == 3 ) mode = QgsGraduatedSymbolRendererV2::StdDev; - else if( cboGraduatedMode->currentIndex() == 4 ) + else if ( cboGraduatedMode->currentIndex() == 4 ) mode = QgsGraduatedSymbolRendererV2::Pretty; else // default should be quantile for now mode = QgsGraduatedSymbolRendererV2::Quantile; @@ -186,7 +186,7 @@ void QgsGraduatedSymbolRendererV2Widget::classifyGraduated() void QgsGraduatedSymbolRendererV2Widget::changeGraduatedSymbol() { QgsSymbolV2SelectorDialog dlg( mGraduatedSymbol, mStyle, this ); - if( !dlg.exec() ) + if ( !dlg.exec() ) return; updateGraduatedSymbolIcon(); @@ -214,7 +214,7 @@ void QgsGraduatedSymbolRendererV2Widget::populateRanges() int i, count = mRenderer->ranges().count(); - for( i = 0; i < count; i++ ) + for ( i = 0; i < count; i++ ) { const QgsRendererRangeV2& range = mRenderer->ranges()[i]; QString rangeStr = QString::number( range.lowerValue(), 'f', 4 ) + " - " + QString::number( range.upperValue(), 'f', 4 ); @@ -242,7 +242,7 @@ void QgsGraduatedSymbolRendererV2Widget::populateRanges() int QgsRendererV2PropertiesDialog::currentRangeRow() { QModelIndex idx = viewGraduated->selectionModel()->currentIndex(); - if( !idx.isValid() ) + if ( !idx.isValid() ) return -1; return idx.row(); } @@ -250,15 +250,15 @@ int QgsRendererV2PropertiesDialog::currentRangeRow() void QgsGraduatedSymbolRendererV2Widget::rangesDoubleClicked( const QModelIndex & idx ) { - if( idx.isValid() && idx.column() == 0 ) + if ( idx.isValid() && idx.column() == 0 ) changeRangeSymbol( idx.row() ); - if( idx.isValid() && idx.column() == 1 ) + if ( idx.isValid() && idx.column() == 1 ) changeRange( idx.row() ); } void QgsGraduatedSymbolRendererV2Widget::rangesClicked( const QModelIndex & idx ) { - if( !idx.isValid() ) + if ( !idx.isValid() ) mRowSelected = -1; else mRowSelected = idx.row(); @@ -269,7 +269,7 @@ void QgsGraduatedSymbolRendererV2Widget::changeRangeSymbol( int rangeIdx ) QgsSymbolV2* newSymbol = mRenderer->ranges()[rangeIdx].symbol()->clone(); QgsSymbolV2SelectorDialog dlg( newSymbol, mStyle, this ); - if( !dlg.exec() ) + if ( !dlg.exec() ) { delete newSymbol; return; @@ -288,7 +288,7 @@ void QgsGraduatedSymbolRendererV2Widget::changeRange( int rangeIdx ) dialog.setLowerValue( QString( "%1" ).arg( range.lowerValue() ) ); dialog.setUpperValue( QString( "%1" ).arg( range.upperValue() ) ); - if( dialog.exec() == QDialog::Accepted ) + if ( dialog.exec() == QDialog::Accepted ) { double lowerValue = dialog.lowerValue().toDouble(); double upperValue = dialog.upperValue().toDouble(); @@ -315,7 +315,7 @@ void QgsGraduatedSymbolRendererV2Widget::deleteCurrentClass() void QgsGraduatedSymbolRendererV2Widget::changeCurrentValue( QStandardItem * item ) { - if( item->column() == 2 ) + if ( item->column() == 2 ) { QString label = item->text(); int idx = item->row(); diff --git a/src/gui/symbology-ng/qgsstylev2managerdialog.cpp b/src/gui/symbology-ng/qgsstylev2managerdialog.cpp index f602afd8c6e..f390d83f255 100644 --- a/src/gui/symbology-ng/qgsstylev2managerdialog.cpp +++ b/src/gui/symbology-ng/qgsstylev2managerdialog.cpp @@ -21,7 +21,7 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* parent ) - : QDialog( parent ), mStyle( style ), mModified( false ) + : QDialog( parent ), mStyle( style ), mModified( false ) { setupUi( this ); @@ -52,7 +52,7 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa void QgsStyleV2ManagerDialog::onFinished() { - if( mModified ) + if ( mModified ) { mStyle->save(); } @@ -66,9 +66,9 @@ void QgsStyleV2ManagerDialog::populateTypes() int markerCount = 0, lineCount = 0, fillCount = 0; QStringList symbolNames = mStyle->symbolNames(); - for( int i = 0; i < symbolNames.count(); ++i ) + for ( int i = 0; i < symbolNames.count(); ++i ) { - switch( mStyle->symbolRef( symbolNames[i] )->type() ) + switch ( mStyle->symbolRef( symbolNames[i] )->type() ) { case QgsSymbolV2::Marker: markerCount++; break; case QgsSymbolV2::Line: lineCount++; break; @@ -94,11 +94,11 @@ void QgsStyleV2ManagerDialog::populateList() // get current symbol type int itemType = currentItemType(); - if( itemType < 3 ) + if ( itemType < 3 ) { populateSymbols( itemType ); } - else if( itemType == 3 ) + else if ( itemType == 3 ) { populateColorRamps(); } @@ -115,11 +115,11 @@ void QgsStyleV2ManagerDialog::populateSymbols( int type ) QStringList symbolNames = mStyle->symbolNames(); - for( int i = 0; i < symbolNames.count(); ++i ) + for ( int i = 0; i < symbolNames.count(); ++i ) { QString name = symbolNames[i]; QgsSymbolV2* symbol = mStyle->symbol( name ); - if( symbol->type() == type ) + if ( symbol->type() == type ) { QStandardItem* item = new QStandardItem( name ); QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon( symbol, listItems->iconSize() ); @@ -139,7 +139,7 @@ void QgsStyleV2ManagerDialog::populateColorRamps() QStringList colorRamps = mStyle->colorRampNames(); - for( int i = 0; i < colorRamps.count(); ++i ) + for ( int i = 0; i < colorRamps.count(); ++i ) { QString name = colorRamps[i]; QgsVectorColorRampV2* ramp = mStyle->colorRamp( name ); @@ -161,18 +161,18 @@ int QgsStyleV2ManagerDialog::currentItemType() QString QgsStyleV2ManagerDialog::currentItemName() { QModelIndex index = listItems->selectionModel()->currentIndex(); - if( !index.isValid() ) + if ( !index.isValid() ) return QString(); return index.model()->data( index, 0 ).toString(); } void QgsStyleV2ManagerDialog::addItem() { - if( currentItemType() < 3 ) + if ( currentItemType() < 3 ) { addSymbol(); } - else if( currentItemType() == 3 ) + else if ( currentItemType() == 3 ) { addColorRamp(); } @@ -189,7 +189,7 @@ bool QgsStyleV2ManagerDialog::addSymbol() { // create new symbol with current type QgsSymbolV2* symbol; - switch( currentItemType() ) + switch ( currentItemType() ) { case QgsSymbolV2::Marker: symbol = new QgsMarkerSymbolV2(); break; case QgsSymbolV2::Line: symbol = new QgsLineSymbolV2(); break; @@ -199,7 +199,7 @@ bool QgsStyleV2ManagerDialog::addSymbol() // get symbol design QgsSymbolV2PropertiesDialog dlg( symbol, this ); - if( dlg.exec() == 0 ) + if ( dlg.exec() == 0 ) { delete symbol; return false; @@ -209,7 +209,7 @@ bool QgsStyleV2ManagerDialog::addSymbol() bool ok; QString name = QInputDialog::getText( this, tr( "Symbol name" ), tr( "Please enter name for new symbol:" ), QLineEdit::Normal, tr( "new symbol" ), &ok ); - if( !ok || name.isEmpty() ) + if ( !ok || name.isEmpty() ) { delete symbol; return false; @@ -230,37 +230,37 @@ QString QgsStyleV2ManagerDialog::addColorRampStatic( QWidget* parent, QgsStyleV2 bool ok; QString rampType = QInputDialog::getItem( parent, tr( "Color ramp type" ), tr( "Please select color ramp type:" ), rampTypes, 0, false, &ok ); - if( !ok || rampType.isEmpty() ) + if ( !ok || rampType.isEmpty() ) return QString(); QgsVectorColorRampV2 *ramp = NULL; - if( rampType == tr( "Gradient" ) ) + if ( rampType == tr( "Gradient" ) ) { QgsVectorGradientColorRampV2* gradRamp = new QgsVectorGradientColorRampV2(); QgsVectorGradientColorRampV2Dialog dlg( gradRamp, parent ); - if( !dlg.exec() ) + if ( !dlg.exec() ) { delete gradRamp; return QString(); } ramp = gradRamp; } - else if( rampType == tr( "Random" ) ) + else if ( rampType == tr( "Random" ) ) { QgsVectorRandomColorRampV2* randRamp = new QgsVectorRandomColorRampV2(); QgsVectorRandomColorRampV2Dialog dlg( randRamp, parent ); - if( !dlg.exec() ) + if ( !dlg.exec() ) { delete randRamp; return QString(); } ramp = randRamp; } - else if( rampType == tr( "ColorBrewer" ) ) + else if ( rampType == tr( "ColorBrewer" ) ) { QgsVectorColorBrewerColorRampV2* brewerRamp = new QgsVectorColorBrewerColorRampV2(); QgsVectorColorBrewerColorRampV2Dialog dlg( brewerRamp, parent ); - if( !dlg.exec() ) + if ( !dlg.exec() ) { delete brewerRamp; return QString(); @@ -275,9 +275,9 @@ QString QgsStyleV2ManagerDialog::addColorRampStatic( QWidget* parent, QgsStyleV2 // get name QString name = QInputDialog::getText( parent, tr( "Color ramp name" ), tr( "Please enter name for new color ramp:" ), QLineEdit::Normal, tr( "new color ramp" ), &ok ); - if( !ok || name.isEmpty() ) + if ( !ok || name.isEmpty() ) { - if( ramp ) + if ( ramp ) delete ramp; return QString(); } @@ -291,7 +291,7 @@ QString QgsStyleV2ManagerDialog::addColorRampStatic( QWidget* parent, QgsStyleV2 bool QgsStyleV2ManagerDialog::addColorRamp() { QString rampName = addColorRampStatic( this , mStyle ); - if( !rampName.isEmpty() ) + if ( !rampName.isEmpty() ) { mModified = true; return true; @@ -303,11 +303,11 @@ bool QgsStyleV2ManagerDialog::addColorRamp() void QgsStyleV2ManagerDialog::editItem() { - if( currentItemType() < 3 ) + if ( currentItemType() < 3 ) { editSymbol(); } - else if( currentItemType() == 3 ) + else if ( currentItemType() == 3 ) { editColorRamp(); } @@ -322,14 +322,14 @@ void QgsStyleV2ManagerDialog::editItem() bool QgsStyleV2ManagerDialog::editSymbol() { QString symbolName = currentItemName(); - if( symbolName.isEmpty() ) + if ( symbolName.isEmpty() ) return false; QgsSymbolV2* symbol = mStyle->symbol( symbolName ); // let the user edit the symbol and update list when done QgsSymbolV2PropertiesDialog dlg( symbol, this ); - if( dlg.exec() == 0 ) + if ( dlg.exec() == 0 ) { delete symbol; return false; @@ -344,36 +344,36 @@ bool QgsStyleV2ManagerDialog::editSymbol() bool QgsStyleV2ManagerDialog::editColorRamp() { QString name = currentItemName(); - if( name.isEmpty() ) + if ( name.isEmpty() ) return false; QgsVectorColorRampV2* ramp = mStyle->colorRamp( name ); - if( ramp->type() == "gradient" ) + if ( ramp->type() == "gradient" ) { QgsVectorGradientColorRampV2* gradRamp = static_cast( ramp ); QgsVectorGradientColorRampV2Dialog dlg( gradRamp, this ); - if( !dlg.exec() ) + if ( !dlg.exec() ) { delete ramp; return false; } } - else if( ramp->type() == "random" ) + else if ( ramp->type() == "random" ) { QgsVectorRandomColorRampV2* randRamp = static_cast( ramp ); QgsVectorRandomColorRampV2Dialog dlg( randRamp, this ); - if( !dlg.exec() ) + if ( !dlg.exec() ) { delete ramp; return false; } } - else if( ramp->type() == "colorbrewer" ) + else if ( ramp->type() == "colorbrewer" ) { QgsVectorColorBrewerColorRampV2* brewerRamp = static_cast( ramp ); QgsVectorColorBrewerColorRampV2Dialog dlg( brewerRamp, this ); - if( !dlg.exec() ) + if ( !dlg.exec() ) { delete ramp; return false; @@ -392,11 +392,11 @@ bool QgsStyleV2ManagerDialog::editColorRamp() void QgsStyleV2ManagerDialog::removeItem() { - if( currentItemType() < 3 ) + if ( currentItemType() < 3 ) { removeSymbol(); } - else if( currentItemType() == 3 ) + else if ( currentItemType() == 3 ) { removeColorRamp(); } @@ -412,7 +412,7 @@ void QgsStyleV2ManagerDialog::removeItem() bool QgsStyleV2ManagerDialog::removeSymbol() { QString symbolName = currentItemName(); - if( symbolName.isEmpty() ) + if ( symbolName.isEmpty() ) return false; // delete from style and update list @@ -424,7 +424,7 @@ bool QgsStyleV2ManagerDialog::removeSymbol() bool QgsStyleV2ManagerDialog::removeColorRamp() { QString rampName = currentItemName(); - if( rampName.isEmpty() ) + if ( rampName.isEmpty() ) return false; mStyle->removeColorRamp( rampName ); diff --git a/src/providers/spatialite/qgsspatialiteprovider.cpp b/src/providers/spatialite/qgsspatialiteprovider.cpp index e17924f1193..96575b697a1 100644 --- a/src/providers/spatialite/qgsspatialiteprovider.cpp +++ b/src/providers/spatialite/qgsspatialiteprovider.cpp @@ -186,8 +186,9 @@ void QgsSpatiaLiteProvider::loadFields() fieldType = QVariant::Int; } else if ( strcasecmp( type, "real" ) == 0 || - strcasecmp( type, "double" ) == 0 || - strcasecmp( type, "double precision" ) == 0 || strcasecmp( type, "float" ) == 0 ) + strcasecmp( type, "double" ) == 0 || + strcasecmp( type, "double precision" ) == 0 || + strcasecmp( type, "float" ) == 0 ) { fieldType = QVariant::Double; } @@ -198,72 +199,73 @@ void QgsSpatiaLiteProvider::loadFields() } sqlite3_free_table( results ); } - else - { - sql = QString( "select * from %1 limit 1" ).arg( mQuery ); + else + { + sql = QString( "select * from %1 limit 1" ).arg( mQuery ); - if ( sqlite3_prepare_v2( sqliteHandle, sql.toUtf8().constData(), -1, &stmt, NULL ) != SQLITE_OK ) - { - // some error occurred - QgsDebugMsg( QString( "SQLite error: %1\n\nSQL: %2" ) - .arg( sql ) - .arg( QString::fromUtf8( sqlite3_errmsg( sqliteHandle ) ) ) ); - return; - } + if ( sqlite3_prepare_v2( sqliteHandle, sql.toUtf8().constData(), -1, &stmt, NULL ) != SQLITE_OK ) + { + // some error occurred + QgsDebugMsg( QString( "SQLite error: %1\n\nSQL: %2" ) + .arg( sql ) + .arg( QString::fromUtf8( sqlite3_errmsg( sqliteHandle ) ) ) ); + return; + } - ret = sqlite3_step( stmt ); - if ( ret == SQLITE_DONE ) - { - // there are no rows to fetch - sqlite3_finalize( stmt ); - return; - } + ret = sqlite3_step( stmt ); + if ( ret == SQLITE_DONE ) + { + // there are no rows to fetch + sqlite3_finalize( stmt ); + return; + } - if ( ret == SQLITE_ROW ) - { - // one valid row has been fetched from the result set - columns = sqlite3_column_count( stmt ); - for ( i = 0; i < columns; i++ ) - { - QString name = QString::fromUtf8( sqlite3_column_name( stmt, i ) ); - const char *type = sqlite3_column_decltype( stmt, i ); - if ( type == NULL ) - type = "TEXT"; + if ( ret == SQLITE_ROW ) + { + // one valid row has been fetched from the result set + columns = sqlite3_column_count( stmt ); + for ( i = 0; i < columns; i++ ) + { + QString name = QString::fromUtf8( sqlite3_column_name( stmt, i ) ); + const char *type = sqlite3_column_decltype( stmt, i ); + if ( type == NULL ) + type = "TEXT"; - if ( name != mPrimaryKey ) - { - pkCount++; - pkName = name; - } + if ( name != mPrimaryKey ) + { + pkCount++; + pkName = name; + } - if ( name != mGeometryColumn ) - { - // for sure any SQLite value can be represented as SQLITE_TEXT - QVariant::Type fieldType = QVariant::String; + if ( name != mGeometryColumn ) + { + // for sure any SQLite value can be represented as SQLITE_TEXT + QVariant::Type fieldType = QVariant::String; - // making some assumptions in order to guess a more realistic type - if ( strcasecmp( type, "int" ) == 0 || - strcasecmp( type, "integer" ) == 0 || - strcasecmp( type, "bigint" ) == 0 || - strcasecmp( type, "smallint" ) == 0 || - strcasecmp( type, "tinyint" ) == 0 || - strcasecmp( type, "boolean" ) == 0 ) - { - fieldType = QVariant::Int; - } - else if ( strcasecmp( type, "real" ) == 0 || - strcasecmp( type, "double" ) == 0 || - strcasecmp( type, "double precision" ) == 0 || strcasecmp( type, "float" ) == 0 ) - { - fieldType = QVariant::Double; - } + // making some assumptions in order to guess a more realistic type + if ( strcasecmp( type, "int" ) == 0 || + strcasecmp( type, "integer" ) == 0 || + strcasecmp( type, "bigint" ) == 0 || + strcasecmp( type, "smallint" ) == 0 || + strcasecmp( type, "tinyint" ) == 0 || + strcasecmp( type, "boolean" ) == 0 ) + { + fieldType = QVariant::Int; + } + else if ( strcasecmp( type, "real" ) == 0 || + strcasecmp( type, "double" ) == 0 || + strcasecmp( type, "double precision" ) == 0 || + strcasecmp( type, "float" ) == 0 ) + { + fieldType = QVariant::Double; + } - attributeFields.insert( fldNo++, QgsField( name, fieldType, type, 0, 0, "" ) ); - } - } - } - sqlite3_finalize( stmt ); - } + attributeFields.insert( fldNo++, QgsField( name, fieldType, type, 0, 0, "" ) ); + } + } + } + sqlite3_finalize( stmt ); + } if ( pkCount == 1 ) { @@ -295,9 +297,9 @@ bool QgsSpatiaLiteProvider::featureAtId( int featureId, QgsFeature & feature, bo feature.setValid( false ); - QString primaryKey = !isQuery ? "ROWID" : quotedIdentifier( mPrimaryKey ); + QString primaryKey = !isQuery ? "ROWID" : quotedIdentifier( mPrimaryKey ); - QString sql = QString( "SELECT %1" ).arg( primaryKey ); + QString sql = QString( "SELECT %1" ).arg( primaryKey ); for ( QgsAttributeList::const_iterator it = fetchAttributes.constBegin(); it != fetchAttributes.constEnd(); ++it ) { const QgsField & fld = field( *it ); @@ -308,10 +310,10 @@ bool QgsSpatiaLiteProvider::featureAtId( int featureId, QgsFeature & feature, bo { sql += QString( ", AsBinary(%1)" ).arg( quotedIdentifier( mGeometryColumn ) ); } - sql += QString( " FROM %1 WHERE %2 = %3" ) - .arg( mQuery ) - .arg( primaryKey ) - .arg( featureId ); + sql += QString( " FROM %1 WHERE %2 = %3" ) + .arg( mQuery ) + .arg( primaryKey ) + .arg( featureId ); if ( sqlite3_prepare_v2( sqliteHandle, sql.toUtf8().constData(), -1, &stmt, NULL ) != SQLITE_OK ) { @@ -601,9 +603,9 @@ void QgsSpatiaLiteProvider::select( QgsAttributeList fetchAttributes, QgsRectang sqliteStatement = NULL; } - QString primaryKey = !isQuery ? "ROWID" : quotedIdentifier( mPrimaryKey ); + QString primaryKey = !isQuery ? "ROWID" : quotedIdentifier( mPrimaryKey ); - QString sql = QString( "SELECT %1" ).arg( primaryKey ); + QString sql = QString( "SELECT %1" ).arg( primaryKey ); for ( QgsAttributeList::const_iterator it = fetchAttributes.constBegin(); it != fetchAttributes.constEnd(); ++it ) { const QgsField & fld = field( *it ); @@ -650,10 +652,10 @@ void QgsSpatiaLiteProvider::select( QgsAttributeList fetchAttributes, QgsRectang mbrFilter += QString( "ymin <= %1 AND " ).arg( QString::number( rect.yMaximum(), 'f', 6 ) ); mbrFilter += QString( "ymax >= %1" ).arg( QString::number( rect.yMinimum(), 'f', 6 ) ); QString idxName = QString( "idx_%1_%2" ).arg( mIndexTable ).arg( mIndexGeometry ); - whereClause += QString( "%1 IN (SELECT pkid FROM %2 WHERE %3)" ) - .arg( quotedIdentifier( primaryKey ) ) - .arg( quotedIdentifier( idxName ) ) - .arg( mbrFilter ); + whereClause += QString( "%1 IN (SELECT pkid FROM %2 WHERE %3)" ) + .arg( quotedIdentifier( primaryKey ) ) + .arg( quotedIdentifier( idxName ) ) + .arg( mbrFilter ); } else if ( spatialIndexMbrCache ) { @@ -663,10 +665,10 @@ void QgsSpatiaLiteProvider::select( QgsAttributeList fetchAttributes, QgsRectang arg( QString::number( rect.yMinimum(), 'f', 6 ) ). arg( QString::number( rect.xMaximum(), 'f', 6 ) ).arg( QString::number( rect.yMaximum(), 'f', 6 ) ); QString idxName = QString( "cache_%1_%2" ).arg( mIndexTable ).arg( mIndexGeometry ); - whereClause += QString( "%1 IN (SELECT rowid FROM %2 WHERE mbr = FilterMbrIntersects(%3))" ) - .arg( quotedIdentifier( primaryKey ) ) - .arg( quotedIdentifier( idxName ) ) - .arg( mbr ); + whereClause += QString( "%1 IN (SELECT rowid FROM %2 WHERE mbr = FilterMbrIntersects(%3))" ) + .arg( quotedIdentifier( primaryKey ) ) + .arg( quotedIdentifier( idxName ) ) + .arg( mbr ); } else { @@ -798,7 +800,7 @@ QVariant QgsSpatiaLiteProvider::minimumValue( int index ) // get the field name const QgsField & fld = field( index ); - QString sql = QString( "SELECT Min(%1) FROM %2" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery ); + QString sql = QString( "SELECT Min(%1) FROM %2" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery ); if ( !mSubsetString.isEmpty() ) { @@ -853,7 +855,7 @@ QVariant QgsSpatiaLiteProvider::maximumValue( int index ) // get the field name const QgsField & fld = field( index ); - QString sql = QString( "SELECT Max(%1) FROM %2" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery ); + QString sql = QString( "SELECT Max(%1) FROM %2" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery ); if ( !mSubsetString.isEmpty() ) { @@ -906,7 +908,7 @@ void QgsSpatiaLiteProvider::uniqueValues( int index, QList < QVariant > &uniqueV // get the field name const QgsField & fld = field( index ); - sql = QString( "SELECT DISTINCT %1 FROM %2 ORDER BY %1" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery ); + sql = QString( "SELECT DISTINCT %1 FROM %2 ORDER BY %1" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery ); if ( !mSubsetString.isEmpty() ) { @@ -1682,48 +1684,48 @@ bool QgsSpatiaLiteProvider::checkLayerType() } sqlite3_free_table( results ); - // checking if this one is a select query - if ( mQuery.startsWith( "(select", Qt::CaseInsensitive ) && - mQuery.endsWith( ")" ) ) - { - // get a new alias for the subquery - int index = 0; - QString alias; - QRegExp regex; - do - { - alias = QString( "subQuery_%1" ).arg( QString::number( index++ ) ); - QString pattern = QString( "(\\\"?)%1\\1" ).arg( QRegExp::escape( alias ) ); - regex.setPattern( pattern ); - regex.setCaseSensitivity( Qt::CaseInsensitive ); - } - while ( mQuery.contains( regex ) ); + // checking if this one is a select query + if ( mQuery.startsWith( "(select", Qt::CaseInsensitive ) && + mQuery.endsWith( ")" ) ) + { + // get a new alias for the subquery + int index = 0; + QString alias; + QRegExp regex; + do + { + alias = QString( "subQuery_%1" ).arg( QString::number( index++ ) ); + QString pattern = QString( "(\\\"?)%1\\1" ).arg( QRegExp::escape( alias ) ); + regex.setPattern( pattern ); + regex.setCaseSensitivity( Qt::CaseInsensitive ); + } + while ( mQuery.contains( regex ) ); - // convert the custom query into a subquery - mQuery = QString( "%1 as %2" ) - .arg( mQuery ) - .arg( quotedIdentifier( alias ) ); + // convert the custom query into a subquery + mQuery = QString( "%1 as %2" ) + .arg( mQuery ) + .arg( quotedIdentifier( alias ) ); - sql = QString( "SELECT 0 FROM %1 LIMIT 1" ).arg( mQuery ); - ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); - if ( ret == SQLITE_OK && rows == 1 ) - { - isQuery = true; - mReadOnly = true; - count++; - } - if ( errMsg ) - { - QgsDebugMsg( QString( "sqlite error %1 [%2]" ).arg( sql ).arg( errMsg ) ); - sqlite3_free( errMsg ); - errMsg = 0; - } - sqlite3_free_table( results ); - } - else - { - mQuery = quotedIdentifier( mTableName ); - } + sql = QString( "SELECT 0 FROM %1 LIMIT 1" ).arg( mQuery ); + ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); + if ( ret == SQLITE_OK && rows == 1 ) + { + isQuery = true; + mReadOnly = true; + count++; + } + if ( errMsg ) + { + QgsDebugMsg( QString( "sqlite error %1 [%2]" ).arg( sql ).arg( errMsg ) ); + sqlite3_free( errMsg ); + errMsg = 0; + } + sqlite3_free_table( results ); + } + else + { + mQuery = quotedIdentifier( mTableName ); + } // checking for validity return count == 1; @@ -1738,8 +1740,8 @@ bool QgsSpatiaLiteProvider::getGeometryDetails() ret = getViewGeometryDetails(); if ( mVShapeBased ) ret = getVShapeGeometryDetails(); - if ( isQuery ) - ret = getQueryGeometryDetails(); + if ( isQuery ) + ret = getQueryGeometryDetails(); return ret; } @@ -1978,122 +1980,122 @@ error: return false; } -bool QgsSpatiaLiteProvider::getQueryGeometryDetails() -{ - int ret; - int i; - char **results; - int rows; - int columns; - char *errMsg = NULL; - - QString fType( "" ); - QString xSrid( "" ); - - // get stuff from the relevant column instead. This may (will?) - // fail if there is no data in the relevant table. - QString sql = QString( "select srid(%1), geometrytype(%1) from %2" ) - .arg( quotedIdentifier( mGeometryColumn ) ) - .arg( mQuery ); - - //it is possible that the where clause restricts the feature type - if ( !mSubsetString.isEmpty() ) - { - sql += " WHERE " + mSubsetString; - } - - sql += " limit 1"; - - ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); - if ( ret != SQLITE_OK ) - goto error; - if ( rows < 1 ) - ; - else - { - for ( i = 1; i <= rows; i++ ) - { - xSrid = results[( i * columns ) + 0]; - fType = results[( i * columns ) + 1]; - } - } - sqlite3_free_table( results ); - - if ( !xSrid.isEmpty() && !fType.isEmpty() ) - { - if ( fType == "GEOMETRY" ) - { - // check to see if there is a unique geometry type - sql = QString( "select distinct " - "case" - " when geometrytype(%1) IN ('POINT','MULTIPOINT') THEN 'POINT'" - " when geometrytype(%1) IN ('LINESTRING','MULTILINESTRING') THEN 'LINESTRING'" - " when geometrytype(%1) IN ('POLYGON','MULTIPOLYGON') THEN 'POLYGON'" - " end " - "from %2" ) - .arg( quotedIdentifier( mGeometryColumn ) ) - .arg( mQuery ); - - if ( !mSubsetString.isEmpty() ) - sql += " where " + mSubsetString; - - ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); - if ( ret != SQLITE_OK ) - goto error; - if ( rows != 1 ) - ; - else - { - for ( i = 1; i <= rows; i++ ) - { - fType = results[( 1 * columns ) + 0]; - } - } - sqlite3_free_table( results ); - } - - if ( fType == "POINT" ) - { - geomType = QGis::WKBPoint; - } - else if ( fType == "MULTIPOINT" ) - { - geomType = QGis::WKBMultiPoint; - } - else if ( fType == "LINESTRING" ) - { - geomType = QGis::WKBLineString; - } - else if ( fType == "MULTILINESTRING" ) - { - geomType = QGis::WKBMultiLineString; - } - else if ( fType == "POLYGON" ) - { - geomType = QGis::WKBPolygon; - } - else if ( fType == "MULTIPOLYGON" ) - { - geomType = QGis::WKBMultiPolygon; - } - mSrid = xSrid.toInt(); - } - - if ( geomType == QGis::WKBUnknown || mSrid < 0 ) - goto error; - - return getSridDetails(); - -error: - // unexpected error - if ( errMsg != NULL ) - { - QgsDebugMsg( QString( "SQL error: %1\n\n%2" ).arg( sql ).arg( errMsg ? QString::fromUtf8( errMsg ) : "unknown cause" ) ); - sqlite3_free( errMsg ); - } - return false; -} - +bool QgsSpatiaLiteProvider::getQueryGeometryDetails() +{ + int ret; + int i; + char **results; + int rows; + int columns; + char *errMsg = NULL; + + QString fType( "" ); + QString xSrid( "" ); + + // get stuff from the relevant column instead. This may (will?) + // fail if there is no data in the relevant table. + QString sql = QString( "select srid(%1), geometrytype(%1) from %2" ) + .arg( quotedIdentifier( mGeometryColumn ) ) + .arg( mQuery ); + + //it is possible that the where clause restricts the feature type + if ( !mSubsetString.isEmpty() ) + { + sql += " WHERE " + mSubsetString; + } + + sql += " limit 1"; + + ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); + if ( ret != SQLITE_OK ) + goto error; + if ( rows < 1 ) + ; + else + { + for ( i = 1; i <= rows; i++ ) + { + xSrid = results[( i * columns ) + 0]; + fType = results[( i * columns ) + 1]; + } + } + sqlite3_free_table( results ); + + if ( !xSrid.isEmpty() && !fType.isEmpty() ) + { + if ( fType == "GEOMETRY" ) + { + // check to see if there is a unique geometry type + sql = QString( "select distinct " + "case" + " when geometrytype(%1) IN ('POINT','MULTIPOINT') THEN 'POINT'" + " when geometrytype(%1) IN ('LINESTRING','MULTILINESTRING') THEN 'LINESTRING'" + " when geometrytype(%1) IN ('POLYGON','MULTIPOLYGON') THEN 'POLYGON'" + " end " + "from %2" ) + .arg( quotedIdentifier( mGeometryColumn ) ) + .arg( mQuery ); + + if ( !mSubsetString.isEmpty() ) + sql += " where " + mSubsetString; + + ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); + if ( ret != SQLITE_OK ) + goto error; + if ( rows != 1 ) + ; + else + { + for ( i = 1; i <= rows; i++ ) + { + fType = results[( 1 * columns ) + 0]; + } + } + sqlite3_free_table( results ); + } + + if ( fType == "POINT" ) + { + geomType = QGis::WKBPoint; + } + else if ( fType == "MULTIPOINT" ) + { + geomType = QGis::WKBMultiPoint; + } + else if ( fType == "LINESTRING" ) + { + geomType = QGis::WKBLineString; + } + else if ( fType == "MULTILINESTRING" ) + { + geomType = QGis::WKBMultiLineString; + } + else if ( fType == "POLYGON" ) + { + geomType = QGis::WKBPolygon; + } + else if ( fType == "MULTIPOLYGON" ) + { + geomType = QGis::WKBMultiPolygon; + } + mSrid = xSrid.toInt(); + } + + if ( geomType == QGis::WKBUnknown || mSrid < 0 ) + goto error; + + return getSridDetails(); + +error: + // unexpected error + if ( errMsg != NULL ) + { + QgsDebugMsg( QString( "SQL error: %1\n\n%2" ).arg( sql ).arg( errMsg ? QString::fromUtf8( errMsg ) : "unknown cause" ) ); + sqlite3_free( errMsg ); + } + return false; +} + bool QgsSpatiaLiteProvider::getSridDetails() { int ret; @@ -2140,9 +2142,9 @@ bool QgsSpatiaLiteProvider::getTableSummary() int columns; char *errMsg = NULL; - QString sql = QString( "SELECT Min(MbrMinX(%1)), Min(MbrMinY(%1)), " - "Max(MbrMaxX(%1)), Max(MbrMaxY(%1)), Count(*) " "FROM %2" ) - .arg( quotedIdentifier( mGeometryColumn ) ) + QString sql = QString( "SELECT Min(MbrMinX(%1)), Min(MbrMinY(%1)), " + "Max(MbrMaxX(%1)), Max(MbrMaxY(%1)), Count(*) " "FROM %2" ) + .arg( quotedIdentifier( mGeometryColumn ) ) .arg( mQuery ); if ( !mSubsetString.isEmpty() ) diff --git a/src/providers/spatialite/qgsspatialiteprovider.h b/src/providers/spatialite/qgsspatialiteprovider.h index 9153fb40af9..5b3f59fa4c1 100644 --- a/src/providers/spatialite/qgsspatialiteprovider.h +++ b/src/providers/spatialite/qgsspatialiteprovider.h @@ -266,10 +266,10 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider * Flag indicating if the layer data source is a valid SpatiaLite layer */ bool valid; - /** - * Flag indicating if the layer data source is based on a query - */ - bool isQuery; + /** + * Flag indicating if the layer data source is based on a query + */ + bool isQuery; /** * Flag indicating if the layer data source is based on a plain Table */ diff --git a/tests/src/core/testqgsvectorlayer.cpp b/tests/src/core/testqgsvectorlayer.cpp index 955908bd18d..3189bee793b 100644 --- a/tests/src/core/testqgsvectorlayer.cpp +++ b/tests/src/core/testqgsvectorlayer.cpp @@ -39,7 +39,7 @@ */ class TestQgsVectorLayer: public QObject { - Q_OBJECT; + Q_OBJECT; private: bool mTestHasError; QgsMapRenderer * mpMapRenderer; @@ -79,7 +79,7 @@ class TestQgsVectorLayer: public QObject QString myDbfFileName = mTestDataDir + "nonspatial.dbf"; QFileInfo myDbfFileInfo( myDbfFileName ); mpNonSpatialLayer = new QgsVectorLayer( myDbfFileInfo.filePath(), - myDbfFileInfo.completeBaseName(), "ogr" ); + myDbfFileInfo.completeBaseName(), "ogr" ); // Register the layer with the registry QgsMapLayerRegistry::instance()->addMapLayer( mpNonSpatialLayer ); // @@ -88,7 +88,7 @@ class TestQgsVectorLayer: public QObject QString myPointsFileName = mTestDataDir + "points.shp"; QFileInfo myPointFileInfo( myPointsFileName ); mpPointsLayer = new QgsVectorLayer( myPointFileInfo.filePath(), - myPointFileInfo.completeBaseName(), "ogr" ); + myPointFileInfo.completeBaseName(), "ogr" ); // Register the layer with the registry QgsMapLayerRegistry::instance()->addMapLayer( mpPointsLayer ); @@ -98,7 +98,7 @@ class TestQgsVectorLayer: public QObject QString myPolysFileName = mTestDataDir + "polys.shp"; QFileInfo myPolyFileInfo( myPolysFileName ); mpPolysLayer = new QgsVectorLayer( myPolyFileInfo.filePath(), - myPolyFileInfo.completeBaseName(), "ogr" ); + myPolyFileInfo.completeBaseName(), "ogr" ); // Register the layer with the registry QgsMapLayerRegistry::instance()->addMapLayer( mpPolysLayer ); @@ -109,7 +109,7 @@ class TestQgsVectorLayer: public QObject QString myLinesFileName = mTestDataDir + "lines.shp"; QFileInfo myLineFileInfo( myLinesFileName ); mpLinesLayer = new QgsVectorLayer( myLineFileInfo.filePath(), - myLineFileInfo.completeBaseName(), "ogr" ); + myLineFileInfo.completeBaseName(), "ogr" ); // Register the layer with the registry QgsMapLayerRegistry::instance()->addMapLayer( mpLinesLayer ); // @@ -125,527 +125,527 @@ class TestQgsVectorLayer: public QObject mpMapRenderer->setLayerSet( myLayers ); mReport += "

Vector Renderer Tests

\n"; } - // will be called after the last testfunction was executed. - void cleanupTestCase() - { - QString myReportFile = QDir::tempPath() + QDir::separator() + "renderertest.html"; - QFile myFile( myReportFile ); - if ( myFile.open( QIODevice::WriteOnly ) ) + // will be called after the last testfunction was executed. + void cleanupTestCase() { - QTextStream myQTextStream( &myFile ); - myQTextStream << mReport; - myFile.close(); - QDesktopServices::openUrl( "file://" + myReportFile ); + QString myReportFile = QDir::tempPath() + QDir::separator() + "renderertest.html"; + QFile myFile( myReportFile ); + if ( myFile.open( QIODevice::WriteOnly ) ) + { + QTextStream myQTextStream( &myFile ); + myQTextStream << mReport; + myFile.close(); + QDesktopServices::openUrl( "file://" + myReportFile ); + } + } + void init() {};// will be called before each testfunction is executed. + void cleanup() {};// will be called after every testfunction. - } - void init() {};// will be called before each testfunction is executed. - void cleanup() {};// will be called after every testfunction. - - void QgsVectorLayerNonSpatialIterator() - { - QgsVectorDataProvider * myProvider = mpNonSpatialLayer->dataProvider(); - QgsFeature f; - QgsAttributeList myList; - myList << 0 << 1 << 2 << 3; - int myCount = 0; - myProvider->select( myList ); - while ( myProvider->nextFeature( f ) ) + void QgsVectorLayerNonSpatialIterator() + { + QgsVectorDataProvider * myProvider = mpNonSpatialLayer->dataProvider(); + QgsFeature f; + QgsAttributeList myList; + myList << 0 << 1 << 2 << 3; + int myCount = 0; + myProvider->select( myList ); + while ( myProvider->nextFeature( f ) ) + { + qDebug( "Getting feature from provider" ); + myCount++; + } + QVERIFY( myCount == 3 ); + }; + + void QgsVectorLayerstorageType() + { + + }; + void QgsVectorLayercapabilitiesString() + { + + }; + void QgsVectorLayerdataComment() + { + + }; + void QgsVectorLayerproviderType() + { + + }; + void QgsVectorLayersetDisplayField() + { + + }; + void QgsVectorLayerdrawLabels() + { + + }; + void QgsVectorLayerdrawLineString() + { + + }; + void QgsVectorLayerdrawPolygon() + { + + }; + void QgsVectorLayerdrawRendererV2() + { + + }; + void QgsVectorLayerdrawRendererV2Levels() + { + + }; + void QgsVectorLayerreload() + { + + }; + void QgsVectorLayerdraw() + { + + }; + void QgsVectorLayerdeleteCachedGeometries() + { + + }; + void QgsVectorLayerdrawVertexMarker() + { + + }; + void QgsVectorLayerselect() + { + + }; + void QgsVectorLayerinvertSelection() + { + + }; + void QgsVectorLayerinvertSelectionInRectangle() + { + + }; + void QgsVectorLayerremoveSelection() + { + + }; + void QgsVectorLayertriggerRepaint() + { + + }; + void QgsVectorLayerdataProvider() + { + + }; + void QgsVectorLayersetProviderEncoding() + { + + }; + void QgsVectorLayerrenderer() + { + + }; + void QgsVectorLayersetRenderer() + { + + }; + void QgsVectorLayergeometryType() { - qDebug("Getting feature from provider"); - myCount++; - } - QVERIFY( myCount == 3 ); - }; - void QgsVectorLayerstorageType() - { + }; + void QgsVectorLayerwkbType() + { - }; - void QgsVectorLayercapabilitiesString() - { + }; + void QgsVectorLayerboundingBoxOfSelected() + { - }; - void QgsVectorLayerdataComment() - { + }; + void QgsVectorLayerfeatureCount() + { - }; - void QgsVectorLayerproviderType() - { + }; + void QgsVectorLayerupdateFeatureCount() + { - }; - void QgsVectorLayersetDisplayField() - { + }; + void QgsVectorLayerupdateExtents() + { - }; - void QgsVectorLayerdrawLabels() - { + }; + void QgsVectorLayersubsetString() + { - }; - void QgsVectorLayerdrawLineString() - { + }; + void QgsVectorLayersetSubsetString() + { - }; - void QgsVectorLayerdrawPolygon() - { + }; + void QgsVectorLayerupdateFeatureAttributes() + { - }; - void QgsVectorLayerdrawRendererV2() - { + }; + void QgsVectorLayerupdateFeatureGeometry() + { - }; - void QgsVectorLayerdrawRendererV2Levels() - { + }; + void QgsVectorLayernextFeature() + { - }; - void QgsVectorLayerreload() - { + }; + void QgsVectorLayerfeatureAtId() + { - }; - void QgsVectorLayerdraw() - { + }; + void QgsVectorLayeraddFeature() + { - }; - void QgsVectorLayerdeleteCachedGeometries() - { + }; + void QgsVectorLayerinsertVertex() + { - }; - void QgsVectorLayerdrawVertexMarker() - { + }; + void QgsVectorLayermoveVertex() + { - }; - void QgsVectorLayerselect() - { + }; + void QgsVectorLayerdeleteVertex() + { - }; - void QgsVectorLayerinvertSelection() - { + }; + void QgsVectorLayerdeleteSelectedFeatures() + { - }; - void QgsVectorLayerinvertSelectionInRectangle() - { + }; + void QgsVectorLayeraddRing() + { - }; - void QgsVectorLayerremoveSelection() - { + }; + void QgsVectorLayeraddIsland() + { - }; - void QgsVectorLayertriggerRepaint() - { + }; + void QgsVectorLayertranslateFeature() + { - }; - void QgsVectorLayerdataProvider() - { + }; + void QgsVectorLayersplitFeatures() + { - }; - void QgsVectorLayersetProviderEncoding() - { + }; + void QgsVectorLayerremovePolygonIntersections() + { - }; - void QgsVectorLayerrenderer() - { + }; + void QgsVectorLayeraddTopologicalPoints() + { - }; - void QgsVectorLayersetRenderer() - { + }; + void QgsVectorLayerlabel() + { - }; - void QgsVectorLayergeometryType() - { + }; + void QgsVectorLayerenableLabels() + { - }; - void QgsVectorLayerwkbType() - { + }; + void QgsVectorLayerhasLabelsEnabled() + { - }; - void QgsVectorLayerboundingBoxOfSelected() - { + }; + void QgsVectorLayerstartEditing() + { - }; - void QgsVectorLayerfeatureCount() - { + }; + void QgsVectorLayerreadXml() + { - }; - void QgsVectorLayerupdateFeatureCount() - { + }; + void QgsVectorLayersetDataProvider() + { - }; - void QgsVectorLayerupdateExtents() - { + }; + void QgsVectorLayerwriteXml() + { - }; - void QgsVectorLayersubsetString() - { + }; + void QgsVectorLayerreadSymbology() + { - }; - void QgsVectorLayersetSubsetString() - { + }; + void QgsVectorLayerwriteSymbology() + { - }; - void QgsVectorLayerupdateFeatureAttributes() - { + }; + void QgsVectorLayerchangeGeometry() + { - }; - void QgsVectorLayerupdateFeatureGeometry() - { + }; + void QgsVectorLayerchangeAttributeValue() + { - }; - void QgsVectorLayernextFeature() - { + }; + void QgsVectorLayeraddAttribute() + { - }; - void QgsVectorLayerfeatureAtId() - { + }; + void QgsVectorLayeraddAttributeAlias() + { - }; - void QgsVectorLayeraddFeature() - { + }; + void QgsVectorLayerattributeAlias() + { - }; - void QgsVectorLayerinsertVertex() - { + }; + void QgsVectorLayerattributeDisplayName() + { - }; - void QgsVectorLayermoveVertex() - { + }; + void QgsVectorLayerdeleteAttribute() + { - }; - void QgsVectorLayerdeleteVertex() - { + }; + void QgsVectorLayerdeleteFeature() + { - }; - void QgsVectorLayerdeleteSelectedFeatures() - { + }; + void QgsVectorLayerpendingFields() + { - }; - void QgsVectorLayeraddRing() - { + }; + void QgsVectorLayerpendingAllAttributesList() + { - }; - void QgsVectorLayeraddIsland() - { + }; + void QgsVectorLayerpendingFeatureCount() + { - }; - void QgsVectorLayertranslateFeature() - { + }; + void QgsVectorLayercommitChanges() + { - }; - void QgsVectorLayersplitFeatures() - { + }; + void QgsVectorLayercommitErrors() + { - }; - void QgsVectorLayerremovePolygonIntersections() - { + }; + void QgsVectorLayerrollBack() + { - }; - void QgsVectorLayeraddTopologicalPoints() - { + }; + void QgsVectorLayersetSelectedFeatures() + { - }; - void QgsVectorLayerlabel() - { + }; + void QgsVectorLayerselectedFeatureCount() + { - }; - void QgsVectorLayerenableLabels() - { + }; + void QgsVectorLayerselectedFeaturesIds() + { - }; - void QgsVectorLayerhasLabelsEnabled() - { + }; + void QgsVectorLayerselectedFeatures() + { - }; - void QgsVectorLayerstartEditing() - { + }; + void QgsVectorLayeraddFeatures() + { - }; - void QgsVectorLayerreadXml() - { + }; + void QgsVectorLayercopySymbologySettings() + { - }; - void QgsVectorLayersetDataProvider() - { + }; + void QgsVectorLayerhasCompatibleSymbology() + { - }; - void QgsVectorLayerwriteXml() - { + }; + void QgsVectorLayersnapPoint() + { - }; - void QgsVectorLayerreadSymbology() - { + }; + void QgsVectorLayersnapWithContext() + { - }; - void QgsVectorLayerwriteSymbology() - { + }; + void QgsVectorLayersnapToGeometry() + { - }; - void QgsVectorLayerchangeGeometry() - { + }; + void QgsVectorLayerinsertSegmentVerticesForSnap() + { - }; - void QgsVectorLayerchangeAttributeValue() - { + }; + void QgsVectorLayerboundingBoxFromPointList() + { - }; - void QgsVectorLayeraddAttribute() - { + }; + void QgsVectorLayercurrentVertexMarkerType() + { - }; - void QgsVectorLayeraddAttributeAlias() - { + }; + void QgsVectorLayercurrentVertexMarkerSize() + { - }; - void QgsVectorLayerattributeAlias() - { + }; + void QgsVectorLayerdrawFeature() + { - }; - void QgsVectorLayerattributeDisplayName() - { + }; + void QgsVectorLayersetCoordinateSystem() + { - }; - void QgsVectorLayerdeleteAttribute() - { + }; + void QgsVectorLayertransformPoint() + { - }; - void QgsVectorLayerdeleteFeature() - { + }; + void QgsVectorLayertransformPoints() + { - }; - void QgsVectorLayerpendingFields() - { + }; + void QgsVectorLayerdisplayField() + { - }; - void QgsVectorLayerpendingAllAttributesList() - { + }; + void QgsVectorLayerisEditable() + { - }; - void QgsVectorLayerpendingFeatureCount() - { + }; + void QgsVectorLayerisModified() + { - }; - void QgsVectorLayercommitChanges() - { + }; + void QgsVectorLayersetModified() + { - }; - void QgsVectorLayercommitErrors() - { + }; + void QgsVectorLayereditType() + { - }; - void QgsVectorLayerrollBack() - { + }; + void QgsVectorLayersetEditType() + { - }; - void QgsVectorLayersetSelectedFeatures() - { + }; + void QgsVectorLayereditForm() + { - }; - void QgsVectorLayerselectedFeatureCount() - { + }; + void QgsVectorLayersetEditForm() + { - }; - void QgsVectorLayerselectedFeaturesIds() - { + }; + void QgsVectorLayersetAnnotationForm() + { - }; - void QgsVectorLayerselectedFeatures() - { + }; + void QgsVectorLayereditFormInit() + { - }; - void QgsVectorLayeraddFeatures() - { + }; + void QgsVectorLayersetEditFormInit() + { - }; - void QgsVectorLayercopySymbologySettings() - { + }; + void QgsVectorLayervalueMap() + { - }; - void QgsVectorLayerhasCompatibleSymbology() - { + }; + void QgsVectorLayerrange() + { - }; - void QgsVectorLayersnapPoint() - { + }; + void QgsVectorLayeraddOverlay() + { - }; - void QgsVectorLayersnapWithContext() - { + }; + void QgsVectorLayerremoveOverlay() + { - }; - void QgsVectorLayersnapToGeometry() - { + }; + void QgsVectorLayervectorOverlays() + { - }; - void QgsVectorLayerinsertSegmentVerticesForSnap() - { + }; + void QgsVectorLayerfindOverlayByType() + { - }; - void QgsVectorLayerboundingBoxFromPointList() - { + }; + void QgsVectorLayerrendererV2() + { - }; - void QgsVectorLayercurrentVertexMarkerType() - { + }; + void QgsVectorLayersetRendererV2() + { - }; - void QgsVectorLayercurrentVertexMarkerSize() - { + }; + void QgsVectorLayerisUsingRendererV2() + { - }; - void QgsVectorLayerdrawFeature() - { + }; + void QgsVectorLayersetUsingRendererV2() + { - }; - void QgsVectorLayersetCoordinateSystem() - { + }; + void QgsVectorLayereditGeometryChange() + { - }; - void QgsVectorLayertransformPoint() - { + }; + void QgsVectorLayereditFeatureAdd() + { - }; - void QgsVectorLayertransformPoints() - { + }; + void QgsVectorLayereditFeatureDelete() + { - }; - void QgsVectorLayerdisplayField() - { + }; + void QgsVectorLayereditAttributeChange() + { - }; - void QgsVectorLayerisEditable() - { + }; + void QgsVectorLayerbeginEditCommand() + { - }; - void QgsVectorLayerisModified() - { + }; + void QgsVectorLayerendEditCommand() + { - }; - void QgsVectorLayersetModified() - { + }; + void QgsVectorLayerdestroyEditCommand() + { - }; - void QgsVectorLayereditType() - { + }; + void QgsVectorLayerredoEditCommand() + { - }; - void QgsVectorLayersetEditType() - { + }; + void QgsVectorLayerundoEditCommand() + { - }; - void QgsVectorLayereditForm() - { + }; + void QgsVectorLayersetCheckedState() + { - }; - void QgsVectorLayersetEditForm() - { + }; + void QgsVectorLayercheckedState() + { - }; - void QgsVectorLayersetAnnotationForm() - { + }; + void QgsVectorLayerfieldNameIndex() + { - }; - void QgsVectorLayereditFormInit() - { + }; + void QgsVectorLayerstopRendererV2() + { - }; - void QgsVectorLayersetEditFormInit() - { - - }; - void QgsVectorLayervalueMap() - { - - }; - void QgsVectorLayerrange() - { - - }; - void QgsVectorLayeraddOverlay() - { - - }; - void QgsVectorLayerremoveOverlay() - { - - }; - void QgsVectorLayervectorOverlays() - { - - }; - void QgsVectorLayerfindOverlayByType() - { - - }; - void QgsVectorLayerrendererV2() - { - - }; - void QgsVectorLayersetRendererV2() - { - - }; - void QgsVectorLayerisUsingRendererV2() - { - - }; - void QgsVectorLayersetUsingRendererV2() - { - - }; - void QgsVectorLayereditGeometryChange() - { - - }; - void QgsVectorLayereditFeatureAdd() - { - - }; - void QgsVectorLayereditFeatureDelete() - { - - }; - void QgsVectorLayereditAttributeChange() - { - - }; - void QgsVectorLayerbeginEditCommand() - { - - }; - void QgsVectorLayerendEditCommand() - { - - }; - void QgsVectorLayerdestroyEditCommand() - { - - }; - void QgsVectorLayerredoEditCommand() - { - - }; - void QgsVectorLayerundoEditCommand() - { - - }; - void QgsVectorLayersetCheckedState() - { - - }; - void QgsVectorLayercheckedState() - { - - }; - void QgsVectorLayerfieldNameIndex() - { - - }; - void QgsVectorLayerstopRendererV2() - { - - }; + }; }; -QTEST_MAIN(TestQgsVectorLayer) +QTEST_MAIN( TestQgsVectorLayer ) #include "moc_testqgsvectorlayer.cxx"