Skip to content

Commit 9b5b774

Browse files
committed
oracle provider: update for 1bafa80 and e683101
1 parent 6fefbea commit 9b5b774

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

src/providers/oracle/qgsoracledataitems.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ bool QgsOracleConnectionItem::handleDrop( const QMimeData * data, Qt::DropAction
265265
QgsDebugMsgLevel( "URI " + uri.uri(), 3 );
266266
QgsVectorLayerImport::ImportError err;
267267
QString importError;
268-
err = QgsVectorLayerImport::importLayer( srcLayer, uri.uri(), "oracle", &srcLayer->crs(), false, &importError, false, nullptr, progress );
268+
err = QgsVectorLayerImport::importLayer( srcLayer, uri.uri(), "oracle", srcLayer->crs(), false, &importError, false, nullptr, progress );
269269
if ( err == QgsVectorLayerImport::NoError )
270270
importResults.append( tr( "%1: OK!" ).arg( u.name ) );
271271
else if ( err == QgsVectorLayerImport::ErrUserCancelled )

src/providers/oracle/qgsoracleprovider.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ const QgsField &QgsOracleProvider::field( int index ) const
515515
return mAttributeFields[ index ];
516516
}
517517

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

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

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

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

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

11531153

1154-
bool QgsOracleProvider::isValid()
1154+
bool QgsOracleProvider::isValid() const
11551155
{
11561156
return mValid;
11571157
}
11581158

1159-
QVariant QgsOracleProvider::defaultValue( int fieldId )
1159+
QVariant QgsOracleProvider::defaultValue( int fieldId ) const
11601160
{
11611161
return mDefaultValues.value( fieldId, QVariant() );
11621162
}
@@ -2162,7 +2162,7 @@ long QgsOracleProvider::featureCount() const
21622162
return mFeaturesCounted;
21632163
}
21642164

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

2961-
QgsCoordinateReferenceSystem QgsOracleProvider::crs()
2961+
QgsCoordinateReferenceSystem QgsOracleProvider::crs() const
29622962
{
29632963
QgsCoordinateReferenceSystem srs;
29642964

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

3001-
QString QgsOracleProvider::subsetString()
3001+
QString QgsOracleProvider::subsetString() const
30023002
{
30033003
return mSqlWhereClause;
30043004
}

src/providers/oracle/qgsoracleprovider.h

+20-20
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class QgsOracleProvider : public QgsVectorDataProvider
9292
* If the provider isn't capable of returning
9393
* its projection an empty srs will be returned
9494
*/
95-
virtual QgsCoordinateReferenceSystem crs() override;
95+
virtual QgsCoordinateReferenceSystem crs() const override;
9696

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

134134
/** Return the extent for this data layer
135135
*/
136-
virtual QgsRectangle extent() override;
136+
virtual QgsRectangle extent() const override;
137137

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

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

162162
/** Returns the minimum value of an attribute
163163
* @param index the index of the attribute */
164-
QVariant minimumValue( int index ) override;
164+
QVariant minimumValue( int index ) const override;
165165

166166
/** Returns the maximum value of an attribute
167167
* @param index the index of the attribute */
168-
QVariant maximumValue( int index ) override;
168+
QVariant maximumValue( int index ) const override;
169169

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

175175
/** Returns true if layer is valid
176176
*/
177-
bool isValid() override;
177+
bool isValid() const override;
178178

179-
QgsAttributeList pkAttributeIndexes() override { return mPrimaryKeyAttrs; }
179+
QgsAttributeList pkAttributeIndexes() const override { return mPrimaryKeyAttrs; }
180180

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

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

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

232232
/** Accessor for sql where clause used to limit dataset */
233-
QString subsetString() override;
233+
QString subsetString() const override;
234234

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

238-
virtual bool supportsSubsetString() override { return true; }
238+
virtual bool supportsSubsetString() const override { return true; }
239239

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

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

279279
/**
280280
* It returns true. Saving style to db is supported by this provider
281281
*/
282-
virtual bool isSaveAndLoadStyleToDBSupported() override { return true; }
282+
virtual bool isSaveAndLoadStyleToDBSupported() const override { return true; }
283283

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

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

353-
QGis::WkbType mDetectedGeomType; //! geometry type detected in the database
354-
QGis::WkbType mRequestedGeomType; //! geometry type requested in the uri
353+
QGis::WkbType mDetectedGeomType; //! geometry type detected in the database
354+
QGis::WkbType mRequestedGeomType; //! geometry type requested in the uri
355355

356356
bool getGeometryDetails();
357357

0 commit comments

Comments
 (0)