Pass by const ref where possible

This commit is contained in:
Nyall Dawson 2017-09-11 21:19:22 +10:00
parent c9fa976524
commit 2a33844416
52 changed files with 106 additions and 106 deletions

View File

@ -248,7 +248,7 @@ class QgsJsonUtils
%End %End
static QString exportAttributes( const QgsFeature &feature, QgsVectorLayer *layer = 0, static QString exportAttributes( const QgsFeature &feature, QgsVectorLayer *layer = 0,
QVector<QVariant> attributeWidgetCaches = QVector<QVariant>() ); const QVector<QVariant> &attributeWidgetCaches = QVector<QVariant>() );
%Docstring %Docstring
Exports all attributes from a QgsFeature as a JSON map type. Exports all attributes from a QgsFeature as a JSON map type.
\param feature feature to export \param feature feature to export

View File

@ -48,7 +48,7 @@ class QgsMapRendererTask : QgsTask
Adds ``annotations`` to be rendered on the map. Adds ``annotations`` to be rendered on the map.
%End %End
void addDecorations( QList< QgsMapDecoration * > decorations ); void addDecorations( const QList<QgsMapDecoration *> &decorations );
%Docstring %Docstring
Adds ``decorations`` to be rendered on the map. Adds ``decorations`` to be rendered on the map.
%End %End

View File

@ -166,7 +166,7 @@ Returns a list of all key top-level groups (same as childGroups) but only for gr
Return the path to the Global Settings QSettings storage file Return the path to the Global Settings QSettings storage file
:rtype: str :rtype: str
%End %End
static bool setGlobalSettingsPath( QString path ); static bool setGlobalSettingsPath( const QString &path );
%Docstring %Docstring
Set the Global Settings QSettings storage file Set the Global Settings QSettings storage file
:rtype: bool :rtype: bool

View File

@ -32,7 +32,7 @@ class QgsFileDownloader : QObject
%End %End
public: public:
QgsFileDownloader( const QUrl &url, const QString &outputFileName, bool guiNotificationsEnabled = true, QString authcfg = QString() ); QgsFileDownloader( const QUrl &url, const QString &outputFileName, bool guiNotificationsEnabled = true, const QString &authcfg = QString() );
%Docstring %Docstring
QgsFileDownloader QgsFileDownloader
\param url the download url \param url the download url

View File

