Skip to content
Permalink
Browse files

Finish flipping a lot of methods to take const references for

non-trivial types
  • Loading branch information
nyalldawson committed Oct 26, 2015
1 parent f7f659b commit 70bff3f6aaa8cbe560b0f18a6a985dfa225f308d
Showing with 460 additions and 451 deletions.
  1. +2 −2 python/core/qgsapplication.sip
  2. +1 −1 python/core/qgsdataitem.sip
  3. +1 −1 python/core/qgsdataprovider.sip
  4. +2 −2 python/core/qgsproject.sip
  5. +2 −2 python/core/qgspythonrunner.sip
  6. +1 −1 python/core/qgsrenderchecker.sip
  7. +2 −2 python/core/raster/qgsrasterdataprovider.sip
  8. +19 −19 python/gui/qgisinterface.sip
  9. +1 −1 python/gui/qgsprojectbadlayerguihandler.sip
  10. +2 −2 src/app/qgisapp.cpp
  11. +28 −26 src/app/qgisappinterface.cpp
  12. +20 −20 src/app/qgisappinterface.h
  13. +1 −1 src/app/qgshandlebadlayers.cpp
  14. +1 −1 src/app/qgshandlebadlayers.h
  15. +21 −16 src/core/qgsapplication.cpp
  16. +2 −2 src/core/qgsapplication.h
  17. +1 −1 src/core/qgsdataitem.cpp
  18. +3 −3 src/core/qgsdataitem.h
  19. +1 −1 src/core/qgsdataprovider.h
  20. +1 −1 src/core/qgsproject.cpp
  21. +2 −2 src/core/qgsproject.h
  22. +1 −1 src/core/qgsproviderregistry.cpp
  23. +2 −2 src/core/qgspythonrunner.h
  24. +1 −1 src/core/qgsrenderchecker.cpp
  25. +1 −1 src/core/qgsrenderchecker.h
  26. +1 −1 src/core/qgsvectorlayer.cpp
  27. +2 −2 src/core/raster/qgsrasterdataprovider.h
  28. +19 −19 src/gui/qgisinterface.h
  29. +1 −1 src/gui/qgsprojectbadlayerguihandler.cpp
  30. +1 −1 src/gui/qgsprojectbadlayerguihandler.h
  31. +2 −2 src/gui/qgsrasterformatsaveoptionswidget.cpp
  32. +7 −7 src/providers/delimitedtext/qgsdelimitedtextfile.cpp
  33. +7 −7 src/providers/delimitedtext/qgsdelimitedtextfile.h
  34. +15 −14 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
  35. +6 −6 src/providers/delimitedtext/qgsdelimitedtextprovider.h
  36. +6 −6 src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
  37. +6 −6 src/providers/delimitedtext/qgsdelimitedtextsourceselect.h
  38. +2 −2 src/providers/gdal/qgsgdaldataitems.cpp
  39. +2 −2 src/providers/gdal/qgsgdaldataitems.h
  40. +10 −9 src/providers/gdal/qgsgdalprovider.cpp
  41. +3 −3 src/providers/gdal/qgsgdalprovider.h
  42. +3 −3 src/providers/gpx/gpsdata.cpp
  43. +3 −3 src/providers/gpx/gpsdata.h
  44. +1 −1 src/providers/gpx/qgsgpxprovider.cpp
  45. +1 −1 src/providers/gpx/qgsgpxprovider.h
  46. +1 −1 src/providers/grass/qgsgrassprovidermodule.h
  47. +2 −2 src/providers/memory/qgsmemoryprovider.cpp
  48. +2 −2 src/providers/memory/qgsmemoryprovider.h
  49. +5 −5 src/providers/mssql/qgsmssqldataitems.cpp
  50. +5 −5 src/providers/mssql/qgsmssqldataitems.h
  51. +1 −1 src/providers/mssql/qgsmssqlnewconnection.cpp
  52. +1 −1 src/providers/mssql/qgsmssqlnewconnection.h
  53. +6 −6 src/providers/mssql/qgsmssqlprovider.cpp
  54. +6 −6 src/providers/mssql/qgsmssqlprovider.h
  55. +6 −6 src/providers/mssql/qgsmssqlsourceselect.cpp
  56. +6 −6 src/providers/mssql/qgsmssqlsourceselect.h
  57. +2 −2 src/providers/ogr/qgsogrconnpool.h
  58. +3 −3 src/providers/ogr/qgsogrdataitems.cpp
  59. +3 −3 src/providers/ogr/qgsogrdataitems.h
  60. +4 −4 src/providers/ogr/qgsogrprovider.cpp
  61. +3 −3 src/providers/ogr/qgsogrprovider.h
  62. +1 −1 src/providers/oracle/qgsoracleprovider.cpp
  63. +1 −1 src/providers/oracle/qgsoracleprovider.h
  64. +4 −4 src/providers/ows/qgsowsdataitems.cpp
  65. +3 −3 src/providers/ows/qgsowsdataitems.h
  66. +1 −1 src/providers/postgres/qgscolumntypethread.cpp
  67. +1 −1 src/providers/postgres/qgscolumntypethread.h
  68. +20 −20 src/providers/postgres/qgspostgresconn.cpp
  69. +20 −20 src/providers/postgres/qgspostgresconn.h
  70. +2 −2 src/providers/postgres/qgspostgresconnpool.h
  71. +6 −6 src/providers/postgres/qgspostgresdataitems.cpp
  72. +6 −6 src/providers/postgres/qgspostgresdataitems.h
  73. +6 −6 src/providers/postgres/qgspostgresprovider.cpp
  74. +6 −6 src/providers/postgres/qgspostgresprovider.h
  75. +5 −5 src/providers/spatialite/qgsspatialiteconnection.cpp
  76. +6 −6 src/providers/spatialite/qgsspatialiteconnection.h
  77. +2 −2 src/providers/spatialite/qgsspatialiteconnpool.h
  78. +5 −5 src/providers/spatialite/qgsspatialitedataitems.cpp
  79. +3 −3 src/providers/spatialite/qgsspatialitedataitems.h
  80. +1 −1 src/providers/spatialite/qgsspatialitefeatureiterator.cpp
  81. +1 −1 src/providers/spatialite/qgsspatialitefeatureiterator.h
  82. +2 −2 src/providers/spatialite/qgsspatialiteprovider.cpp
  83. +1 −1 src/providers/spatialite/qgsspatialiteprovider.h
  84. +2 −2 src/providers/spatialite/qgsspatialitesourceselect.cpp
  85. +2 −2 src/providers/spatialite/qgsspatialitesourceselect.h
  86. +1 −1 src/providers/spatialite/qgsspatialitetablemodel.cpp
  87. +1 −1 src/providers/spatialite/qgsspatialitetablemodel.h
  88. +2 −2 src/providers/wcs/qgswcscapabilities.cpp
  89. +2 −2 src/providers/wcs/qgswcscapabilities.h
  90. +4 −4 src/providers/wcs/qgswcsdataitems.cpp
  91. +4 −4 src/providers/wcs/qgswcsdataitems.h
  92. +3 −3 src/providers/wcs/qgswcsprovider.cpp
  93. +3 −3 src/providers/wcs/qgswcsprovider.h
  94. +2 −2 src/providers/wfs/qgswfscapabilities.cpp
  95. +3 −3 src/providers/wfs/qgswfscapabilities.h
  96. +4 −4 src/providers/wfs/qgswfsdataitems.cpp
  97. +3 −3 src/providers/wfs/qgswfsdataitems.h
  98. +2 −2 src/providers/wfs/qgswfsprovider.cpp
  99. +2 −2 src/providers/wfs/qgswfsprovider.h
  100. +1 −1 src/providers/wfs/qgswfssourceselect.cpp
  101. +1 −1 src/providers/wfs/qgswfssourceselect.h
  102. +2 −2 src/providers/wms/qgswmscapabilities.cpp
  103. +2 −2 src/providers/wms/qgswmscapabilities.h
  104. +3 −3 src/providers/wms/qgswmsconnection.cpp
  105. +3 −3 src/providers/wms/qgswmsconnection.h
  106. +4 −4 src/providers/wms/qgswmsdataitems.cpp
  107. +4 −4 src/providers/wms/qgswmsdataitems.h
  108. +2 −2 src/providers/wms/qgswmsprovider.cpp
  109. +2 −2 src/providers/wms/qgswmsprovider.h
  110. +1 −1 src/providers/wms/qgswmssourceselect.cpp
  111. +1 −1 src/providers/wms/qgswmssourceselect.h
  112. +6 −6 src/python/qgspythonutils.h
  113. +6 −6 src/python/qgspythonutilsimpl.cpp
  114. +6 −6 src/python/qgspythonutilsimpl.h
