Skip to content
Permalink
Browse files

Change some by value arguments to by reference

  • Loading branch information
nyalldawson committed Nov 15, 2015
1 parent e6d495a commit 526b8fc63553698ecc85e4010eb8f37bd875a08d
Showing with 87 additions and 88 deletions.
  1. +6 −6 python/gui/symbology-ng/qgsstylev2exportimportdialog.sip
  2. +4 −4 python/gui/symbology-ng/qgsstylev2groupselectiondialog.sip
  3. +2 −2 python/server/qgscapabilitiescache.sip
  4. +1 −1 python/server/qgsserverinterface.sip
  5. +4 −4 python/server/qgswfserver.sip
  6. +1 −1 python/server/qgswmserver.sip
  7. +1 −1 python/server/qgswmsprojectparser.sip
  8. +3 −3 src/app/composer/qgscomposermanager.cpp
  9. +2 −2 src/app/composer/qgscomposermanager.h
  10. +1 −1 src/app/qgsstatusbarcoordinateswidget.cpp
  11. +1 −1 src/app/qgsstatusbarcoordinateswidget.h
  12. +6 −6 src/gui/symbology-ng/qgsstylev2exportimportdialog.cpp
  13. +6 −6 src/gui/symbology-ng/qgsstylev2exportimportdialog.h
  14. +5 −5 src/gui/symbology-ng/qgsstylev2groupselectiondialog.h
  15. +1 −1 src/plugins/evis/databaseconnection/evisdatabaselayerfieldselectiongui.h
  16. +2 −2 src/server/qgscapabilitiescache.cpp
  17. +2 −2 src/server/qgscapabilitiescache.h
  18. +1 −1 src/server/qgsmsutils.cpp
  19. +1 −1 src/server/qgsmsutils.h
  20. +1 −1 src/server/qgsserver.cpp
  21. +1 −1 src/server/qgsserver.h
  22. +1 −1 src/server/qgsserverinterface.h
  23. +1 −1 src/server/qgsserverinterfaceimpl.cpp
  24. +1 −1 src/server/qgsserverinterfaceimpl.h
  25. +1 −1 src/server/qgsserverlogger.cpp
  26. +1 −1 src/server/qgsserverlogger.h
  27. +5 −5 src/server/qgswfsserver.cpp
  28. +5 −5 src/server/qgswfsserver.h
  29. +1 −1 src/server/qgswmsprojectparser.cpp
  30. +1 −1 src/server/qgswmsprojectparser.h
  31. +6 −6 src/server/qgswmsserver.cpp
  32. +12 −13 src/server/qgswmsserver.h
@@ -19,12 +19,12 @@ class QgsStyleV2ExportImportDialog : QDialog
* @brief selectSymbols select symbols by name
* @param symbolNames list of symbol names
*/
void selectSymbols(const QStringList symbolNames);
void selectSymbols( const QStringList& symbolNames);
/**
* @brief deselectSymbols deselect symbols by name
* @param symbolNames list of symbol names
*/
void deselectSymbols(const QStringList symbolNames);
void deselectSymbols( const QStringList& symbolNames);

public slots:
void doExportImport();
@@ -44,22 +44,22 @@ class QgsStyleV2ExportImportDialog : QDialog
* Select the symbols belonging to the given group
* @param groupName the name of the group to be selected
*/
void selectGroup( const QString groupName );
void selectGroup( const QString& groupName );
/**
* Unselect the symbols belonging to the given group
* @param groupName the name of the group to be deselected
*/
void deselectGroup(const QString groupName);
void deselectGroup( const QString& groupName);
/**
* @brief selectSmartgroup selects all symbols from a smart group
* @param groupName
*/
void selectSmartgroup(const QString groupName);
void selectSmartgroup( const QString& groupName);
/**
* @brief deselectSmartgroup deselects all symbols from a smart group
* @param groupName
*/
void deselectSmartgroup(const QString groupName);
void deselectSmartgroup( const QString& groupName);

void importTypeChanged( int );
void browse();
@@ -29,13 +29,13 @@ class QgsStyleV2GroupSelectionDialog : public QDialog, private Ui::SymbolsV2Grou