@ -267,7 +267,7 @@ void QgsDwgImportDialog::on_pbImportDrawing_clicked()
on_pbLoadDatabase_clicked(); on_pbLoadDatabase_clicked();
} }
QgsVectorLayer *QgsDwgImportDialog::layer( QgsLayerTreeGroup *layerGroup, QString layerFilter, QString table ) QgsVectorLayer *QgsDwgImportDialog::layer( QgsLayerTreeGroup *layerGroup, const QString &layerFilter, const QString &table )
{ {
QgsVectorLayer *l = new QgsVectorLayer( QString( "%1|layername=%2" ).arg( leDatabase->text(), table ), table, "ogr", false ); QgsVectorLayer *l = new QgsVectorLayer( QString( "%1|layername=%2" ).arg( leDatabase->text(), table ), table, "ogr", false );
l->setSubsetString( QString( "%1space=0 AND block=-1" ).arg( layerFilter ) ); l->setSubsetString( QString( "%1space=0 AND block=-1" ).arg( layerFilter ) );
@ -283,7 +283,7 @@ QgsVectorLayer *QgsDwgImportDialog::layer( QgsLayerTreeGroup *layerGroup, QStrin
return l; return l;
} }
void QgsDwgImportDialog::createGroup( QgsLayerTreeGroup *group, QString name, QStringList layers, bool visible ) void QgsDwgImportDialog::createGroup( QgsLayerTreeGroup *group, const QString &name, const QStringList &layers, bool visible )
{ {
QgsLayerTreeGroup *layerGroup = group->addGroup( name ); QgsLayerTreeGroup *layerGroup = group->addGroup( name );
QgsDebugMsg( QString( " %1" ).arg( name ) ) ; QgsDebugMsg( QString( " %1" ).arg( name ) ) ;

View File

@ -44,8 +44,8 @@ class QgsDwgImportDialog : public QDialog, private Ui::QgsDwgImportBase
void showHelp(); void showHelp();
private: private:
QgsVectorLayer *layer( QgsLayerTreeGroup *layerGroup, QString layer, QString table ); QgsVectorLayer *layer( QgsLayerTreeGroup *layerGroup, const QString &layer, const QString &table );
void createGroup( QgsLayerTreeGroup *group, QString name, QStringList layers, bool visible ); void createGroup( QgsLayerTreeGroup *group, const QString &name, const QStringList &layers, bool visible );
void updateUI(); void updateUI();
void expandInserts(); void expandInserts();
void updateCheckState( Qt::CheckState state ); void updateCheckState( Qt::CheckState state );

View File

@ -75,7 +75,7 @@ QgsDwgImporter::QgsDwgImporter( const QString &database, const QgsCoordinateRefe
QgsDebugMsg( QString( "CRS %1[%2]: %3" ).arg( mCrs ).arg( ( qint64 ) mCrsH, 0, 16 ).arg( crswkt ) ); QgsDebugMsg( QString( "CRS %1[%2]: %3" ).arg( mCrs ).arg( ( qint64 ) mCrsH, 0, 16 ).arg( crswkt ) );
} }
bool QgsDwgImporter::exec( QString sql, bool logError ) bool QgsDwgImporter::exec( const QString &sql, bool logError )
{ {
if ( !mDs ) if ( !mDs )
{ {
@ -104,7 +104,7 @@ bool QgsDwgImporter::exec( QString sql, bool logError )
return false; return false;
} }
OGRLayerH QgsDwgImporter::query( QString sql ) OGRLayerH QgsDwgImporter::query( const QString &sql )
{ {
if ( !mDs ) if ( !mDs )
{ {
@ -259,7 +259,7 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
struct field struct field
{ {
field( QString name, OGRFieldType ogrType, int width = -1, int precision = -1 ) field( const QString &name, OGRFieldType ogrType, int width = -1, int precision = -1 )
: mName( name ), mOgrType( ogrType ), mWidth( width ), mPrecision( precision ) : mName( name ), mOgrType( ogrType ), mWidth( width ), mPrecision( precision )
{} {}
@ -271,7 +271,7 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
struct table struct table
{ {
table( QString name, QString desc, OGRwkbGeometryType wkbType, QList<field> fields ) table( const QString &name, const QString &desc, OGRwkbGeometryType wkbType, const QList<field> &fields )
: mName( name ), mDescription( desc ), mWkbType( wkbType ), mFields( fields ) : mName( name ), mDescription( desc ), mWkbType( wkbType ), mFields( fields )
{} {}
@ -931,7 +931,7 @@ void QgsDwgImporter::addLayer( const DRW_Layer &data )
OGR_F_Destroy( f ); OGR_F_Destroy( f );
} }
void QgsDwgImporter::setString( OGRFeatureDefnH dfn, OGRFeatureH f, QString field, const std::string &value ) const void QgsDwgImporter::setString( OGRFeatureDefnH dfn, OGRFeatureH f, const QString &field, const std::string &value ) const
{ {
int idx = OGR_FD_GetFieldIndex( dfn, field.toLower().toUtf8().constData() ); int idx = OGR_FD_GetFieldIndex( dfn, field.toLower().toUtf8().constData() );
if ( idx < 0 ) if ( idx < 0 )
@ -942,7 +942,7 @@ void QgsDwgImporter::setString( OGRFeatureDefnH dfn, OGRFeatureH f, QString fiel
OGR_F_SetFieldString( f, idx, value.c_str() ); OGR_F_SetFieldString( f, idx, value.c_str() );
} }
void QgsDwgImporter::setDouble( OGRFeatureDefnH dfn, OGRFeatureH f, QString field, double value ) const void QgsDwgImporter::setDouble( OGRFeatureDefnH dfn, OGRFeatureH f, const QString &field, double value ) const
{ {
int idx = OGR_FD_GetFieldIndex( dfn, field.toLower().toUtf8().constData() ); int idx = OGR_FD_GetFieldIndex( dfn, field.toLower().toUtf8().constData() );
if ( idx < 0 ) if ( idx < 0 )
@ -953,7 +953,7 @@ void QgsDwgImporter::setDouble( OGRFeatureDefnH dfn, OGRFeatureH f, QString fiel
OGR_F_SetFieldDouble( f, idx, value ); OGR_F_SetFieldDouble( f, idx, value );
} }
void QgsDwgImporter::setInteger( OGRFeatureDefnH dfn, OGRFeatureH f, QString field, int value ) const void QgsDwgImporter::setInteger( OGRFeatureDefnH dfn, OGRFeatureH f, const QString &field, int value ) const
{ {
int idx = OGR_FD_GetFieldIndex( dfn, field.toLower().toUtf8().constData() ); int idx = OGR_FD_GetFieldIndex( dfn, field.toLower().toUtf8().constData() );
if ( idx < 0 ) if ( idx < 0 )
@ -964,7 +964,7 @@ void QgsDwgImporter::setInteger( OGRFeatureDefnH dfn, OGRFeatureH f, QString fie
OGR_F_SetFieldInteger( f, idx, value ); OGR_F_SetFieldInteger( f, idx, value );
} }
void QgsDwgImporter::setPoint( OGRFeatureDefnH dfn, OGRFeatureH f, QString field, const DRW_Coord &p ) const void QgsDwgImporter::setPoint( OGRFeatureDefnH dfn, OGRFeatureH f, const QString &field, const DRW_Coord &p ) const
{ {
QVector<double> ext( 3 ); QVector<double> ext( 3 );
ext[0] = p.x; ext[0] = p.x;

View File

@ -168,17 +168,17 @@ class QgsDwgImporter : public DRW_Interface
private: private:
void startTransaction(); void startTransaction();
void commitTransaction(); void commitTransaction();
bool exec( QString sql, bool logError = true ); bool exec( const QString &sql, bool logError = true );
OGRLayerH query( QString sql ); OGRLayerH query( const QString &sql );
void addEntity( OGRFeatureDefnH dfn, OGRFeatureH f, const DRW_Entity &data ); void addEntity( OGRFeatureDefnH dfn, OGRFeatureH f, const DRW_Entity &data );
QString colorString( int color, int color24, int transparency, const std::string &layer ) const; QString colorString( int color, int color24, int transparency, const std::string &layer ) const;
double lineWidth( int lWeight, const std::string &layer ) const; double lineWidth( int lWeight, const std::string &layer ) const;
QString linetypeString( const std::string &linetype, const std::string &layer ) const; QString linetypeString( const std::string &linetype, const std::string &layer ) const;
void setString( OGRFeatureDefnH dfn, OGRFeatureH f, QString field, const std::string &value ) const; void setString( OGRFeatureDefnH dfn, OGRFeatureH f, const QString &field, const std::string &value ) const;
void setDouble( OGRFeatureDefnH dfn, OGRFeatureH f, QString field, double value ) const; void setDouble( OGRFeatureDefnH dfn, OGRFeatureH f, const QString &field, double value ) const;
void setInteger( OGRFeatureDefnH dfn, OGRFeatureH f, QString field, int value ) const; void setInteger( OGRFeatureDefnH dfn, OGRFeatureH f, const QString &field, int value ) const;
void setPoint( OGRFeatureDefnH dfn, OGRFeatureH f, QString field, const DRW_Coord &value ) const; void setPoint( OGRFeatureDefnH dfn, OGRFeatureH f, const QString &field, const DRW_Coord &value ) const;
bool curveFromLWPolyline( const DRW_LWPolyline &data, QgsCompoundCurve &cc ); bool curveFromLWPolyline( const DRW_LWPolyline &data, QgsCompoundCurve &cc );

View File

@ -1784,7 +1784,7 @@ void QgsNodeTool::CircularBand::updateRubberBand( const QgsPointXY &mapPoint )
} }
void QgsNodeTool::validationErrorFound( QgsGeometry::Error e ) void QgsNodeTool::validationErrorFound( const QgsGeometry::Error &e )
{ {
QgsGeometryValidator *validator = qobject_cast<QgsGeometryValidator *>( sender() ); QgsGeometryValidator *validator = qobject_cast<QgsGeometryValidator *>( sender() );
if ( !validator ) if ( !validator )

View File

@ -90,7 +90,7 @@ class APP_EXPORT QgsNodeTool : public QgsMapToolAdvancedDigitizing
void deleteNodeEditorSelection(); void deleteNodeEditorSelection();
void validationErrorFound( QgsGeometry::Error e ); void validationErrorFound( const QgsGeometry::Error &e );
void validationFinished(); void validationFinished();

View File

@ -603,7 +603,7 @@ static bool cmpByText_( QAction *a, QAction *b )
QgisApp *QgisApp::sInstance = nullptr; QgisApp *QgisApp::sInstance = nullptr;
// constructor starts here // constructor starts here
QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCheck, const QString rootProfileLocation, const QString activeProfile, QWidget *parent, Qt::WindowFlags fl ) QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCheck, const QString &rootProfileLocation, const QString &activeProfile, QWidget *parent, Qt::WindowFlags fl )
: QMainWindow( parent, fl ) : QMainWindow( parent, fl )
, mSplash( splash ) , mSplash( splash )
, mShowProjectionTab( false ) , mShowProjectionTab( false )
@ -1505,7 +1505,7 @@ bool QgisApp::event( QEvent *event )
return done; return done;
} }
void QgisApp::dataSourceManager( QString pageName ) void QgisApp::dataSourceManager( const QString &pageName )
{ {
if ( ! mDataSourceManagerDialog ) if ( ! mDataSourceManagerDialog )
{ {
@ -11768,7 +11768,7 @@ void QgisApp::endProfile()
QgsApplication::profiler()->end(); QgsApplication::profiler()->end();
} }
void QgisApp::functionProfile( void ( QgisApp::*fnc )(), QgisApp *instance, QString name ) void QgisApp::functionProfile( void ( QgisApp::*fnc )(), QgisApp *instance, const QString &name )
{ {
startProfile( name ); startProfile( name );
( instance->*fnc )(); ( instance->*fnc )();
@ -12484,7 +12484,7 @@ QMenu *QgisApp::createPopupMenu()
} }
void QgisApp::showSystemNotification( const QString title, const QString message ) void QgisApp::showSystemNotification( const QString &title, const QString &message )
{ {
// Menubar icon is hidden by default. Show to enable notification bubbles // Menubar icon is hidden by default. Show to enable notification bubbles
mTray->show(); mTray->show();

View File

@ -165,8 +165,8 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
public: public:
//! Constructor //! Constructor
QgisApp( QSplashScreen *splash, bool restorePlugins = true, QgisApp( QSplashScreen *splash, bool restorePlugins = true,
bool skipVersionCheck = false, const QString rootProfileLocation = QString(), bool skipVersionCheck = false, const QString &rootProfileLocation = QString(),
const QString activeProfile = QString(), const QString &activeProfile = QString(),
QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Window ); QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Window );
//! Constructor for unit tests //! Constructor for unit tests
QgisApp(); QgisApp();
@ -377,7 +377,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
* \param title * \param title
* \param message * \param message
*/ */
void showSystemNotification( const QString title, const QString message ); void showSystemNotification( const QString &title, const QString &message );
//! Actions to be inserted in menus and toolbars //! Actions to be inserted in menus and toolbars
@ -793,7 +793,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
* \param pageName the page name, usually the provider name or "browser" (for the browser panel) * \param pageName the page name, usually the provider name or "browser" (for the browser panel)
* or "ogr" (vector layers) or "raster" (raster layers) * or "ogr" (vector layers) or "raster" (raster layers)
*/ */
void dataSourceManager( QString pageName = QString() ); void dataSourceManager( const QString &pageName = QString() );
/** Add a raster layer directly without prompting user for location /** Add a raster layer directly without prompting user for location
The caller must provide information compatible with the provider plugin The caller must provide information compatible with the provider plugin
@ -1599,7 +1599,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
private: private:
void startProfile( const QString &name ); void startProfile( const QString &name );
void endProfile(); void endProfile();
void functionProfile( void ( QgisApp::*fnc )(), QgisApp *instance, QString name ); void functionProfile( void ( QgisApp::*fnc )(), QgisApp *instance, const QString &name );
/** This method will open a dialog so the user can select GDAL sublayers to load /** This method will open a dialog so the user can select GDAL sublayers to load
* \returns true if any items were loaded * \returns true if any items were loaded

View File

@ -31,7 +31,7 @@
#include <QFileDialog> #include <QFileDialog>
#include <QImageWriter> #include <QImageWriter>
QgsAttributeActionPropertiesDialog::QgsAttributeActionPropertiesDialog( QgsAction::ActionType type, const QString &description, const QString &shortTitle, const QString &iconPath, const QString &actionText, bool capture, QSet<QString> actionScopes, QgsVectorLayer *layer, QWidget *parent ) QgsAttributeActionPropertiesDialog::QgsAttributeActionPropertiesDialog( QgsAction::ActionType type, const QString &description, const QString &shortTitle, const QString &iconPath, const QString &actionText, bool capture, const QSet<QString> &actionScopes, QgsVectorLayer *layer, QWidget *parent )
: QDialog( parent ) : QDialog( parent )
, mLayer( layer ) , mLayer( layer )
{ {

View File

@ -28,7 +28,7 @@ class QgsAttributeActionPropertiesDialog: public QDialog, private Ui::QgsAttribu
Q_OBJECT Q_OBJECT
public: public:
QgsAttributeActionPropertiesDialog( QgsAction::ActionType type, const QString &description, const QString &shortTitle, const QString &iconPath, const QString &actionText, bool capture, QSet<QString> actionScopes, QgsVectorLayer *layer, QWidget *parent = nullptr ); QgsAttributeActionPropertiesDialog( QgsAction::ActionType type, const QString &description, const QString &shortTitle, const QString &iconPath, const QString &actionText, bool capture, const QSet<QString> &actionScopes, QgsVectorLayer *layer, QWidget *parent = nullptr );
QgsAttributeActionPropertiesDialog( QgsVectorLayer *layer, QWidget *parent = nullptr ); QgsAttributeActionPropertiesDialog( QgsVectorLayer *layer, QWidget *parent = nullptr );

View File

@ -40,7 +40,7 @@
Q_GUI_EXPORT extern int qt_defaultDpiX(); Q_GUI_EXPORT extern int qt_defaultDpiX();
QgsMapSaveDialog::QgsMapSaveDialog( QWidget *parent, QgsMapCanvas *mapCanvas, QList< QgsDecorationItem * > decorations, QList< QgsAnnotation *> annotations, DialogType type ) QgsMapSaveDialog::QgsMapSaveDialog( QWidget *parent, QgsMapCanvas *mapCanvas, const QList<QgsDecorationItem *> &decorations, const QList< QgsAnnotation *> &annotations, DialogType type )
: QDialog( parent ) : QDialog( parent )
, mDialogType( type ) , mDialogType( type )
, mMapCanvas( mapCanvas ) , mMapCanvas( mapCanvas )

View File

@ -48,8 +48,8 @@ class APP_EXPORT QgsMapSaveDialog: public QDialog, private Ui::QgsMapSaveDialog
/** Constructor for QgsMapSaveDialog /** Constructor for QgsMapSaveDialog
*/ */
QgsMapSaveDialog( QWidget *parent = nullptr, QgsMapCanvas *mapCanvas = nullptr, QgsMapSaveDialog( QWidget *parent = nullptr, QgsMapCanvas *mapCanvas = nullptr,
QList< QgsDecorationItem * > decorations = QList< QgsDecorationItem * >(), const QList< QgsDecorationItem * > &decorations = QList< QgsDecorationItem * >(),
QList< QgsAnnotation *> annotations = QList< QgsAnnotation * >(), const QList<QgsAnnotation *> &annotations = QList< QgsAnnotation * >(),
DialogType type = Image ); DialogType type = Image );
//! returns extent rectangle //! returns extent rectangle

View File

@ -131,8 +131,8 @@ QgsStaticExpressionFunction::QgsStaticExpressionFunction( const QString &fnname,
FcnEval fcn, FcnEval fcn,
const QString &group, const QString &group,
const QString &helpText, const QString &helpText,
std::function < bool ( const QgsExpressionNodeFunction *node ) > usesGeometry, const std::function < bool ( const QgsExpressionNodeFunction *node ) > &usesGeometry,
std::function < QSet<QString>( const QgsExpressionNodeFunction *node ) > referencedColumns, const std::function < QSet<QString>( const QgsExpressionNodeFunction *node ) > &referencedColumns,
bool lazyEval, bool lazyEval,
const QStringList &aliases, const QStringList &aliases,
bool handlesNull ) bool handlesNull )
@ -182,7 +182,7 @@ bool QgsStaticExpressionFunction::prepare( const QgsExpressionNodeFunction *node
return true; return true;
} }
void QgsStaticExpressionFunction::setIsStaticFunction( std::function<bool ( const QgsExpressionNodeFunction *, QgsExpression *, const QgsExpressionContext * )> isStatic ) void QgsStaticExpressionFunction::setIsStaticFunction( const std::function<bool ( const QgsExpressionNodeFunction *, QgsExpression *, const QgsExpressionContext * )> &isStatic )
{ {
mIsStaticFunc = isStatic; mIsStaticFunc = isStatic;
} }
@ -193,7 +193,7 @@ void QgsStaticExpressionFunction::setIsStatic( bool isStatic )
mIsStatic = isStatic; mIsStatic = isStatic;
} }
void QgsStaticExpressionFunction::setPrepareFunction( std::function<bool ( const QgsExpressionNodeFunction *, QgsExpression *, const QgsExpressionContext * )> prepareFunc ) void QgsStaticExpressionFunction::setPrepareFunction( const std::function<bool ( const QgsExpressionNodeFunction *, QgsExpression *, const QgsExpressionContext * )> &prepareFunc )
{ {
mPrepareFunc = prepareFunc; mPrepareFunc = prepareFunc;
} }

View File

@ -369,8 +369,8 @@ class QgsStaticExpressionFunction : public QgsExpressionFunction
FcnEval fcn, FcnEval fcn,
const QString &group, const QString &group,
const QString &helpText, const QString &helpText,
std::function < bool ( const QgsExpressionNodeFunction *node ) > usesGeometry, const std::function< bool( const QgsExpressionNodeFunction * )> &usesGeometry,
std::function < QSet<QString>( const QgsExpressionNodeFunction *node ) > referencedColumns, const std::function< QSet<QString>( const QgsExpressionNodeFunction * )> &referencedColumns,
bool lazyEval = false, bool lazyEval = false,
const QStringList &aliases = QStringList(), const QStringList &aliases = QStringList(),
bool handlesNull = false ); bool handlesNull = false );
@ -423,7 +423,7 @@ class QgsStaticExpressionFunction : public QgsExpressionFunction
* By default this is set to a function that checks all arguments that have been passed to the variable * By default this is set to a function that checks all arguments that have been passed to the variable
* and if all of them are static, it will be assumed that the function is static as well. * and if all of them are static, it will be assumed that the function is static as well.
*/ */
void setIsStaticFunction( std::function < bool( const QgsExpressionNodeFunction *node, QgsExpression *parent, const QgsExpressionContext *context ) > isStatic ); void setIsStaticFunction( const std::function< bool ( const QgsExpressionNodeFunction *, QgsExpression *, const QgsExpressionContext * ) > &isStatic );
/** /**
* Tag this function as either static or not static. * Tag this function as either static or not static.
@ -440,7 +440,7 @@ class QgsStaticExpressionFunction : public QgsExpressionFunction
* By default this is set to a function that checks all arguments that have been passed to the variable * By default this is set to a function that checks all arguments that have been passed to the variable
* and if all of them are static, it will be assumed that the function is static as well. * and if all of them are static, it will be assumed that the function is static as well.
*/ */
void setPrepareFunction( std::function < bool( const QgsExpressionNodeFunction *node, QgsExpression *parent, const QgsExpressionContext *context ) > prepareFunc ); void setPrepareFunction( const std::function< bool( const QgsExpressionNodeFunction *, QgsExpression *, const QgsExpressionContext * )> &prepareFunc );
static const QList<QgsExpressionFunction *> &functions(); static const QList<QgsExpressionFunction *> &functions();

View File

@ -223,7 +223,7 @@ bool QgsGeometryEditUtils::deletePart( QgsAbstractGeometry *geom, int partNum )
std::unique_ptr<QgsAbstractGeometry> QgsGeometryEditUtils::avoidIntersections( const QgsAbstractGeometry &geom, std::unique_ptr<QgsAbstractGeometry> QgsGeometryEditUtils::avoidIntersections( const QgsAbstractGeometry &geom,
const QList<QgsVectorLayer *> &avoidIntersectionsLayers, const QList<QgsVectorLayer *> &avoidIntersectionsLayers,
QHash<QgsVectorLayer *, QSet<QgsFeatureId> > ignoreFeatures ) const QHash<QgsVectorLayer *, QSet<QgsFeatureId> > &ignoreFeatures )
{ {
std::unique_ptr<QgsGeometryEngine> geomEngine( QgsGeometry::createGeometryEngine( &geom ) ); std::unique_ptr<QgsGeometryEngine> geomEngine( QgsGeometry::createGeometryEngine( &geom ) );
if ( !geomEngine ) if ( !geomEngine )

View File

@ -72,7 +72,7 @@ class QgsGeometryEditUtils
*/ */
static std::unique_ptr< QgsAbstractGeometry > avoidIntersections( const QgsAbstractGeometry &geom, static std::unique_ptr< QgsAbstractGeometry > avoidIntersections( const QgsAbstractGeometry &geom,
const QList<QgsVectorLayer *> &avoidIntersectionsLayers, const QList<QgsVectorLayer *> &avoidIntersectionsLayers,
QHash<QgsVectorLayer *, QSet<QgsFeatureId> > ignoreFeatures = ( QHash<QgsVectorLayer *, QSet<QgsFeatureId> >() ) ); const QHash<QgsVectorLayer *, QSet<QgsFeatureId> > &ignoreFeatures = ( QHash<QgsVectorLayer *, QSet<QgsFeatureId> >() ) );
}; };
#endif // QGSGEOMETRYEDITUTILS_H #endif // QGSGEOMETRYEDITUTILS_H

View File

@ -249,7 +249,7 @@ QgsDissolveAlgorithm *QgsDissolveAlgorithm::createInstance() const
} }
QVariantMap QgsCollectorAlgorithm::processCollection( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap QgsCollectorAlgorithm::processCollection( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback,
std::function<QgsGeometry( const QList< QgsGeometry >& )> collector, int maxQueueLength ) const std::function<QgsGeometry( const QList< QgsGeometry >& )> &collector, int maxQueueLength )
{ {
std::unique_ptr< QgsFeatureSource > source( parameterAsSource( parameters, QStringLiteral( "INPUT" ), context ) ); std::unique_ptr< QgsFeatureSource > source( parameterAsSource( parameters, QStringLiteral( "INPUT" ), context ) );
if ( !source ) if ( !source )
@ -1399,7 +1399,7 @@ QVariantMap QgsSelectByLocationAlgorithm::processAlgorithm( const QVariantMap &p
void QgsLocationBasedAlgorithm::process( QgsFeatureSource *targetSource, void QgsLocationBasedAlgorithm::process( QgsFeatureSource *targetSource,
QgsFeatureSource *intersectSource, QgsFeatureSource *intersectSource,
const QList< int > &selectedPredicates, const QList< int > &selectedPredicates,
std::function < void( const QgsFeature & ) > handleFeatureFunction, const std::function < void( const QgsFeature & ) > &handleFeatureFunction,
bool onlyRequireTargetIds, bool onlyRequireTargetIds,
QgsFeedback *feedback ) QgsFeedback *feedback )
{ {

View File

@ -139,7 +139,7 @@ class QgsCollectorAlgorithm : public QgsProcessingAlgorithm
protected: protected:
QVariantMap processCollection( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap processCollection( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback,
std::function<QgsGeometry( const QList< QgsGeometry >& )> collector, int maxQueueLength = 0 ); const std::function<QgsGeometry( const QList<QgsGeometry>& )> &collector, int maxQueueLength = 0 );
}; };
/** /**
@ -505,7 +505,7 @@ class QgsLocationBasedAlgorithm : public QgsProcessingAlgorithm
Predicate reversePredicate( Predicate predicate ) const; Predicate reversePredicate( Predicate predicate ) const;
QStringList predicateOptionsList() const; QStringList predicateOptionsList() const;
void process( QgsFeatureSource *targetSource, QgsFeatureSource *intersectSource, const QList<int> &selectedPredicates, std::function<void ( const QgsFeature & )> handleFeatureFunction, bool onlyRequireTargetIds, QgsFeedback *feedback ); void process( QgsFeatureSource *targetSource, QgsFeatureSource *intersectSource, const QList<int> &selectedPredicates, const std::function< void( const QgsFeature & )> &handleFeatureFunction, bool onlyRequireTargetIds, QgsFeedback *feedback );
}; };
/** /**

View File

@ -114,7 +114,7 @@ QgsFeatureRequest &QgsFeatureRequest::setInvalidGeometryCheck( QgsFeatureRequest
return *this; return *this;
} }
QgsFeatureRequest &QgsFeatureRequest::setInvalidGeometryCallback( std::function<void ( const QgsFeature & )> callback ) QgsFeatureRequest &QgsFeatureRequest::setInvalidGeometryCallback( const std::function<void ( const QgsFeature & )> &callback )
{ {
mInvalidGeometryCallback = callback; mInvalidGeometryCallback = callback;
return *this; return *this;
@ -248,7 +248,7 @@ QgsFeatureRequest &QgsFeatureRequest::setDestinationCrs( const QgsCoordinateRefe
return *this; return *this;
} }
QgsFeatureRequest &QgsFeatureRequest::setTransformErrorCallback( std::function<void ( const QgsFeature & )> callback ) QgsFeatureRequest &QgsFeatureRequest::setTransformErrorCallback( const std::function<void ( const QgsFeature & )> &callback )
{ {
mTransformErrorCallback = callback; mTransformErrorCallback = callback;
return *this; return *this;

View File

@ -352,7 +352,7 @@ class CORE_EXPORT QgsFeatureRequest
* \see invalidGeometryCallback() * \see invalidGeometryCallback()
*/ */
#ifndef SIP_RUN #ifndef SIP_RUN
QgsFeatureRequest &setInvalidGeometryCallback( std::function< void( const QgsFeature & ) > callback ); QgsFeatureRequest &setInvalidGeometryCallback( const std::function< void( const QgsFeature & )> &callback );
#else #else
QgsFeatureRequest &setInvalidGeometryCallback( SIP_PYCALLABLE / AllowNone / ); QgsFeatureRequest &setInvalidGeometryCallback( SIP_PYCALLABLE / AllowNone / );
% MethodCode % MethodCode
@ -545,7 +545,7 @@ class CORE_EXPORT QgsFeatureRequest
* \see setDestinationCrs() * \see setDestinationCrs()
*/ */
#ifndef SIP_RUN #ifndef SIP_RUN
QgsFeatureRequest &setTransformErrorCallback( std::function< void( const QgsFeature & ) > callback ); QgsFeatureRequest &setTransformErrorCallback( const std::function< void( const QgsFeature & )> &callback );
#else #else
QgsFeatureRequest &setTransformErrorCallback( SIP_PYCALLABLE / AllowNone / ); QgsFeatureRequest &setTransformErrorCallback( SIP_PYCALLABLE / AllowNone / );
% MethodCode % MethodCode

View File

@ -287,7 +287,7 @@ QString QgsJsonUtils::encodeValue( const QVariant &value )
} }
} }
QString QgsJsonUtils::exportAttributes( const QgsFeature &feature, QgsVectorLayer *layer, QVector<QVariant> attributeWidgetCaches ) QString QgsJsonUtils::exportAttributes( const QgsFeature &feature, QgsVectorLayer *layer, const QVector<QVariant> &attributeWidgetCaches )
{ {
QgsFields fields = feature.fields(); QgsFields fields = feature.fields();
QString attrs; QString attrs;

View File

@ -246,7 +246,7 @@ class CORE_EXPORT QgsJsonUtils
* to speed up exporting the attributes for multiple features from the same layer. * to speed up exporting the attributes for multiple features from the same layer.
*/ */
static QString exportAttributes( const QgsFeature &feature, QgsVectorLayer *layer = nullptr, static QString exportAttributes( const QgsFeature &feature, QgsVectorLayer *layer = nullptr,
QVector<QVariant> attributeWidgetCaches = QVector<QVariant>() ); const QVector<QVariant> &attributeWidgetCaches = QVector<QVariant>() );
/** Parse a simple array (depth=1). /** Parse a simple array (depth=1).
* \param json the JSON to parse * \param json the JSON to parse

View File

@ -51,7 +51,7 @@ void QgsMapRendererTask::addAnnotations( QList< QgsAnnotation * > annotations )
} }
} }
void QgsMapRendererTask::addDecorations( QList< QgsMapDecoration * > decorations ) void QgsMapRendererTask::addDecorations( const QList< QgsMapDecoration * > &decorations )
{ {
mDecorations = decorations; mDecorations = decorations;
} }

View File

@ -72,7 +72,7 @@ class CORE_EXPORT QgsMapRendererTask : public QgsTask
/** /**
* Adds \a decorations to be rendered on the map. * Adds \a decorations to be rendered on the map.
*/ */
void addDecorations( QList< QgsMapDecoration * > decorations ); void addDecorations( const QList<QgsMapDecoration *> &decorations );
/** /**
* Sets whether a world file will be created alongside an image file. * Sets whether a world file will be created alongside an image file.

View File

@ -28,7 +28,7 @@ QgsProviderMetadata::QgsProviderMetadata( QString const &_key,
, library_( _library ) , library_( _library )
{} {}
QgsProviderMetadata::QgsProviderMetadata( const QString &key, const QString &description, QgsProviderMetadata::CreateDataProviderFunction createFunc ) QgsProviderMetadata::QgsProviderMetadata( const QString &key, const QString &description, const CreateDataProviderFunction &createFunc )
: key_( key ) : key_( key )
, description_( description ) , description_( description )
, mCreateFunc( createFunc ) , mCreateFunc( createFunc )

View File

@ -61,7 +61,7 @@ class CORE_EXPORT QgsProviderMetadata
* \since QGIS 3.0 * \since QGIS 3.0
* \note not available in Python bindings * \note not available in Python bindings
*/ */
SIP_SKIP QgsProviderMetadata( const QString &key, const QString &description, QgsProviderMetadata::CreateDataProviderFunction createFunc ); SIP_SKIP QgsProviderMetadata( const QString &key, const QString &description, const QgsProviderMetadata::CreateDataProviderFunction &createFunc );
/** This returns the unique key associated with the provider /** This returns the unique key associated with the provider

View File

@ -24,7 +24,7 @@
QString QgsSettings::sGlobalSettingsPath = QString(); QString QgsSettings::sGlobalSettingsPath = QString();
bool QgsSettings::setGlobalSettingsPath( QString path ) bool QgsSettings::setGlobalSettingsPath( const QString &path )
{ {
if ( QFileInfo::exists( path ) ) if ( QFileInfo::exists( path ) )
{ {
@ -279,7 +279,7 @@ void QgsSettings::setValue( const QString &key, const QVariant &value, const Qgs
} }
// To lower case and clean the path // To lower case and clean the path
QString QgsSettings::sanitizeKey( QString key ) const QString QgsSettings::sanitizeKey( const QString &key ) const
{ {
return QDir::cleanPath( key ); return QDir::cleanPath( key );
} }

View File

@ -155,7 +155,7 @@ class CORE_EXPORT QgsSettings : public QObject
//! Return the path to the Global Settings QSettings storage file //! Return the path to the Global Settings QSettings storage file
static QString globalSettingsPath() { return sGlobalSettingsPath; } static QString globalSettingsPath() { return sGlobalSettingsPath; }
//! Set the Global Settings QSettings storage file //! Set the Global Settings QSettings storage file
static bool setGlobalSettingsPath( QString path ); static bool setGlobalSettingsPath( const QString &path );
//! Adds prefix to the current group and starts reading from an array. Returns the size of the array. //! Adds prefix to the current group and starts reading from an array. Returns the size of the array.
int beginReadArray( const QString &prefix ); int beginReadArray( const QString &prefix );
@ -229,7 +229,7 @@ class CORE_EXPORT QgsSettings : public QObject
static QString sGlobalSettingsPath; static QString sGlobalSettingsPath;
void init(); void init();
QString sanitizeKey( QString key ) const; QString sanitizeKey( const QString &key ) const;
QSettings *mUserSettings = nullptr; QSettings *mUserSettings = nullptr;
QSettings *mGlobalSettings = nullptr; QSettings *mGlobalSettings = nullptr;
bool mUsingGlobalArray = false; bool mUsingGlobalArray = false;

View File

@ -78,7 +78,7 @@ QgsDataSourceManagerDialog::~QgsDataSourceManagerDialog()
delete ui; delete ui;
} }
void QgsDataSourceManagerDialog::openPage( QString pageName ) void QgsDataSourceManagerDialog::openPage( const QString &pageName )
{ {
int pageIdx = mPageNames.indexOf( pageName ); int pageIdx = mPageNames.indexOf( pageName );
if ( pageIdx != -1 ) if ( pageIdx != -1 )
@ -122,7 +122,7 @@ void QgsDataSourceManagerDialog::vectorLayersAdded( const QStringList &layerQStr
} }
void QgsDataSourceManagerDialog::addProviderDialog( QgsAbstractDataSourceWidget *dlg, const QString &providerKey, const QString &providerName, const QIcon &icon, QString toolTip ) void QgsDataSourceManagerDialog::addProviderDialog( QgsAbstractDataSourceWidget *dlg, const QString &providerKey, const QString &providerName, const QIcon &icon, const QString &toolTip )
{ {
mPageNames.append( providerKey ); mPageNames.append( providerKey );
ui->mOptionsStackedWidget->addWidget( dlg ); ui->mOptionsStackedWidget->addWidget( dlg );

View File

@ -60,7 +60,7 @@ class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, priva
* \param pageName the page name, usually the provider name or "browser" (for the browser panel) * \param pageName the page name, usually the provider name or "browser" (for the browser panel)
* or "ogr" (vector layers) or "raster" (raster layers) * or "ogr" (vector layers) or "raster" (raster layers)
*/ */
void openPage( QString pageName ); void openPage( const QString &pageName );
public slots: public slots:
@ -114,7 +114,7 @@ class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, priva
void providerDialogsRefreshRequested(); void providerDialogsRefreshRequested();
private: private:
void addProviderDialog( QgsAbstractDataSourceWidget *dlg, const QString &providerKey, const QString &providerName, const QIcon &icon, QString toolTip = QString() ); void addProviderDialog( QgsAbstractDataSourceWidget *dlg, const QString &providerKey, const QString &providerName, const QIcon &icon, const QString &toolTip = QString() );
void makeConnections( QgsAbstractDataSourceWidget *dlg, const QString &providerKey ); void makeConnections( QgsAbstractDataSourceWidget *dlg, const QString &providerKey );
Ui::QgsDataSourceManagerDialog *ui; Ui::QgsDataSourceManagerDialog *ui;
QgsBrowserDockWidget *mBrowserWidget = nullptr; QgsBrowserDockWidget *mBrowserWidget = nullptr;

View File

@ -26,7 +26,7 @@
#include <QSslError> #include <QSslError>
#endif #endif
QgsFileDownloader::QgsFileDownloader( const QUrl &url, const QString &outputFileName, bool enableGuiNotifications, QString authcfg ) QgsFileDownloader::QgsFileDownloader( const QUrl &url, const QString &outputFileName, bool enableGuiNotifications, const QString &authcfg )
: mUrl( url ) : mUrl( url )
, mDownloadCanceled( false ) , mDownloadCanceled( false )
, mGuiNotificationsEnabled( enableGuiNotifications ) , mGuiNotificationsEnabled( enableGuiNotifications )

View File

@ -53,7 +53,7 @@ class GUI_EXPORT QgsFileDownloader : public QObject
* \param guiNotificationsEnabled if false, the downloader will not display any progress bar or error message * \param guiNotificationsEnabled if false, the downloader will not display any progress bar or error message
* \param authcfg optionally apply this authentication configuration * \param authcfg optionally apply this authentication configuration
*/ */
QgsFileDownloader( const QUrl &url, const QString &outputFileName, bool guiNotificationsEnabled = true, QString authcfg = QString() ); QgsFileDownloader( const QUrl &url, const QString &outputFileName, bool guiNotificationsEnabled = true, const QString &authcfg = QString() );
signals: signals:
//! Emitted when the download has completed successfully //! Emitted when the download has completed successfully

View File

@ -24,7 +24,7 @@ void buildSupportedRasterFileFilterAndExtensions( QString &fileFiltersString, QS
QgsGdalLayerItem::QgsGdalLayerItem( QgsDataItem *parent, QgsGdalLayerItem::QgsGdalLayerItem( QgsDataItem *parent,
QString name, QString path, QString uri, const QString &name, const QString &path, const QString &uri,
QStringList *sublayers ) QStringList *sublayers )
: QgsLayerItem( parent, name, path, uri, QgsLayerItem::Raster, QStringLiteral( "gdal" ) ) : QgsLayerItem( parent, name, path, uri, QgsLayerItem::Raster, QStringLiteral( "gdal" ) )
{ {

View File

@ -27,7 +27,7 @@ class QgsGdalLayerItem : public QgsLayerItem
public: public:
QgsGdalLayerItem( QgsDataItem *parent, QgsGdalLayerItem( QgsDataItem *parent,
QString name, QString path, QString uri, const QString &name, const QString &path, const QString &uri,
QStringList *mSublayers = nullptr ); QStringList *mSublayers = nullptr );
bool setCrs( const QgsCoordinateReferenceSystem &crs ) override; bool setCrs( const QgsCoordinateReferenceSystem &crs ) override;

View File

@ -103,7 +103,7 @@ int CPL_STDCALL progressCallback( double dfComplete,
return true; return true;
} }
QgsGdalProvider::QgsGdalProvider( const QString &uri, QgsError error ) QgsGdalProvider::QgsGdalProvider( const QString &uri, const QgsError &error )
: QgsRasterDataProvider( uri ) : QgsRasterDataProvider( uri )
, mUpdate( false ) , mUpdate( false )
, mValid( false ) , mValid( false )

View File

@ -69,7 +69,7 @@ class QgsGdalProvider : public QgsRasterDataProvider, QgsGdalProviderBase
QgsGdalProvider( QString const &uri = QString(), bool update = false ); QgsGdalProvider( QString const &uri = QString(), bool update = false );
//! Create invalid provider with error //! Create invalid provider with error
QgsGdalProvider( QString const &uri, QgsError error ); QgsGdalProvider( QString const &uri, const QgsError &error );
~QgsGdalProvider(); ~QgsGdalProvider();

View File

@ -46,7 +46,7 @@ QgsDataItem *QgsGeoPackageDataItemProvider::createDataItem( const QString &path,
return nullptr; return nullptr;
} }
QgsGeoPackageRootItem::QgsGeoPackageRootItem( QgsDataItem *parent, QString name, QString path ) QgsGeoPackageRootItem::QgsGeoPackageRootItem( QgsDataItem *parent, const QString &name, const QString &path )
: QgsDataCollectionItem( parent, name, path ) : QgsDataCollectionItem( parent, name, path )
{ {
mCapabilities |= Fast; mCapabilities |= Fast;
@ -120,7 +120,7 @@ void QgsGeoPackageRootItem::createDatabase()
#endif #endif
QgsGeoPackageConnectionItem::QgsGeoPackageConnectionItem( QgsDataItem *parent, QString name, QString path ) QgsGeoPackageConnectionItem::QgsGeoPackageConnectionItem( QgsDataItem *parent, const QString &name, const QString &path )
: QgsDataCollectionItem( parent, name, path ) : QgsDataCollectionItem( parent, name, path )
, mPath( path ) , mPath( path )
{ {
@ -328,7 +328,7 @@ bool QgsGeoPackageConnectionItem::handleDrop( const QMimeData *data, Qt::DropAct
} }
bool QgsGeoPackageConnectionItem::deleteGeoPackageRasterLayer( const QString uri, QString &errCause ) bool QgsGeoPackageConnectionItem::deleteGeoPackageRasterLayer( const QString &uri, QString &errCause )
{ {
bool result = false; bool result = false;
// Better safe than sorry // Better safe than sorry
@ -526,7 +526,7 @@ void QgsGeoPackageAbstractLayerItem::deleteLayer()
} }
QgsGeoPackageAbstractLayerItem::QgsGeoPackageAbstractLayerItem( QgsDataItem *parent, QString name, QString path, QString uri, QgsLayerItem::LayerType layerType, QString providerKey ) QgsGeoPackageAbstractLayerItem::QgsGeoPackageAbstractLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, QgsLayerItem::LayerType layerType, const QString &providerKey )
: QgsLayerItem( parent, name, path, uri, layerType, providerKey ) : QgsLayerItem( parent, name, path, uri, layerType, providerKey )
{ {
setState( Populated ); // no children are expected setState( Populated ); // no children are expected
@ -539,14 +539,14 @@ bool QgsGeoPackageAbstractLayerItem::executeDeleteLayer( QString &errCause )
} }
QgsGeoPackageVectorLayerItem::QgsGeoPackageVectorLayerItem( QgsDataItem *parent, QString name, QString path, QString uri, LayerType layerType ) QgsGeoPackageVectorLayerItem::QgsGeoPackageVectorLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, LayerType layerType )
: QgsGeoPackageAbstractLayerItem( parent, name, path, uri, layerType, QStringLiteral( "ogr" ) ) : QgsGeoPackageAbstractLayerItem( parent, name, path, uri, layerType, QStringLiteral( "ogr" ) )
{ {
} }
QgsGeoPackageRasterLayerItem::QgsGeoPackageRasterLayerItem( QgsDataItem *parent, QString name, QString path, QString uri ) QgsGeoPackageRasterLayerItem::QgsGeoPackageRasterLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri )
: QgsGeoPackageAbstractLayerItem( parent, name, path, uri, QgsLayerItem::LayerType::Raster, QStringLiteral( "gdal" ) ) : QgsGeoPackageAbstractLayerItem( parent, name, path, uri, QgsLayerItem::LayerType::Raster, QStringLiteral( "gdal" ) )
{ {

View File

@ -28,7 +28,7 @@ class QgsGeoPackageAbstractLayerItem : public QgsLayerItem
Q_OBJECT Q_OBJECT
protected: protected:
QgsGeoPackageAbstractLayerItem( QgsDataItem *parent, QString name, QString path, QString uri, LayerType layerType, QString providerKey ); QgsGeoPackageAbstractLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, LayerType layerType, const QString &providerKey );
/** Subclasses need to implement this function with /** Subclasses need to implement this function with
* the real deletion implementation * the real deletion implementation
@ -47,7 +47,7 @@ class QgsGeoPackageRasterLayerItem : public QgsGeoPackageAbstractLayerItem
Q_OBJECT Q_OBJECT
public: public:
QgsGeoPackageRasterLayerItem( QgsDataItem *parent, QString name, QString path, QString uri ); QgsGeoPackageRasterLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri );
protected: protected:
virtual bool executeDeleteLayer( QString &errCause ) override; virtual bool executeDeleteLayer( QString &errCause ) override;
}; };
@ -58,7 +58,7 @@ class QgsGeoPackageVectorLayerItem : public QgsGeoPackageAbstractLayerItem
Q_OBJECT Q_OBJECT
public: public:
QgsGeoPackageVectorLayerItem( QgsDataItem *parent, QString name, QString path, QString uri, LayerType layerType ); QgsGeoPackageVectorLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, LayerType layerType );
protected: protected:
virtual bool executeDeleteLayer( QString &errCause ) override; virtual bool executeDeleteLayer( QString &errCause ) override;
}; };
@ -69,7 +69,7 @@ class QgsGeoPackageConnectionItem : public QgsDataCollectionItem
Q_OBJECT Q_OBJECT
public: public:
QgsGeoPackageConnectionItem( QgsDataItem *parent, QString name, QString path ); QgsGeoPackageConnectionItem( QgsDataItem *parent, const QString &name, const QString &path );
QVector<QgsDataItem *> createChildren() override; QVector<QgsDataItem *> createChildren() override;
virtual bool equal( const QgsDataItem *other ) override; virtual bool equal( const QgsDataItem *other ) override;
@ -83,7 +83,7 @@ class QgsGeoPackageConnectionItem : public QgsDataCollectionItem
static QgsLayerItem::LayerType layerTypeFromDb( const QString &geometryType ); static QgsLayerItem::LayerType layerTypeFromDb( const QString &geometryType );
//! Delete a geopackage layer //! Delete a geopackage layer
static bool deleteGeoPackageRasterLayer( const QString uri, QString &errCause ); static bool deleteGeoPackageRasterLayer( const QString &uri, QString &errCause );
public slots: public slots:
#ifdef HAVE_GUI #ifdef HAVE_GUI
@ -102,7 +102,7 @@ class QgsGeoPackageRootItem : public QgsDataCollectionItem
Q_OBJECT Q_OBJECT
public: public:
QgsGeoPackageRootItem( QgsDataItem *parent, QString name, QString path ); QgsGeoPackageRootItem( QgsDataItem *parent, const QString &name, const QString &path );
QVector<QgsDataItem *> createChildren() override; QVector<QgsDataItem *> createChildren() override;

View File

@ -24,7 +24,7 @@
#include <QMessageBox> #include <QMessageBox>
QgsGeoPackageRasterWriter::QgsGeoPackageRasterWriter( const QgsMimeDataUtils::Uri sourceUri, const QString outputUrl ): QgsGeoPackageRasterWriter::QgsGeoPackageRasterWriter( const QgsMimeDataUtils::Uri &sourceUri, const QString &outputUrl ):
mSourceUri( sourceUri ), mSourceUri( sourceUri ),
mOutputUrl( outputUrl ) mOutputUrl( outputUrl )
{ {

View File

@ -35,7 +35,7 @@ class QgsGeoPackageRasterWriter
ErrUserCanceled, //!< User canceled the export ErrUserCanceled, //!< User canceled the export
}; };
QgsGeoPackageRasterWriter( const QgsMimeDataUtils::Uri sourceUri, const QString destinationPath ); QgsGeoPackageRasterWriter( const QgsMimeDataUtils::Uri &sourceUri, const QString &destinationPath );
WriterError writeRaster( QgsFeedback *feedback, QString *errorMessage ); WriterError writeRaster( QgsFeedback *feedback, QString *errorMessage );
const QString outputUrl() const { return mOutputUrl; } const QString outputUrl() const { return mOutputUrl; }

View File

@ -19,7 +19,7 @@
///@cond PRIVATE ///@cond PRIVATE
QgsGeoPackageRasterWriterTask::QgsGeoPackageRasterWriterTask( const QgsMimeDataUtils::Uri sourceUri, const QString destinationPath ) QgsGeoPackageRasterWriterTask::QgsGeoPackageRasterWriterTask( const QgsMimeDataUtils::Uri &sourceUri, const QString &destinationPath )
: QgsTask( tr( "Saving %1" ).arg( destinationPath ), QgsTask::CanCancel ) : QgsTask( tr( "Saving %1" ).arg( destinationPath ), QgsTask::CanCancel )
, mWriter( sourceUri, destinationPath ) , mWriter( sourceUri, destinationPath )
, mFeedback( new QgsFeedback() ) , mFeedback( new QgsFeedback() )

View File

@ -45,7 +45,7 @@ class QgsGeoPackageRasterWriterTask : public QgsTask
* Constructor for QgsVectorFileWriterTask. Takes a source \a layer, destination \a fileName * Constructor for QgsVectorFileWriterTask. Takes a source \a layer, destination \a fileName
* and save \a options. * and save \a options.
*/ */
QgsGeoPackageRasterWriterTask( const QgsMimeDataUtils::Uri sourceUri, const QString destinationPath ); QgsGeoPackageRasterWriterTask( const QgsMimeDataUtils::Uri &sourceUri, const QString &destinationPath );
virtual void cancel() override; virtual void cancel() override;

View File

@ -43,7 +43,7 @@ QGISEXTERN bool deleteLayer( const QString &uri, const QString &errCause );
QgsOgrLayerItem::QgsOgrLayerItem( QgsDataItem *parent, QgsOgrLayerItem::QgsOgrLayerItem( QgsDataItem *parent,
QString name, QString path, QString uri, LayerType layerType, bool isSubLayer ) const QString &name, const QString &path, const QString &uri, LayerType layerType, bool isSubLayer )
: QgsLayerItem( parent, name, path, uri, layerType, QStringLiteral( "ogr" ) ) : QgsLayerItem( parent, name, path, uri, layerType, QStringLiteral( "ogr" ) )
{ {
mIsSubLayer = isSubLayer; mIsSubLayer = isSubLayer;
@ -395,7 +395,7 @@ static QgsOgrLayerItem *dataItemForLayer( QgsDataItem *parentItem, QString name,
// ---- // ----
QgsOgrDataCollectionItem::QgsOgrDataCollectionItem( QgsDataItem *parent, QString name, QString path ) QgsOgrDataCollectionItem::QgsOgrDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path )
: QgsDataCollectionItem( parent, name, path ) : QgsDataCollectionItem( parent, name, path )
{ {
} }

View File

@ -57,7 +57,7 @@ class QgsOgrLayerItem : public QgsLayerItem
{ {
Q_OBJECT Q_OBJECT
public: public:
QgsOgrLayerItem( QgsDataItem *parent, QString name, QString path, QString uri, LayerType layerType, bool isSubLayer = false ); QgsOgrLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, LayerType layerType, bool isSubLayer = false );
bool setCrs( const QgsCoordinateReferenceSystem &crs ) override; bool setCrs( const QgsCoordinateReferenceSystem &crs ) override;
@ -81,7 +81,7 @@ class QgsOgrDataCollectionItem : public QgsDataCollectionItem
{ {
Q_OBJECT Q_OBJECT
public: public:
QgsOgrDataCollectionItem( QgsDataItem *parent, QString name, QString path ); QgsOgrDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path );
QVector<QgsDataItem *> createChildren() override; QVector<QgsDataItem *> createChildren() override;

View File

@ -39,7 +39,7 @@ QGISEXTERN bool deleteSchema( const QString &schema, const QgsDataSourceUri &uri
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
QgsPGConnectionItem::QgsPGConnectionItem( QgsDataItem *parent, QString name, QString path ) QgsPGConnectionItem::QgsPGConnectionItem( QgsDataItem *parent, const QString &name, const QString &path )
: QgsDataCollectionItem( parent, name, path ) : QgsDataCollectionItem( parent, name, path )
{ {
mIconName = QStringLiteral( "mIconConnect.png" ); mIconName = QStringLiteral( "mIconConnect.png" );
@ -706,7 +706,7 @@ bool QgsPGSchemaItem::handleDrop( const QMimeData *data, Qt::DropAction )
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
QgsPGRootItem::QgsPGRootItem( QgsDataItem *parent, QString name, QString path ) QgsPGRootItem::QgsPGRootItem( QgsDataItem *parent, const QString &name, const QString &path )
: QgsDataCollectionItem( parent, name, path ) : QgsDataCollectionItem( parent, name, path )
{ {
mCapabilities |= Fast; mCapabilities |= Fast;

View File

@ -32,7 +32,7 @@ class QgsPGRootItem : public QgsDataCollectionItem
{ {
Q_OBJECT Q_OBJECT
public: public:
QgsPGRootItem( QgsDataItem *parent, QString name, QString path ); QgsPGRootItem( QgsDataItem *parent, const QString &name, const QString &path );
QVector<QgsDataItem *> createChildren() override; QVector<QgsDataItem *> createChildren() override;
@ -55,7 +55,7 @@ class QgsPGConnectionItem : public QgsDataCollectionItem
{ {
Q_OBJECT Q_OBJECT
public: public:
QgsPGConnectionItem( QgsDataItem *parent, QString name, QString path ); QgsPGConnectionItem( QgsDataItem *parent, const QString &name, const QString &path );
QVector<QgsDataItem *> createChildren() override; QVector<QgsDataItem *> createChildren() override;
virtual bool equal( const QgsDataItem *other ) override; virtual bool equal( const QgsDataItem *other ) override;

View File

@ -34,7 +34,7 @@
QGISEXTERN bool deleteLayer( const QString &dbPath, const QString &tableName, QString &errCause ); QGISEXTERN bool deleteLayer( const QString &dbPath, const QString &tableName, QString &errCause );
QgsSLLayerItem::QgsSLLayerItem( QgsDataItem *parent, QString name, QString path, QString uri, LayerType layerType ) QgsSLLayerItem::QgsSLLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, LayerType layerType )
: QgsLayerItem( parent, name, path, uri, layerType, QStringLiteral( "spatialite" ) ) : QgsLayerItem( parent, name, path, uri, layerType, QStringLiteral( "spatialite" ) )
{ {
setState( Populated ); // no children are expected setState( Populated ); // no children are expected
@ -76,7 +76,7 @@ void QgsSLLayerItem::deleteLayer()
// ------ // ------
QgsSLConnectionItem::QgsSLConnectionItem( QgsDataItem *parent, QString name, QString path ) QgsSLConnectionItem::QgsSLConnectionItem( QgsDataItem *parent, const QString &name, const QString &path )
: QgsDataCollectionItem( parent, name, path ) : QgsDataCollectionItem( parent, name, path )
{ {
mDbPath = QgsSpatiaLiteConnection::connectionPath( name ); mDbPath = QgsSpatiaLiteConnection::connectionPath( name );
@ -275,7 +275,7 @@ bool QgsSLConnectionItem::handleDrop( const QMimeData *data, Qt::DropAction )
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
QgsSLRootItem::QgsSLRootItem( QgsDataItem *parent, QString name, QString path ) QgsSLRootItem::QgsSLRootItem( QgsDataItem *parent, const QString &name, const QString &path )
: QgsDataCollectionItem( parent, name, path ) : QgsDataCollectionItem( parent, name, path )
{ {
mCapabilities |= Fast; mCapabilities |= Fast;

View File

@ -21,7 +21,7 @@ class QgsSLLayerItem : public QgsLayerItem
{ {
Q_OBJECT Q_OBJECT
public: public:
QgsSLLayerItem( QgsDataItem *parent, QString name, QString path, QString uri, LayerType layerType ); QgsSLLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, LayerType layerType );
#ifdef HAVE_GUI #ifdef HAVE_GUI
QList<QAction *> actions() override; QList<QAction *> actions() override;
@ -37,7 +37,7 @@ class QgsSLConnectionItem : public QgsDataCollectionItem
{ {
Q_OBJECT Q_OBJECT
public: public:
QgsSLConnectionItem( QgsDataItem *parent, QString name, QString path ); QgsSLConnectionItem( QgsDataItem *parent, const QString &name, const QString &path );
QVector<QgsDataItem *> createChildren() override; QVector<QgsDataItem *> createChildren() override;
virtual bool equal( const QgsDataItem *other ) override; virtual bool equal( const QgsDataItem *other ) override;
@ -63,7 +63,7 @@ class QgsSLRootItem : public QgsDataCollectionItem
{ {
Q_OBJECT Q_OBJECT
public: public:
QgsSLRootItem( QgsDataItem *parent, QString name, QString path ); QgsSLRootItem( QgsDataItem *parent, const QString &name, const QString &path );
QVector<QgsDataItem *> createChildren() override; QVector<QgsDataItem *> createChildren() override;