@@ -292,9 +292,9 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
static void registerOgrDrivers();

/** Converts absolute path to path relative to target */
static QString absolutePathToRelativePath( QString apath, QString targetPath );
static QString absolutePathToRelativePath( const QString& apath, const QString& targetPath );
/** Converts path relative to target to an absolute path */
static QString relativePathToAbsolutePath( QString rpath, QString targetPath );
static QString relativePathToAbsolutePath( const QString& rpath, const QString& targetPath );

/** Indicates whether running from build directory (not installed) */
static bool isRunningFromBuildDir();
@@ -95,7 +95,7 @@ class QgsDataItem : QObject
typedef QFlags<QgsDataItem::Capability> Capabilities;

// This will _write_ selected crs in data source
virtual bool setCrs( QgsCoordinateReferenceSystem crs );
virtual bool setCrs( const QgsCoordinateReferenceSystem& crs );

//! @deprecated since 2.8, returned type this will changed to Capabilities
virtual Capability capabilities() /Deprecated/;
@@ -82,7 +82,7 @@ class QgsDataProvider : QObject
* that can be used by the data provider to create a subset.
* Must be implemented in the dataprovider.
*/
virtual bool setSubsetString( QString subset, bool updateFeatureCount = true );
virtual bool setSubsetString( const QString& subset, bool updateFeatureCount = true );

