Skip to content

Commit

Permalink
Merge remote-tracking branch 'jef/oraclespatial-nva' into new_vector_api
Browse files Browse the repository at this point in the history
Conflicts:
	doc/TRANSLATORS
	i18n/qgis_de.ts
	src/app/qgisapp.cpp
	src/core/qgis.cpp
	src/core/qgsvectorlayerimport.cpp
	src/providers/oracle/CMakeLists.txt
	src/providers/oracle/qgsoracleprovider.cpp
	src/providers/oracle/qgsoracleprovider.h
  • Loading branch information
wonder-sk committed Jan 23, 2013
2 parents 5f304b3 + 0ccff60 commit 985468e
Show file tree
Hide file tree
Showing 12 changed files with 552 additions and 556 deletions.
90 changes: 45 additions & 45 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -100,7 +100,7 @@ QgsVectorLayer::QgsVectorLayer( QString vectorLayerPath,
, mLabel( 0 )
, mLabelOn( false )
, mVertexMarkerOnlyForSelection( false )
, mCache( new QgsVectorLayerCache(this) )
, mCache( new QgsVectorLayerCache( this ) )
, mEditBuffer( 0 )
, mEditorLayout( GeneratedLayout )
, mJoinBuffer( 0 )
Expand Down Expand Up @@ -181,7 +181,7 @@ QgsVectorLayer::~QgsVectorLayer()
{
QgsDebugMsg( "entered." );

if (!mLayerIterator.isClosed())
if ( !mLayerIterator.isClosed() )
mLayerIterator.close();

emit layerDeleted();
Expand Down Expand Up @@ -1671,7 +1671,7 @@ void QgsVectorLayer::select( QgsAttributeList attributes, QgsRectangle rect, boo
if ( attributes != pendingAllAttributesList() )
request.setSubsetOfAttributes( attributes );

if (!mLayerIterator.isClosed())
if ( !mLayerIterator.isClosed() )
mLayerIterator.close();

mLayerIterator = getFeatures( request );
Expand All @@ -1685,7 +1685,7 @@ QgsFeatureIterator QgsVectorLayer::getFeatures( const QgsFeatureRequest& request
if ( !mDataProvider )
return QgsFeatureIterator();

return QgsFeatureIterator( new QgsVectorLayerFeatureIterator(this, request) );
return QgsFeatureIterator( new QgsVectorLayerFeatureIterator( this, request ) );
}


Expand Down Expand Up @@ -1755,7 +1755,7 @@ bool QgsVectorLayer::nextFeature( QgsFeature &f )
QgsFeatureIterator fi = mDataProvider->getFeatures( request );
if ( fi.nextFeature( tmp ) )
{
if (mEditBuffer)
if ( mEditBuffer )
mEditBuffer->updateChangedAttributes( tmp );
f.setAttributes( tmp.attributes() );
}
Expand Down Expand Up @@ -1815,7 +1815,7 @@ bool QgsVectorLayer::nextFeature( QgsFeature &f )
}
if ( mFetchAttributes.size() > 0 )
{
if (mEditBuffer)
if ( mEditBuffer )
mEditBuffer->updateChangedAttributes( f ); //check changed attributes
addJoinedAttributes( f ); // check joined attributes
}
Expand Down Expand Up @@ -1890,7 +1890,7 @@ bool QgsVectorLayer::featureAtId( QgsFeatureId featureId, QgsFeature& f, bool fe
if ( fi.nextFeature( tmp ) )
{
f.setAttributes( tmp.attributes() );
if (mEditBuffer)
if ( mEditBuffer )
mEditBuffer->updateChangedAttributes( f );
}
}
Expand All @@ -1900,7 +1900,7 @@ bool QgsVectorLayer::featureAtId( QgsFeatureId featureId, QgsFeature& f, bool fe
}

//added features
if (mEditBuffer)
if ( mEditBuffer )
{
for ( QgsFeatureList::iterator iter = mEditBuffer->mAddedFeatures.begin(); iter != mEditBuffer->mAddedFeatures.end(); ++iter )
{
Expand Down Expand Up @@ -1930,7 +1930,7 @@ bool QgsVectorLayer::featureAtId( QgsFeatureId featureId, QgsFeature& f, bool fe
QgsFeatureIterator fi = mDataProvider->getFeatures( request );
if ( fi.nextFeature( f ) )
{
if (mEditBuffer)
if ( mEditBuffer )
mEditBuffer->updateChangedAttributes( f );
addJoinedAttributes( f, true );
return true;
Expand All @@ -1942,11 +1942,11 @@ bool QgsVectorLayer::featureAtId( QgsFeatureId featureId, QgsFeature& f, bool fe

bool QgsVectorLayer::addFeature( QgsFeature& f, bool alsoUpdateExtent )
{
Q_UNUSED( alsoUpdateExtent ); // TODO[MD]
if ( !mEditBuffer || !mDataProvider )
return false;

// TODO[MD]: alsoUpdateExtent
return mEditBuffer->addFeature(f);
return mEditBuffer->addFeature( f );
}

bool QgsVectorLayer::updateFeature( QgsFeature &f )
Expand Down Expand Up @@ -1991,7 +1991,7 @@ bool QgsVectorLayer::insertVertex( double x, double y, QgsFeatureId atFeatureId,
if ( !mEditBuffer || !mDataProvider )
return false;

QgsVectorLayerEditUtils utils(this);
QgsVectorLayerEditUtils utils( this );
return utils.insertVertex( x, y, atFeatureId, beforeVertex );
}

Expand All @@ -2001,7 +2001,7 @@ bool QgsVectorLayer::moveVertex( double x, double y, QgsFeatureId atFeatureId, i
if ( !mEditBuffer || !mDataProvider )
return false;

QgsVectorLayerEditUtils utils(this);
QgsVectorLayerEditUtils utils( this );
return utils.moveVertex( x, y, atFeatureId, atVertex );
}

Expand All @@ -2011,7 +2011,7 @@ bool QgsVectorLayer::deleteVertex( QgsFeatureId atFeatureId, int atVertex )
if ( !mEditBuffer || !mDataProvider )
return false;

QgsVectorLayerEditUtils utils(this);
QgsVectorLayerEditUtils utils( this );
return utils.deleteVertex( atFeatureId, atVertex );
}

Expand Down Expand Up @@ -2053,7 +2053,7 @@ int QgsVectorLayer::addRing( const QList<QgsPoint>& ring )
if ( !mEditBuffer || !mDataProvider )
return 6;

QgsVectorLayerEditUtils utils(this);
QgsVectorLayerEditUtils utils( this );
return utils.addRing( ring );
}

Expand All @@ -2075,26 +2075,26 @@ int QgsVectorLayer::addPart( const QList<QgsPoint> &points )
return 5;
}

QgsVectorLayerEditUtils utils(this);
QgsVectorLayerEditUtils utils( this );
return utils.addPart( points, *mSelectedFeatureIds.constBegin() );
}


int QgsVectorLayer::translateFeature( QgsFeatureId featureId, double dx, double dy )
{
if (!mEditBuffer || !mDataProvider)
if ( !mEditBuffer || !mDataProvider )
return -1;

QgsVectorLayerEditUtils utils(this);
QgsVectorLayerEditUtils utils( this );
return utils.translateFeature( featureId, dx, dy );
}

int QgsVectorLayer::splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing )
{
if (!mEditBuffer || !mDataProvider)
if ( !mEditBuffer || !mDataProvider )
return -1;

QgsVectorLayerEditUtils utils(this);
QgsVectorLayerEditUtils utils( this );
return utils.splitFeatures( splitLine, topologicalEditing );
}

Expand Down Expand Up @@ -2140,19 +2140,19 @@ int QgsVectorLayer::removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds

int QgsVectorLayer::addTopologicalPoints( QgsGeometry* geom )
{
if (!mEditBuffer || !mDataProvider)
if ( !mEditBuffer || !mDataProvider )
return -1;

QgsVectorLayerEditUtils utils(this);
QgsVectorLayerEditUtils utils( this );
return utils.addTopologicalPoints( geom );
}

int QgsVectorLayer::addTopologicalPoints( const QgsPoint& p )
{
if (!mEditBuffer || !mDataProvider)
if ( !mEditBuffer || !mDataProvider )
return -1;

QgsVectorLayerEditUtils utils(this);
QgsVectorLayerEditUtils utils( this );
return utils.addTopologicalPoints( p );
}

Expand Down Expand Up @@ -2200,16 +2200,16 @@ bool QgsVectorLayer::startEditing()
return false;
}

mEditBuffer = new QgsVectorLayerEditBuffer(this);
mEditBuffer = new QgsVectorLayerEditBuffer( this );
// forward signals
connect(mEditBuffer, SIGNAL(layerModified()), this, SIGNAL(layerModified())); // TODO[MD]: necessary?
connect(mEditBuffer, SIGNAL(layerModified()), this, SLOT(triggerRepaint())); // TODO[MD]: works well?
connect(mEditBuffer, SIGNAL(featureAdded(QgsFeatureId)), this, SIGNAL(featureAdded(QgsFeatureId)));
connect(mEditBuffer, SIGNAL(featureDeleted(QgsFeatureId)), this, SIGNAL(featureDeleted(QgsFeatureId)));
connect(mEditBuffer, SIGNAL(geometryChanged(QgsFeatureId,QgsGeometry&)), this, SIGNAL(geometryChanged(QgsFeatureId,QgsGeometry&)));
connect(mEditBuffer, SIGNAL(attributeValueChanged(QgsFeatureId,int,QVariant)), this, SIGNAL(attributeValueChanged(QgsFeatureId,int,QVariant)));
connect(mEditBuffer, SIGNAL(attributeAdded(int)), this, SIGNAL(attributeAdded(int)));
connect(mEditBuffer, SIGNAL(attributeDeleted(int)), this, SIGNAL(attributeDeleted(int)));
connect( mEditBuffer, SIGNAL( layerModified() ), this, SIGNAL( layerModified() ) ); // TODO[MD]: necessary?
connect( mEditBuffer, SIGNAL( layerModified() ), this, SLOT( triggerRepaint() ) ); // TODO[MD]: works well?
connect( mEditBuffer, SIGNAL( featureAdded( QgsFeatureId ) ), this, SIGNAL( featureAdded( QgsFeatureId ) ) );
connect( mEditBuffer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SIGNAL( featureDeleted( QgsFeatureId ) ) );
connect( mEditBuffer, SIGNAL( geometryChanged( QgsFeatureId, QgsGeometry& ) ), this, SIGNAL( geometryChanged( QgsFeatureId, QgsGeometry& ) ) );
connect( mEditBuffer, SIGNAL( attributeValueChanged( QgsFeatureId, int, QVariant ) ), this, SIGNAL( attributeValueChanged( QgsFeatureId, int, QVariant ) ) );
connect( mEditBuffer, SIGNAL( attributeAdded( int ) ), this, SIGNAL( attributeAdded( int ) ) );
connect( mEditBuffer, SIGNAL( attributeDeleted( int ) ), this, SIGNAL( attributeDeleted( int ) ) );

updateFields();

Expand Down Expand Up @@ -3138,10 +3138,10 @@ bool QgsVectorLayer::changeGeometry( QgsFeatureId fid, QgsGeometry* geom )

bool QgsVectorLayer::changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal )
{
Q_UNUSED( emitSignal ); // TODO[MD]
if ( !mEditBuffer || !mDataProvider )
return false;

// TODO[MD]: emitSignal
return mEditBuffer->changeAttributeValue( fid, field, value );
}

