Skip to content
Permalink
Browse files

Swap remaining QSharedPointer uses to std::shared_ptr

  • Loading branch information
nyalldawson committed Jun 20, 2017
1 parent 61a4610 commit b3da171040ab2d3aa4dd06dd7cf558afb42125f0
@@ -19,7 +19,7 @@
#include "geometry/qgsgeometry.h"
#include "qgscsexception.h"

QgsAfsFeatureSource::QgsAfsFeatureSource( const QSharedPointer<QgsAfsSharedData> &sharedData )
QgsAfsFeatureSource::QgsAfsFeatureSource( const std::shared_ptr<QgsAfsSharedData> &sharedData )
: mSharedData( sharedData )
{
}
@@ -31,7 +31,7 @@ QgsFeatureIterator QgsAfsFeatureSource::getFeatures( const QgsFeatureRequest &re

QgsAfsSharedData *QgsAfsFeatureSource::sharedData() const
{
return mSharedData.data();
return mSharedData.get();
}

///////////////////////////////////////////////////////////////////////////////
@@ -17,7 +17,7 @@

#include "qgsfeatureiterator.h"
#include "qgsafsshareddata.h"
#include <QSharedPointer>
#include <memory>

class QgsSpatialIndex;

@@ -26,12 +26,12 @@ class QgsAfsFeatureSource : public QgsAbstractFeatureSource
{

public:
QgsAfsFeatureSource( const QSharedPointer<QgsAfsSharedData> &sharedData );
QgsAfsFeatureSource( const std::shared_ptr<QgsAfsSharedData> &sharedData );
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;
QgsAfsSharedData *sharedData() const;

protected:
QSharedPointer<QgsAfsSharedData> mSharedData;
std::shared_ptr<QgsAfsSharedData> mSharedData;

friend class QgsAfsFeatureIterator;
};
@@ -34,7 +34,7 @@ QgsAfsProvider::QgsAfsProvider( const QString &uri )
, mValid( false )
, mObjectIdFieldIdx( -1 )
{
mSharedData = QSharedPointer<QgsAfsSharedData>( new QgsAfsSharedData() );
mSharedData.reset( new QgsAfsSharedData() );
mSharedData->mGeometryType = QgsWkbTypes::Unknown;
mSharedData->mDataSource = QgsDataSourceUri( uri );

@@ -18,7 +18,7 @@
#ifndef QGSAFSPROVIDER_H
#define QGSAFSPROVIDER_H

#include <QSharedPointer>
#include <memory>
#include "qgsvectordataprovider.h"
#include "qgsdatasourceuri.h"
#include "qgsafsshareddata.h"
@@ -70,7 +70,7 @@ class QgsAfsProvider : public QgsVectorDataProvider

private:
bool mValid;
QSharedPointer<QgsAfsSharedData> mSharedData;
std::shared_ptr<QgsAfsSharedData> mSharedData;
int mObjectIdFieldIdx;
QString mLayerName;
QString mLayerDescription;
@@ -50,7 +50,7 @@ class QgsOracleFeatureSource : public QgsAbstractFeatureSource
QString mQuery;
QgsCoordinateReferenceSystem mCrs;

QSharedPointer<QgsOracleSharedData> mShared;
std::shared_ptr<QgsOracleSharedData> mShared;

friend class QgsOracleFeatureIterator;
friend class QgsOracleExpressionCompiler;
@@ -366,7 +366,7 @@ void QgsOracleProvider::appendPkParams( QgsFeatureId fid, QSqlQuery &qry ) const
}


QString QgsOracleUtils::whereClause( QgsFeatureId featureId, const QgsFields &fields, QgsOraclePrimaryKeyType primaryKeyType, const QList<int> &primaryKeyAttrs, QSharedPointer<QgsOracleSharedData> sharedData, QVariantList &args )
QString QgsOracleUtils::whereClause( QgsFeatureId featureId, const QgsFields &fields, QgsOraclePrimaryKeyType primaryKeyType, const QList<int> &primaryKeyAttrs, std::shared_ptr<QgsOracleSharedData> sharedData, QVariantList &args )
{
QString whereClause;

@@ -424,7 +424,7 @@ QString QgsOracleUtils::whereClause( QgsFeatureId featureId, const QgsFields &fi
return whereClause;
}

QString QgsOracleUtils::whereClause( QgsFeatureIds featureIds, const QgsFields &fields, QgsOraclePrimaryKeyType primaryKeyType, const QList<int> &primaryKeyAttrs, QSharedPointer<QgsOracleSharedData> sharedData, QVariantList &args )
QString QgsOracleUtils::whereClause( QgsFeatureIds featureIds, const QgsFields &fields, QgsOraclePrimaryKeyType primaryKeyType, const QList<int> &primaryKeyAttrs, std::shared_ptr<QgsOracleSharedData> sharedData, QVariantList &args )
{
QStringList whereClauses;
Q_FOREACH ( const QgsFeatureId featureId, featureIds )
@@ -301,7 +301,7 @@ class QgsOracleProvider : public QgsVectorDataProvider
bool mHasSpatialIndex; //! Geometry column is indexed
QString mSpatialIndexName; //! name of spatial index of geometry column

QSharedPointer<QgsOracleSharedData> mShared;
std::shared_ptr<QgsOracleSharedData> mShared;

friend class QgsOracleFeatureIterator;
friend class QgsOracleFeatureSource;
@@ -316,14 +316,14 @@ class QgsOracleUtils
const QgsFields &fields,
QgsOraclePrimaryKeyType primaryKeyType,
const QList<int> &primaryKeyAttrs,
QSharedPointer<QgsOracleSharedData> sharedData,
std::shared_ptr<QgsOracleSharedData> sharedData,
QVariantList &params );

static QString whereClause( QgsFeatureIds featureIds,
const QgsFields &fields,
QgsOraclePrimaryKeyType primaryKeyType,
const QList<int> &primaryKeyAttrs,
QSharedPointer<QgsOracleSharedData> sharedData,
std::shared_ptr<QgsOracleSharedData> sharedData,
QVariantList &params );

static QString andWhereClauses( const QString &c1, const QString &c2 );

0 comments on commit b3da171

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