/** Provider supports setting of subset strings */
virtual bool supportsSubsetString();
@@ -343,7 +343,7 @@ class QgsProjectBadLayerHandler
%End

public:
virtual void handleBadLayers( QList<QDomNode> layers, QDomDocument projectDom ) = 0;
virtual void handleBadLayers( const QList<QDomNode>& layers, const QDomDocument& projectDom ) = 0;
virtual ~QgsProjectBadLayerHandler();
};

@@ -356,6 +356,6 @@ class QgsProjectBadLayerDefaultHandler : QgsProjectBadLayerHandler
%End

public:
virtual void handleBadLayers( QList<QDomNode> layers, QDomDocument projectDom );
virtual void handleBadLayers( const QList<QDomNode>& layers, const QDomDocument& projectDom );

};
@@ -25,7 +25,7 @@ class QgsPythonRunner
QgsPythonRunner();
virtual ~QgsPythonRunner();

virtual bool runCommand( QString command, QString messageOnError = QString() ) = 0;
virtual bool runCommand( const QString& command, const QString& messageOnError = QString() ) = 0;

virtual bool evalCommand( QString command, QString& result ) = 0;
virtual bool evalCommand( const QString& command, QString& result ) = 0;
};
@@ -93,7 +93,7 @@ class QgsRenderChecker
* @param theRenderedImageFile to optionally override the output filename
* @note: make sure to call setExpectedImage and setRenderedImage first.
*/
bool compareImages( const QString& theTestName, unsigned int theMismatchCount = 0, QString theRenderedImageFile = "" );
bool compareImages( const QString& theTestName, unsigned int theMismatchCount = 0, const QString& theRenderedImageFile = "" );
/** Get a list of all the anomalies. An anomaly is a rendered difference
* file where there is some red pixel content (indicating a render check
* mismatch), but where the output was still acceptible. If the render
@@ -159,7 +159,7 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
* ACTUALLY exists you need to look at the existsFlag member in each struct stored in the
* list.
*/
virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() );
virtual QList<QgsRasterPyramid> buildPyramidList( const QList<int>& overviewList = QList<int>() );

