Skip to content

Commit

Permalink
oracle provider: update for 1bafa80 and e683101
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 15, 2016
1 parent 6fefbea commit 9b5b774
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/providers/oracle/qgsoracledataitems.cpp
Expand Up @@ -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 )
Expand Down
20 changes: 10 additions & 10 deletions src/providers/oracle/qgsoracleprovider.cpp
Expand Up @@ -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 )
{
Expand All @@ -534,7 +534,7 @@ uint QgsOracleProvider::fieldCount() const
return mAttributeFields.size();
}

const QgsFields &QgsOracleProvider::fields() const
QgsFields QgsOracleProvider::fields() const
{
return mAttributeFields;
}
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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() );
}
Expand Down Expand Up @@ -2162,7 +2162,7 @@ long QgsOracleProvider::featureCount() const
return mFeaturesCounted;
}

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

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

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

QString QgsOracleProvider::subsetString()
QString QgsOracleProvider::subsetString() const
{
return mSqlWhereClause;
}
Expand Down
40 changes: 20 additions & 20 deletions src/providers/oracle/qgsoracleprovider.h
Expand Up @@ -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,
Expand Down Expand Up @@ -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
*/
Expand All @@ -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
Expand All @@ -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*/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 9b5b774

Please sign in to comment.