signals:
//! group with groupName has been selected
void groupSelected( const QString groupName );
void groupSelected( const QString& groupName );
//! group with groupName has been deselected
void groupDeselected( const QString groupName );
void groupDeselected( const QString& groupName );
//! smartgroup with groupName has been selected
void smartgroupSelected( const QString groupName);
void smartgroupSelected( const QString& groupName);
//! smart group with groupName has been deselected
void smartgroupDeselected( const QString groupName );
void smartgroupDeselected( const QString& groupName );
//! all deselected
void allDeselected( );
//! all selected
@@ -27,9 +27,9 @@ class QgsCapabilitiesCache: QObject
public:

/** Returns cached capabilities document (or 0 if document for configuration file not in cache)*/
const QDomDocument* searchCapabilitiesDocument( QString configFilePath, QString version );
const QDomDocument* searchCapabilitiesDocument( const QString& configFilePath, const QString& version );
/** Inserts new capabilities document (creates a copy of the document, does not take ownership)*/
void insertCapabilitiesDocument( QString configFilePath, QString version, const QDomDocument* doc );
void insertCapabilitiesDocument( const QString& configFilePath, const QString& version, const QDomDocument* doc );

};

@@ -59,7 +59,7 @@ class QgsServerInterface
* available after requestReady has been called.*/
virtual QString configFilePath( ) = 0;
/** Set the config file path */
virtual void setConfigFilePath( QString configFilePath) = 0;
virtual void setConfigFilePath( const QString& configFilePath) = 0;

private:
/** Constructor */
@@ -104,17 +104,17 @@ class QgsWFSServer: public QgsOWSServer
protected:

void startGetFeature( QgsRequestHandler& request, const QString& format, int prec, QgsCoordinateReferenceSystem& crs, QgsRectangle* rect );
void setGetFeature( QgsRequestHandler& request, const QString& format, QgsFeature* feat, int featIdx, int prec, QgsCoordinateReferenceSystem& crs, QgsAttributeList attrIndexes, QSet<QString> excludedAttributes );
void setGetFeature( QgsRequestHandler& request, const QString& format, QgsFeature* feat, int featIdx, int prec, QgsCoordinateReferenceSystem& crs, const QgsAttributeList& attrIndexes, const QSet<QString>& excludedAttributes );
void endGetFeature( QgsRequestHandler& request, const QString& format );

//method for transaction
QgsFeatureIds getFeatureIdsFromFilter( QDomElement filter, QgsVectorLayer* layer );
QgsFeatureIds getFeatureIdsFromFilter( const QDomElement& filter, QgsVectorLayer* layer );

//methods to write GeoJSON
QString createFeatureGeoJSON( QgsFeature* feat, int prec, QgsCoordinateReferenceSystem& crs, QgsAttributeList attrIndexes, QSet<QString> excludedAttributes ) /*const*/;
QString createFeatureGeoJSON( QgsFeature* feat, int prec, QgsCoordinateReferenceSystem& crs, const QgsAttributeList& attrIndexes, const QSet<QString>& excludedAttributes ) /*const*/;

//methods to write GML2
QDomElement createFeatureGML2( QgsFeature* feat, QDomDocument& doc, int prec, QgsCoordinateReferenceSystem& crs, QgsAttributeList attrIndexes, QSet<QString> excludedAttributes ) /*const*/;
QDomElement createFeatureGML2( QgsFeature* feat, QDomDocument& doc, int prec, QgsCoordinateReferenceSystem& crs, const QgsAttributeList& attrIndexes, const QSet<QString>& excludedAttributes ) /*const*/;

//methods to write GML3
QDomElement createFeatureGML3( QgsFeature* feat, QDomDocument& doc, int prec, QgsCoordinateReferenceSystem& crs, QgsAttributeList attrIndexes, QSet<QString> excludedAttributes ) /*const*/;
@@ -95,7 +95,7 @@ class QgsWMSServer: public QgsOWSServer

/** Creates an xml document that describes the result of the getFeatureInfo request.
@return 0 in case of success*/
int getFeatureInfo( QDomDocument& result, QString version = "1.3.0" );
int getFeatureInfo( QDomDocument& result, const QString& version = "1.3.0" );

/** Sets configuration parser for administration settings. Does not take ownership*/
void setAdminConfigParser( QgsWMSConfigParser* parser ) { mConfigParser = parser; }
@@ -131,7 +131,7 @@ class QgsWMSProjectParser : public QgsWMSConfigParser

void addOWSLayers( QDomDocument &doc, QDomElement &parentElem, const QDomElement &legendElem,
const QMap<QString, QgsMapLayer *> &layerMap, const QStringList &nonIdentifiableLayers,
const QString& strHref, QgsRectangle& combinedBBox, QString strGroup ) const;
const QString& strHref, QgsRectangle& combinedBBox, const QString& strGroup ) const;