Expand Down Expand Up @@ -3206,8 +3206,8 @@ bool QgsVectorLayer::deleteFeature( QgsFeatureId fid )
if ( !mEditBuffer )
return false;

bool res = mEditBuffer->deleteFeature(fid);
if (res)
bool res = mEditBuffer->deleteFeature( fid );
if ( res )
mSelectedFeatureIds.remove( fid ); // remove it from selection

return res;
Expand Down Expand Up @@ -3244,7 +3244,7 @@ QgsAttributeList QgsVectorLayer::pendingPkAttributesList()
int QgsVectorLayer::pendingFeatureCount()
{
return mDataProvider->featureCount() +
(mEditBuffer ? mEditBuffer->mAddedFeatures.size() - mEditBuffer->mDeletedFeatureIds.size() : 0 );
( mEditBuffer ? mEditBuffer->mAddedFeatures.size() - mEditBuffer->mDeletedFeatureIds.size() : 0 );
}

bool QgsVectorLayer::commitChanges()
Expand Down Expand Up @@ -3516,7 +3516,7 @@ void QgsVectorLayer::snapToGeometry( const QgsPoint& startPoint,

int QgsVectorLayer::insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults )
{
QgsVectorLayerEditUtils utils(this);
QgsVectorLayerEditUtils utils( this );
return utils.insertSegmentVerticesForSnap( snapResults );
}