/** \brief Returns true if raster has at least one populated histogram. */
bool hasPyramids();
@@ -261,7 +261,7 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
/** Validates creation options for a specific dataset and destination format.
* @note used by GDAL provider only
* @note see also validateCreationOptionsFormat() in gdal provider for validating options based on format only */
virtual QString validateCreationOptions( const QStringList& createOptions, QString format );
virtual QString validateCreationOptions( const QStringList& createOptions, const QString& format );

/** Validates pyramid creation options for a specific dataset and destination format
* @note used by GDAL provider only */
@@ -49,16 +49,16 @@ class QgisInterface : QObject
virtual void zoomToActiveLayer() = 0;

//! Add a vector layer
virtual QgsVectorLayer* addVectorLayer( QString vectorLayerPath, QString baseName, QString providerKey ) = 0;
virtual QgsVectorLayer* addVectorLayer( const QString& vectorLayerPath, const QString& baseName, const QString& providerKey ) = 0;

//! Add a raster layer given a raster layer file name
virtual QgsRasterLayer* addRasterLayer( QString rasterLayerPath, QString baseName = QString() ) = 0;
virtual QgsRasterLayer* addRasterLayer( const QString& rasterLayerPath, const QString& baseName = QString() ) = 0;

//! Add a WMS layer
virtual QgsRasterLayer* addRasterLayer( const QString& url, const QString& layerName, const QString& providerKey ) = 0;

//! Add a project
virtual bool addProject( QString theProject ) = 0;
virtual bool addProject( const QString& theProject ) = 0;
//! Start a blank project
virtual void newProject( bool thePromptToSaveFlag = false ) = 0;

@@ -150,7 +150,7 @@ class QgisInterface : QObject
virtual void removeWebToolBarIcon( QAction *qAction ) = 0;

//! Add toolbar with specified name
virtual QToolBar *addToolBar( QString name ) = 0 /Factory/;
virtual QToolBar *addToolBar( const QString& name ) = 0 /Factory/;

//! Add a toolbar
//! @note added in 2.3
@@ -181,15 +181,15 @@ class QgisInterface : QObject
* @return pointer to composer's view
* @note new composer window will be shown and activated
*/
virtual QgsComposerView* createNewComposer( QString title = QString() ) = 0;
virtual QgsComposerView* createNewComposer( const QString& title = QString() ) = 0;

/** Duplicate an existing parent composer from composer view
* @param composerView pointer to existing composer view
* @param title window title for duplicated composer (one will be generated if empty)
* @return pointer to duplicate composer's view
* @note dupicate composer window will be hidden until loaded, then shown and activated
*/
virtual QgsComposerView* duplicateComposer( QgsComposerView* composerView, QString title = QString() ) = 0;
virtual QgsComposerView* duplicateComposer( QgsComposerView* composerView, const QString& title = QString() ) = 0;

/** Deletes parent composer of composer view, after closing composer window */
virtual void deleteComposer( QgsComposerView* composerView ) = 0;
@@ -209,10 +209,10 @@ class QgisInterface : QObject
virtual QFont defaultStyleSheetFont() = 0;

/** Add action to the plugins menu */
virtual void addPluginToMenu( QString name, QAction* action ) = 0;
virtual void addPluginToMenu( const QString& name, QAction* action ) = 0;

/** Remove action from the plugins menu */
virtual void removePluginMenu( QString name, QAction* action ) = 0;
virtual void removePluginMenu( const QString& name, QAction* action ) = 0;

/** Add "add layer" action to layer menu */
virtual void insertAddLayerAction( QAction *action ) = 0;
@@ -221,28 +221,28 @@ class QgisInterface : QObject
virtual void removeAddLayerAction( QAction *action ) = 0;

/** Add action to the Database menu */
virtual void addPluginToDatabaseMenu( QString name, QAction* action ) = 0;
virtual void addPluginToDatabaseMenu( const QString& name, QAction* action ) = 0;

/** Remove action from the Database menu */
virtual void removePluginDatabaseMenu( QString name, QAction* action ) = 0;
virtual void removePluginDatabaseMenu( const QString& name, QAction* action ) = 0;

