Skip to content
Permalink
Browse files

oracle provider: update for 1bafa80 and e683101

  • Loading branch information
jef-n committed Jul 15, 2016
1 parent 6fefbea commit 9b5b77411268866f585f2e4eddcba3cf7850483c
@@ -265,7 +265,7 @@ bool QgsOracleConnectionItem::handleDrop( const QMimeData * data, Qt::DropAction
QgsDebugMsgLevel( "URI " + uri.uri(), 3 );
QgsVectorLayerImport::ImportError err;
QString importError;
err = QgsVectorLayerImport::importLayer( srcLayer, uri.uri(), "oracle", &srcLayer->crs(), false, &importError, false, nullptr, progress );
err = QgsVectorLayerImport::importLayer( srcLayer, uri.uri(), "oracle", srcLayer->crs(), false, &importError, false, nullptr, progress );
if ( err == QgsVectorLayerImport::NoError )
importResults.append( tr( "%1: OK!" ).arg( u.name ) );
else if ( err == QgsVectorLayerImport::ErrUserCancelled )
@@ -515,7 +515,7 @@ const QgsField &QgsOracleProvider::field( int index ) const
return mAttributeFields[ index ];
}

QgsFeatureIterator QgsOracleProvider::getFeatures( const QgsFeatureRequest& request )
QgsFeatureIterator QgsOracleProvider::getFeatures( const QgsFeatureRequest& request ) const
{
if ( !mValid )
{
@@ -534,7 +534,7 @@ uint QgsOracleProvider::fieldCount() const
return mAttributeFields.size();
}

const QgsFields &QgsOracleProvider::fields() const
QgsFields QgsOracleProvider::fields() const
{
return mAttributeFields;
}
@@ -1019,7 +1019,7 @@ bool QgsOracleProvider::uniqueData( QString query, QString colName )
}

// Returns the minimum value of an attribute
QVariant QgsOracleProvider::minimumValue( int index )
QVariant QgsOracleProvider::minimumValue( int index ) const
{
if ( !mConnection )
return QVariant( QString::null );
@@ -1060,7 +1060,7 @@ QVariant QgsOracleProvider::minimumValue( int index )
}

// Returns the list of unique values of an attribute
void QgsOracleProvider::uniqueValues( int index, QList<QVariant> &uniqueValues, int limit )
void QgsOracleProvider::uniqueValues( int index, QList<QVariant> &uniqueValues, int limit ) const
{
if ( !mConnection )
return;
@@ -1109,7 +1109,7 @@ void QgsOracleProvider::uniqueValues( int index, QList<QVariant> &uniqueValues,
}

// Returns the maximum value of an attribute
QVariant QgsOracleProvider::maximumValue( int index )
QVariant QgsOracleProvider::maximumValue( int index ) const
{
if ( !mConnection )
return QVariant();
@@ -1151,12 +1151,12 @@ QVariant QgsOracleProvider::maximumValue( int index )
}


bool QgsOracleProvider::isValid()
bool QgsOracleProvider::isValid() const
{
return mValid;
}

QVariant QgsOracleProvider::defaultValue( int fieldId )
QVariant QgsOracleProvider::defaultValue( int fieldId ) const
{
return mDefaultValues.value( fieldId, QVariant() );
}
@@ -2162,7 +2162,7 @@ long QgsOracleProvider::featureCount() const
return mFeaturesCounted;
}