Expand Down Expand Up @@ -3918,7 +3918,7 @@ void QgsVectorLayer::setUsingRendererV2( bool usingRendererV2 )

void QgsVectorLayer::beginEditCommand( QString text )
{
undoStack()->beginMacro(text);
undoStack()->beginMacro( text );
}

void QgsVectorLayer::endEditCommand()
Expand Down Expand Up @@ -4018,7 +4018,7 @@ void QgsVectorLayer::uniqueValues( int index, QList<QVariant> &uniqueValues, int
return;
}

QgsFields::FieldOrigin origin = mUpdatedFields.fieldOrigin(index);
QgsFields::FieldOrigin origin = mUpdatedFields.fieldOrigin( index );

if ( origin == QgsFields::OriginProvider ) //a provider field
{
Expand Down Expand Up @@ -4066,7 +4066,7 @@ void QgsVectorLayer::uniqueValues( int index, QList<QVariant> &uniqueValues, int
return;
}

Q_ASSERT_X(false, "QgsVectorLayer::uniqueValues()", "Unknown source of the field!");
Q_ASSERT_X( false, "QgsVectorLayer::uniqueValues()", "Unknown source of the field!" );
}

QVariant QgsVectorLayer::minimumValue( int index )
Expand All @@ -4076,7 +4076,7 @@ QVariant QgsVectorLayer::minimumValue( int index )
return QVariant();
}

