Skip to content

Commit

Permalink
Don't return QStrings by reference, since they're implicitly shared
Browse files Browse the repository at this point in the history
anyway
  • Loading branch information
nyalldawson committed Oct 27, 2015
1 parent f0930ca commit fe221d5
Show file tree
Hide file tree
Showing 29 changed files with 79 additions and 79 deletions.
2 changes: 1 addition & 1 deletion python/core/composer/qgsatlascomposition.sip
Expand Up @@ -177,7 +177,7 @@ public:
bool prepareForFeature( const QgsFeature * feat );

/** Returns the current filename. Must be called after prepareForFeature() */
const QString& currentFilename() const;
QString currentFilename() const;

void writeXML( QDomElement& elem, QDomDocument& doc ) const;

Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsdistancearea.sip
Expand Up @@ -46,7 +46,7 @@ class QgsDistanceArea
bool setEllipsoid( double semiMajor, double semiMinor );

//! returns ellipsoid's acronym
const QString& ellipsoid() const;
QString ellipsoid() const;

//! returns ellipsoid's semi major axis
double ellipsoidSemiMajor() const;
Expand Down
6 changes: 3 additions & 3 deletions python/core/qgsfield.sip
Expand Up @@ -44,7 +44,7 @@ class QgsField
bool operator!=( const QgsField& other ) const;

//! Gets the name of the field
const QString& name() const;
QString name() const;

//! Gets variant type of the field as it will be retrieved from data source
QVariant::Type type() const;
Expand All @@ -55,7 +55,7 @@ class QgsField
the data store reports it, with no attempt to standardize the value.
@return QString containing the field type
*/
const QString& typeName() const;
QString typeName() const;

/**
Gets the length of the field.
Expand All @@ -72,7 +72,7 @@ class QgsField
/**
Returns the field comment
*/
const QString& comment() const;
QString comment() const;

/**
Set the field name.
Expand Down
30 changes: 15 additions & 15 deletions python/core/qgsmaplayer.sip
Expand Up @@ -69,39 +69,39 @@ class QgsMapLayer : QObject
/** Get the display name of the layer
* @return the layer name
*/
const QString & name() const;
QString name() const;

/** Get the original name of the layer */
const QString & originalName() const;
QString originalName() const;

void setTitle( const QString& title );
const QString& title() const;
QString title() const;

void setAbstract( const QString& abstract );
const QString& abstract() const;
QString abstract() const;

void setKeywordList( const QString& keywords );
const QString& keywordList() const;
QString keywordList() const;

/* Layer dataUrl information */
void setDataUrl( const QString& dataUrl );
const QString& dataUrl() const;
QString dataUrl() const;
void setDataUrlFormat( const QString& dataUrlFormat );
const QString& dataUrlFormat() const;
QString dataUrlFormat() const;

/* Layer attribution information */
void setAttribution( const QString& attrib );
const QString& attribution() const;
QString attribution() const;
void setAttributionUrl( const QString& attribUrl );
const QString& attributionUrl() const;
QString attributionUrl() const;

/* Layer metadataUrl information */
void setMetadataUrl( const QString& metaUrl );
const QString& metadataUrl() const;
QString metadataUrl() const;
void setMetadataUrlType( const QString& metaUrlType );
const QString& metadataUrlType() const;
QString metadataUrlType() const;
void setMetadataUrlFormat( const QString& metaUrlFormat );
const QString& metadataUrlFormat() const;
QString metadataUrlFormat() const;

/** Set the blending mode used for rendering a layer */
void setBlendMode( const QPainter::CompositionMode &blendMode );
Expand Down Expand Up @@ -146,7 +146,7 @@ class QgsMapLayer : QObject
QString publicSource() const;

/** Returns the source for the layer */
const QString &source() const;
QString source() const;

/**
* Returns the sublayers of this layer
Expand Down Expand Up @@ -356,9 +356,9 @@ class QgsMapLayer : QObject

/* Layer legendUrl information */
void setLegendUrl( const QString& legendUrl );
const QString& legendUrl() const;
QString legendUrl() const;
void setLegendUrlFormat( const QString& legendUrlFormat );
const QString& legendUrlFormat() const;
QString legendUrlFormat() const;

/** @deprecated since 2.4 - returns NULL */
QImage *cacheImage() /Deprecated/;
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsmultirenderchecker.sip
Expand Up @@ -79,13 +79,13 @@ class QgsMultiRenderChecker
*
* @return A report
*/
const QString& report() const;
QString report() const;

/**
* @brief controlImagePath
* @return
*/
const QString controlImagePath() const;
QString controlImagePath() const;

/** Draws a checkboard pattern for image backgrounds, so that transparency is visible
* without requiring a transparent background for the image
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgspallabeling.sip
Expand Up @@ -608,7 +608,7 @@ class QgsLabelComponent

// methods

const QString& text() const;
QString text() const;
void setText( const QString& text );

const QgsPoint& origin() const;
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsproject.sip
Expand Up @@ -46,7 +46,7 @@ class QgsProject : QObject
void setTitle( const QString& title );

/** Returns title */
const QString & title() const;
QString title() const;
//@}

/**
Expand Down
6 changes: 3 additions & 3 deletions python/core/qgsprovidermetadata.sip
Expand Up @@ -25,19 +25,19 @@ class QgsProviderMetadata

This key string is used for the associative container in QgsProviderRegistry
*/
const QString & key() const;
QString key() const;

/** This returns descriptive text for the provider

This is used to provide a descriptive list of available data providers.
*/
const QString & description() const;
QString description() const;