QgsRectangle QgsOracleProvider::extent()
QgsRectangle QgsOracleProvider::extent() const
{
if ( mGeometryColumn.isNull() || !mConnection )
return QgsRectangle();
@@ -2958,7 +2958,7 @@ QgsVectorLayerImport::ImportError QgsOracleProvider::createEmptyLayer(
return QgsVectorLayerImport::NoError;
}

QgsCoordinateReferenceSystem QgsOracleProvider::crs()
QgsCoordinateReferenceSystem QgsOracleProvider::crs() const
{
QgsCoordinateReferenceSystem srs;

@@ -2998,7 +2998,7 @@ QgsCoordinateReferenceSystem QgsOracleProvider::crs()
return srs;
}

QString QgsOracleProvider::subsetString()
QString QgsOracleProvider::subsetString() const
{
return mSqlWhereClause;
}
@@ -92,7 +92,7 @@ class QgsOracleProvider : public QgsVectorDataProvider
* If the provider isn't capable of returning
* its projection an empty srs will be returned
*/
virtual QgsCoordinateReferenceSystem crs() override;
virtual QgsCoordinateReferenceSystem crs() const override;

/** Get the feature type. This corresponds to
* WKBPoint,
@@ -133,7 +133,7 @@ class QgsOracleProvider : public QgsVectorDataProvider

/** Return the extent for this data layer
*/
virtual QgsRectangle extent() override;
virtual QgsRectangle extent() const override;

/** Update the extent
*/
@@ -147,7 +147,7 @@ class QgsOracleProvider : public QgsVectorDataProvider
* Get the field information for the layer
* @return vector of QgsField objects
*/
const QgsFields &fields() const override;
QgsFields fields() const override;

/**
* Return a short comment for the data that this provider is
@@ -161,28 +161,28 @@ class QgsOracleProvider : public QgsVectorDataProvider

/** Returns the minimum value of an attribute
* @param index the index of the attribute */
QVariant minimumValue( int index ) override;
QVariant minimumValue( int index ) const override;

/** Returns the maximum value of an attribute
* @param index the index of the attribute */
QVariant maximumValue( int index ) override;
QVariant maximumValue( int index ) const override;

/** Return the unique values of an attribute
* @param index the index of the attribute
* @param values reference to the list of unique values */
virtual void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 ) override;
virtual void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 ) const override;

/** Returns true if layer is valid
*/
bool isValid() override;
bool isValid() const override;

QgsAttributeList pkAttributeIndexes() override { return mPrimaryKeyAttrs; }
QgsAttributeList pkAttributeIndexes() const override { return mPrimaryKeyAttrs; }

/** Returns the default value for field specified by @c fieldName */
QVariant defaultValue( QString fieldName, QString tableName = QString::null, QString schemaName = QString::null );

/** Returns the default value for field specified by @c fieldId */
QVariant defaultValue( int fieldId ) override;
QVariant defaultValue( int fieldId ) const override;

/** Adds a list of features
@return true in case of success and false in case of failure*/
@@ -230,12 +230,12 @@ class QgsOracleProvider : public QgsVectorDataProvider
QString getTableName();

/** Accessor for sql where clause used to limit dataset */
QString subsetString() override;
QString subsetString() const override;

/** Mutator for sql where clause used to limit dataset size */
bool setSubsetString( const QString& theSQL, bool updateFeatureCount = true ) override;

virtual bool supportsSubsetString() override { return true; }
virtual bool supportsSubsetString() const override { return true; }

/** Returns a bitmask containing the supported capabilities*/
int capabilities() const override;
@@ -272,14 +272,14 @@ class QgsOracleProvider : public QgsVectorDataProvider
/**
* Query the provider for features specified in request.
*/
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) override;
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const override;

static bool exec( QSqlQuery &qry, QString sql );

/**
* It returns true. Saving style to db is supported by this provider
*/
virtual bool isSaveAndLoadStyleToDBSupported() override { return true; }
virtual bool isSaveAndLoadStyleToDBSupported() const override { return true; }

private:
QString whereClause( QgsFeatureId featureId ) const;
@@ -344,14 +344,14 @@ class QgsOracleProvider : public QgsVectorDataProvider
QList<int> mPrimaryKeyAttrs;
QString mPrimaryKeyDefault;

QString mGeometryColumn; //! name of the geometry column
QgsRectangle mLayerExtent; //! Rectangle that contains the extent (bounding box) of the layer
mutable long mFeaturesCounted; //! Number of features in the layer
int mSrid; //! srid of column
int mEnabledCapabilities; //! capabilities of layer
QString mGeometryColumn; //! name of the geometry column
mutable QgsRectangle mLayerExtent; //! Rectangle that contains the extent (bounding box) of the layer
mutable long mFeaturesCounted; //! Number of features in the layer
int mSrid; //! srid of column
int mEnabledCapabilities; //! capabilities of layer

QGis::WkbType mDetectedGeomType; //! geometry type detected in the database
QGis::WkbType mRequestedGeomType; //! geometry type requested in the uri
QGis::WkbType mDetectedGeomType; //! geometry type detected in the database
QGis::WkbType mRequestedGeomType; //! geometry type requested in the uri

bool getGeometryDetails();

0 comments on commit 9b5b774

Please sign in to comment.
You can’t perform that action at this time.