/** Adds layers from a legend group to list (could be embedded or a normal group)*/
//void addLayersFromGroup( const QDomElement& legendGroupElem, QMap< int, QgsMapLayer*>& layers, bool useCache = true ) const;
@@ -120,7 +120,7 @@ void QgsComposerManager::refreshComposers()
}
}

void QgsComposerManager::addTemplates( QMap<QString, QString> templates )
void QgsComposerManager::addTemplates( const QMap<QString, QString>& templates )
{
if ( templates.size() > 0 )
{
@@ -152,7 +152,7 @@ QMap<QString, QString> QgsComposerManager::otherTemplates() const
{
QMap<QString, QString> templateMap;
QStringList paths = QgsApplication::composerTemplatePaths();
Q_FOREACH ( QString path, paths )
Q_FOREACH ( const QString& path, paths )
{
QMap<QString, QString> templates = templatesFromPath( path );
QMap<QString, QString>::const_iterator templateIt = templates.constBegin();
@@ -165,7 +165,7 @@ QMap<QString, QString> QgsComposerManager::otherTemplates() const
}


QMap<QString, QString> QgsComposerManager::templatesFromPath( QString path ) const
QMap<QString, QString> QgsComposerManager::templatesFromPath( const QString& path ) const
{
QMap<QString, QString> templateMap;

@@ -52,7 +52,7 @@ class QgsComposerManager: public QDialog, private Ui::QgsComposerManagerBase
QgsComposerManager( QWidget * parent = 0, Qt::WindowFlags f = 0 );
~QgsComposerManager();

void addTemplates( QMap<QString, QString> templates );
void addTemplates( const QMap<QString, QString>& templates );

public slots:
/** Raise, unminimize and activate this window */
@@ -69,7 +69,7 @@ class QgsComposerManager: public QDialog, private Ui::QgsComposerManagerBase
QMap<QString, QString> defaultTemplates( bool fromUser = false ) const;
QMap<QString, QString> otherTemplates() const;

QMap<QString, QString> templatesFromPath( QString path ) const;
QMap<QString, QString> templatesFromPath( const QString& path ) const;

/** Open local directory with user's system, creating it if not present
*/
@@ -98,7 +98,7 @@ void QgsStatusBarCoordinatesWidget::setMapCanvas( QgsMapCanvas *mapCanvas )
connect( mMapCanvas, SIGNAL( extentsChanged() ), this, SLOT( showExtent() ) );
}

void QgsStatusBarCoordinatesWidget::setFont( QFont myFont )
void QgsStatusBarCoordinatesWidget::setFont( const QFont& myFont )
{
mLineEdit->setFont( myFont );
mLabel->setFont( myFont );
@@ -45,7 +45,7 @@ class APP_EXPORT QgsStatusBarCoordinatesWidget : public QWidget
//! define the map canvas associated to the widget
void setMapCanvas( QgsMapCanvas* mapCanvas );

void setFont( QFont myFont );
void setFont( const QFont& myFont );

void setMouseCoordinatesPrecision( unsigned int precision );

@@ -392,7 +392,7 @@ void QgsStyleV2ExportImportDialog::clearSelection()
listItems->clearSelection();
}

void QgsStyleV2ExportImportDialog::selectSymbols( const QStringList symbolNames )
void QgsStyleV2ExportImportDialog::selectSymbols( const QStringList& symbolNames )
{
Q_FOREACH ( const QString &symbolName, symbolNames )
{
@@ -404,7 +404,7 @@ void QgsStyleV2ExportImportDialog::selectSymbols( const QStringList symbolNames
}
}

void QgsStyleV2ExportImportDialog::deselectSymbols( const QStringList symbolNames )
void QgsStyleV2ExportImportDialog::deselectSymbols( const QStringList& symbolNames )
{
Q_FOREACH ( const QString &symbolName, symbolNames )
{
@@ -417,7 +417,7 @@ void QgsStyleV2ExportImportDialog::deselectSymbols( const QStringList symbolName
}
}

void QgsStyleV2ExportImportDialog::selectGroup( const QString groupName )
void QgsStyleV2ExportImportDialog::selectGroup( const QString& groupName )
{
QStringList symbolNames = mQgisStyle->symbolsOfGroup( QgsStyleV2::SymbolEntity, mQgisStyle->groupId( groupName ) );
selectSymbols( symbolNames );
@@ -426,23 +426,23 @@ void QgsStyleV2ExportImportDialog::selectGroup( const QString groupName )
}


void QgsStyleV2ExportImportDialog::deselectGroup( const QString groupName )
void QgsStyleV2ExportImportDialog::deselectGroup( const QString& groupName )
{
QStringList symbolNames = mQgisStyle->symbolsOfGroup( QgsStyleV2::SymbolEntity, mQgisStyle->groupId( groupName ) );
deselectSymbols( symbolNames );
symbolNames = mQgisStyle->symbolsOfGroup( QgsStyleV2::ColorrampEntity, mQgisStyle->groupId( groupName ) );
deselectSymbols( symbolNames );
}

void QgsStyleV2ExportImportDialog::selectSmartgroup( const QString groupName )
void QgsStyleV2ExportImportDialog::selectSmartgroup( const QString& groupName )
{
QStringList symbolNames = mQgisStyle->symbolsOfSmartgroup( QgsStyleV2::SymbolEntity, mQgisStyle->smartgroupId( groupName ) );
selectSymbols( symbolNames );
symbolNames = mQgisStyle->symbolsOfSmartgroup( QgsStyleV2::ColorrampEntity, mQgisStyle->smartgroupId( groupName ) );
selectSymbols( symbolNames );
}

void QgsStyleV2ExportImportDialog::deselectSmartgroup( const QString groupName )
void QgsStyleV2ExportImportDialog::deselectSmartgroup( const QString& groupName )
{
QStringList symbolNames = mQgisStyle->symbolsOfSmartgroup( QgsStyleV2::SymbolEntity, mQgisStyle->smartgroupId( groupName ) );
deselectSymbols( symbolNames );
@@ -50,12 +50,12 @@ class GUI_EXPORT QgsStyleV2ExportImportDialog : public QDialog, private Ui::QgsS
* @brief selectSymbols select symbols by name
* @param symbolNames list of symbol names
*/
void selectSymbols( const QStringList symbolNames );
void selectSymbols( const QStringList& symbolNames );
/**
* @brief deselectSymbols deselect symbols by name
* @param symbolNames list of symbol names
*/
void deselectSymbols( const QStringList symbolNames );
void deselectSymbols( const QStringList& symbolNames );

public slots:
void doExportImport();
@@ -75,22 +75,22 @@ class GUI_EXPORT QgsStyleV2ExportImportDialog : public QDialog, private Ui::QgsS
* Select the symbols belonging to the given group
* @param groupName the name of the group to be selected
*/
void selectGroup( const QString groupName );
void selectGroup( const QString& groupName );
/**
* Unselect the symbols belonging to the given group
* @param groupName the name of the group to be deselected
*/
void deselectGroup( const QString groupName );
void deselectGroup( const QString& groupName );
/**
* @brief selectSmartgroup selects all symbols from a smart group
* @param groupName
*/
void selectSmartgroup( const QString groupName );
void selectSmartgroup( const QString& groupName );
/**
* @brief deselectSmartgroup deselects all symbols from a smart group
* @param groupName
*/
void deselectSmartgroup( const QString groupName );
void deselectSmartgroup( const QString& groupName );

void importTypeChanged( int );
void browse();
@@ -36,20 +36,20 @@ class GUI_EXPORT QgsStyleV2GroupSelectionDialog : public QDialog, private Ui::Sy

signals:
//! group with groupName has been selected
void groupSelected( const QString groupName );
void groupSelected( const QString& groupName );
//! group with groupName has been deselected
void groupDeselected( const QString groupName );
void groupDeselected( const QString& groupName );
//! smartgroup with groupName has been selected
void smartgroupSelected( const QString groupName );
void smartgroupSelected( const QString& groupName );
//! smart group with groupName has been deselected
void smartgroupDeselected( const QString groupName );
void smartgroupDeselected( const QString& groupName );
//! all deselected
void allDeselected( );
//! all selected
void allSelected( );

private slots:
void groupTreeSelectionChanged( const QItemSelection&selected, const QItemSelection& deselected );
void groupTreeSelectionChanged( const QItemSelection& selected, const QItemSelection& deselected );

private:
/**
@@ -53,6 +53,6 @@ class eVisDatabaseLayerFieldSelectionGui : public QDialog, private Ui::eVisDatab

signals:
/** \brief Signal emitted when the user has entered the layername, selected the field names, and pressed the accept button */
void eVisDatabaseLayerFieldsSelected( QString, QString, QString );
void eVisDatabaseLayerFieldsSelected( const QString&, const QString&, const QString& );
};
#endif
@@ -28,7 +28,7 @@ QgsCapabilitiesCache::~QgsCapabilitiesCache()
{
}

const QDomDocument* QgsCapabilitiesCache::searchCapabilitiesDocument( QString configFilePath, QString version )
const QDomDocument* QgsCapabilitiesCache::searchCapabilitiesDocument( const QString& configFilePath, const QString& version )
{
QCoreApplication::processEvents(); //get updates from file system watcher

@@ -42,7 +42,7 @@ const QDomDocument* QgsCapabilitiesCache::searchCapabilitiesDocument( QString co
}
}

void QgsCapabilitiesCache::insertCapabilitiesDocument( QString configFilePath, QString version, const QDomDocument* doc )
void QgsCapabilitiesCache::insertCapabilitiesDocument( const QString& configFilePath, const QString& version, const QDomDocument* doc )
{
if ( mCachedCapabilities.size() > 40 )
{
@@ -32,9 +32,9 @@ class SERVER_EXPORT QgsCapabilitiesCache : public QObject
~QgsCapabilitiesCache();

/** Returns cached capabilities document (or 0 if document for configuration file not in cache)*/
const QDomDocument* searchCapabilitiesDocument( QString configFilePath, QString version );
const QDomDocument* searchCapabilitiesDocument( const QString& configFilePath, const QString& version );
/** Inserts new capabilities document (creates a copy of the document, does not take ownership)*/
void insertCapabilitiesDocument( QString configFilePath, QString version, const QDomDocument* doc );
void insertCapabilitiesDocument( const QString& configFilePath, const QString& version, const QDomDocument* doc );

private:
QHash< QString, QHash< QString, QDomDocument > > mCachedCapabilities;
@@ -67,7 +67,7 @@ QString QgsMSUtils::createTempFilePath()
return tempFilePath;
}

int QgsMSUtils::createTextFile( QString filePath, const QString& text )
int QgsMSUtils::createTextFile( const QString& filePath, const QString& text )
{
QFile file( filePath );
if ( file.open( QIODevice::WriteOnly | QIODevice::Text ) )
@@ -25,7 +25,7 @@ namespace QgsMSUtils
the current working directory on windows*/
QString createTempFilePath();
/** Stores the specified text in a temporary file. Returns 0 in case of success*/
int createTextFile( QString filePath, const QString& text );
int createTextFile( const QString& filePath, const QString& text );
}

#endif
@@ -422,7 +422,7 @@ bool QgsServer::init( int & argc, char ** argv )
* @param queryString
* @return response headers and body
*/
QPair<QByteArray, QByteArray> QgsServer::handleRequest( const QString queryString /*= QString( )*/ )
QPair<QByteArray, QByteArray> QgsServer::handleRequest( const QString& queryString /*= QString( )*/ )
{
// Run init if handleRequest was called without previously initialising
// the server
@@ -69,7 +69,7 @@ class SERVER_EXPORT QgsServer
* @param queryString optional QString containing the query string
* @return the response headers and body QPair of QByteArray if called from python bindings, empty otherwise
*/
QPair<QByteArray, QByteArray> handleRequest( const QString queryString = QString( ) );
QPair<QByteArray, QByteArray> handleRequest( const QString& queryString = QString( ) );
/* The following code was used to test type conversion in python bindings
QPair<QByteArray, QByteArray> testQPair( QPair<QByteArray, QByteArray> pair );
*/
@@ -99,7 +99,7 @@ class SERVER_EXPORT QgsServerInterface
* Set the configuration file path
* @param configFilePath QString with the configuration file path
*/
virtual void setConfigFilePath( QString configFilePath ) = 0;
virtual void setConfigFilePath( const QString& configFilePath ) = 0;

private:
QString mConfigFilePath;
@@ -49,7 +49,7 @@ void QgsServerInterfaceImpl::setRequestHandler( QgsRequestHandler * requestHandl
mRequestHandler = requestHandler;
}

void QgsServerInterfaceImpl::setConfigFilePath( QString configFilePath )
void QgsServerInterfaceImpl::setConfigFilePath( const QString& configFilePath )
{
mConfigFilePath = configFilePath;
}

0 comments on commit 526b8fc

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