/** This returns the library file name

This is used to QLibrary calls to load the data provider.
*/
const QString & library() const;
QString library() const;


}; // class QgsProviderMetadata
4 changes: 2 additions & 2 deletions python/core/qgsrenderchecker.sip
Expand Up @@ -47,7 +47,7 @@ class QgsRenderChecker
*
* @return The path to the rendered image
*/
const QString& renderedImage();
QString renderedImage();

//! @deprecated since 2.4 - use setMapSettings()
void setMapRenderer( QgsMapRenderer * thepMapRenderer ) /Deprecated/;
Expand Down Expand Up @@ -113,7 +113,7 @@ class QgsRenderChecker
*
* @return Path to the expected image file
*/
const QString& expectedImageFile() const;
QString expectedImageFile() const;

/**
* Call this to enable internal buffering of dash messages. You may later call
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsfiledropedit.sip
Expand Up @@ -17,7 +17,7 @@ class QgsFileDropEdit: QLineEdit
bool isFileOnly() const;
void setFileOnly( bool isFileOnly );

const QString& suffixFilter() const;
QString suffixFilter() const;
void setSuffixFilter( const QString& suffix );

protected:
Expand Down
6 changes: 3 additions & 3 deletions src/core/auth/qgsauthmethodmetadata.cpp
Expand Up @@ -26,17 +26,17 @@ QgsAuthMethodMetadata::QgsAuthMethodMetadata( QString const & _key,
, library_( _library )
{}

QString const & QgsAuthMethodMetadata::key() const
QString QgsAuthMethodMetadata::key() const
{
return key_;
}

QString const & QgsAuthMethodMetadata::description() const
QString QgsAuthMethodMetadata::description() const
{
return description_;
}

QString const & QgsAuthMethodMetadata::library() const
QString QgsAuthMethodMetadata::library() const
{
return library_;
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/auth/qgsauthmethodmetadata.h
Expand Up @@ -46,19 +46,19 @@ class CORE_EXPORT QgsAuthMethodMetadata
This key string is used for the associative container in QgsAtuhMethodRegistry
*/
const QString & key() const;
QString key() const;

/** This returns descriptive text for the method
This is used to provide a descriptive list of available data methods.
*/
const QString & description() const;
QString description() const;

/** This returns the library file name
This is used to QLibrary calls to load the method.
*/
const QString & library() const;
QString library() const;

private:

Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgsatlascomposition.cpp
Expand Up @@ -644,7 +644,7 @@ void QgsAtlasComposition::prepareMap( QgsComposerMap* map )
map->setNewAtlasFeatureExtent( newExtent );
}

const QString& QgsAtlasComposition::currentFilename() const
QString QgsAtlasComposition::currentFilename() const
{
return mCurrentFilename;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgsatlascomposition.h
Expand Up @@ -207,7 +207,7 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
bool prepareForFeature( const QgsFeature *feat );

/** Returns the current filename. Must be called after prepareForFeature() */
const QString& currentFilename() const;
QString currentFilename() const;

void writeXML( QDomElement& elem, QDomDocument& doc ) const;

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdistancearea.h
Expand Up @@ -79,7 +79,7 @@ class CORE_EXPORT QgsDistanceArea
bool setEllipsoid( double semiMajor, double semiMinor );

//! returns ellipsoid's acronym
const QString& ellipsoid() const { return mEllipsoid; }
QString ellipsoid() const { return mEllipsoid; }

//! returns ellipsoid's semi major axis
double ellipsoidSemiMajor() const { return mSemiMajor; }
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsfield.cpp
Expand Up @@ -69,7 +69,7 @@ bool QgsField::operator!=( const QgsField& other ) const
return !( *this == other );
}

const QString & QgsField::name() const
QString QgsField::name() const
{
return d->name;
}
Expand All @@ -79,7 +79,7 @@ QVariant::Type QgsField::type() const
return d->type;
}

const QString & QgsField::typeName() const
QString QgsField::typeName() const
{
return d->typeName;
}
Expand All @@ -94,7 +94,7 @@ int QgsField::precision() const
return d->precision;
}

const QString & QgsField::comment() const
QString QgsField::comment() const
{
return d->comment;
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsfield.h
Expand Up @@ -74,7 +74,7 @@ class CORE_EXPORT QgsField
bool operator!=( const QgsField& other ) const;

//! Gets the name of the field
const QString& name() const;
QString name() const;

//! Gets variant type of the field as it will be retrieved from data source
QVariant::Type type() const;
Expand All @@ -85,7 +85,7 @@ class CORE_EXPORT QgsField
the data store reports it, with no attempt to standardize the value.
@return QString containing the field type
*/
const QString& typeName() const;
QString typeName() const;

/**
Gets the length of the field.
Expand All @@ -102,7 +102,7 @@ class CORE_EXPORT QgsField
/**
Returns the field comment
*/
const QString& comment() const;
QString comment() const;

/**
Set the field name.
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -115,7 +115,7 @@ void QgsMapLayer::setLayerName( const QString & name )
}

/** Read property of QString layerName. */
QString const & QgsMapLayer::name() const
QString QgsMapLayer::name() const
{
QgsDebugMsgLevel( "returning name '" + mLayerName + "'", 4 );
return mLayerName;
Expand All @@ -129,7 +129,7 @@ QString QgsMapLayer::publicSource() const
return safeName;
}

QString const & QgsMapLayer::source() const
QString QgsMapLayer::source() const
{
return mDataSource;
}
Expand Down

0 comments on commit fe221d5

Please sign in to comment.