QgsFields::FieldOrigin origin = mUpdatedFields.fieldOrigin(index);
QgsFields::FieldOrigin origin = mUpdatedFields.fieldOrigin( index );

if ( origin == QgsFields::OriginProvider ) //a provider field
{
Expand Down Expand Up @@ -4121,7 +4121,7 @@ QVariant QgsVectorLayer::minimumValue( int index )
return QVariant( minimumValue );
}

Q_ASSERT_X(false, "QgsVectorLayer::minimumValue()", "Unknown source of the field!");
Q_ASSERT_X( false, "QgsVectorLayer::minimumValue()", "Unknown source of the field!" );
return QVariant();
}

Expand All @@ -4132,7 +4132,7 @@ QVariant QgsVectorLayer::maximumValue( int index )
return QVariant();
}

QgsFields::FieldOrigin origin = mUpdatedFields.fieldOrigin(index);
QgsFields::FieldOrigin origin = mUpdatedFields.fieldOrigin( index );

if ( origin == QgsFields::OriginProvider ) //a provider field
{
Expand Down Expand Up @@ -4177,7 +4177,7 @@ QVariant QgsVectorLayer::maximumValue( int index )
return QVariant( maximumValue );
}

Q_ASSERT_X(false, "QgsVectorLayer::maximumValue()", "Unknown source of the field!");
Q_ASSERT_X( false, "QgsVectorLayer::maximumValue()", "Unknown source of the field!" );
return QVariant();
}

Expand Down
3 changes: 1 addition & 2 deletions src/core/qgsvectorlayerimport.cpp
Expand Up @@ -28,8 +28,6 @@

#include <QProgressDialog>

#include <QProgressDialog>

#define FEATURE_BUFFER_SIZE 200

typedef QgsVectorLayerImport::ImportError createEmptyLayer_t(
Expand Down Expand Up @@ -224,6 +222,7 @@ QgsVectorLayerImport::importLayer( QgsVectorLayer* layer,
outputCRS = &layer->crs();
}


bool overwrite = false;
bool forceSinglePartGeom = false;
if ( options )
Expand Down
1 change: 1 addition & 0 deletions src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -655,6 +655,7 @@ void QgsAttributeTableModel::executeAction( int action, const QModelIndex &idx )
QgsFeature QgsAttributeTableModel::feature( const QModelIndex &idx ) const
{
QgsFeature f;
f.initAttributes( mAttributes.size() );
f.setFeatureId( rowToId( idx.row() ) );
for ( int i = 0; i < mAttributes.size(); i++ )
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -3617,7 +3617,7 @@ void QgsGrassModuleField::updateFields()

QgsFields fields = mLayerInput->currentFields();

for ( unsigned int i = 0; i < fields.size(); i++ )
for ( int i = 0; i < fields.size(); i++ )
{
if ( mType.contains( fields[i].typeName() ) )
{
Expand Down
6 changes: 3 additions & 3 deletions src/providers/CMakeLists.txt
Expand Up @@ -15,9 +15,9 @@ ADD_SUBDIRECTORY(wcs)
ADD_SUBDIRECTORY(gpx)
ADD_SUBDIRECTORY(wfs)

#IF (WITH_ORACLE)
# ADD_SUBDIRECTORY(oracle)
#ENDIF(WITH_ORACLE)
IF (WITH_ORACLE)
ADD_SUBDIRECTORY(oracle)
ENDIF(WITH_ORACLE)

IF (POSTGRES_FOUND)
ADD_SUBDIRECTORY(postgres)
Expand Down
1 change: 1 addition & 0 deletions src/providers/oracle/CMakeLists.txt
Expand Up @@ -11,6 +11,7 @@ SET(ORACLE_SRCS
qgsoraclenewconnection.cpp
qgsoracletablemodel.cpp
qgsoraclecolumntypethread.cpp
qgsoraclefeatureiterator.cpp
)

SET(ORACLE_MOC_HDRS
Expand Down

0 comments on commit 985468e

Please sign in to comment.