/** Add action to the Raster menu */
virtual void addPluginToRasterMenu( QString name, QAction* action ) = 0;
virtual void addPluginToRasterMenu( const QString& name, QAction* action ) = 0;

/** Remove action from the Raster menu */
virtual void removePluginRasterMenu( QString name, QAction* action ) = 0;
virtual void removePluginRasterMenu( const QString& name, QAction* action ) = 0;

/** Add action to the Vector menu */
virtual void addPluginToVectorMenu( QString name, QAction* action ) = 0;
virtual void addPluginToVectorMenu( const QString& name, QAction* action ) = 0;

/** Remove action from the Vector menu */
virtual void removePluginVectorMenu( QString name, QAction* action ) = 0;
virtual void removePluginVectorMenu( const QString& name, QAction* action ) = 0;

/** Add action to the Web menu */
virtual void addPluginToWebMenu( QString name, QAction* action ) = 0;
virtual void addPluginToWebMenu( const QString& name, QAction* action ) = 0;

/** Remove action from the Web menu */
virtual void removePluginWebMenu( QString name, QAction* action ) = 0;
virtual void removePluginWebMenu( const QString& name, QAction* action ) = 0;

/** Add a dock widget to the main window */
virtual void addDockWidget( Qt::DockWidgetArea area, QDockWidget * dockwidget ) = 0;
@@ -270,7 +270,7 @@ class QgisInterface : QObject
virtual void removeWindow( QAction *action ) = 0;

/** Register action to the shortcuts manager so its shortcut can be changed in GUI */
virtual bool registerMainWindowAction( QAction* action, QString defaultShortcut ) = 0;
virtual bool registerMainWindowAction( QAction* action, const QString& defaultShortcut ) = 0;

/** Unregister a previously registered action. (e.g. when plugin is going to be unloaded) */
virtual bool unregisterMainWindowAction( QAction* action ) = 0;
@@ -284,7 +284,7 @@ class QgisInterface : QObject
* url to the QGIS documentation directory path (prefix/share/doc)
* @deprecated
*/
virtual void openURL( QString url, bool useQgisDocDirectory = true ) = 0 /Deprecated/;
virtual void openURL( const QString& url, bool useQgisDocDirectory = true ) = 0 /Deprecated/;

/** Accessors for inserting items into menus and toolbars.
* An item can be inserted before any existing action.
@@ -488,7 +488,7 @@ class QgisInterface : QObject
*
* More information here: http://qt-project.org/forums/viewthread/27098/
*/
virtual void preloadForm( QString uifile ) = 0;
virtual void preloadForm( const QString& uifile ) = 0;

/** Return vector layers in edit mode
* @param modified whether to return only layers that have been modified
@@ -14,7 +14,7 @@ class QgsProjectBadLayerGuiHandler : QObject, QgsProjectBadLayerHandler
QgsProjectBadLayerGuiHandler();

/** Implementation of the handler */
virtual void handleBadLayers( QList<QDomNode> layers, QDomDocument projectDom );
virtual void handleBadLayers( const QList<QDomNode>& layers, const QDomDocument& projectDom );

/** Flag to store the Ignore button press of MessageBox used by QgsLegend */
static bool mIgnore;
@@ -7876,7 +7876,7 @@ class QgsPythonRunnerImpl : public QgsPythonRunner
public:
explicit QgsPythonRunnerImpl( QgsPythonUtils* pythonUtils ) : mPythonUtils( pythonUtils ) {}

virtual bool runCommand( QString command, QString messageOnError = QString() ) override
virtual bool runCommand( const QString& command, const QString& messageOnError = QString() ) override
{
if ( mPythonUtils && mPythonUtils->isEnabled() )
{
@@ -7885,7 +7885,7 @@ class QgsPythonRunnerImpl : public QgsPythonRunner
return false;
}

virtual bool evalCommand( QString command, QString &result ) override
virtual bool evalCommand( const QString& command, QString &result ) override
{
if ( mPythonUtils && mPythonUtils->isEnabled() )
{

0 comments on commit 70bff3f

Please sign in to comment.