Skip to content
Permalink
Browse files

Don't return QStrings by reference, since they're implicitly shared

anyway
  • Loading branch information
nyalldawson committed Oct 27, 2015
1 parent f0930ca commit fe221d54bf7c48edf63324900019e772f4eb311c
@@ -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;

@@ -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;
@@ -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;
@@ -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.
@@ -72,7 +72,7 @@ class QgsField
/**
Returns the field comment
*/
const QString& comment() const;
QString comment() const;

/**
Set the field name.
@@ -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 );
@@ -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
@@ -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/;
@@ -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
@@ -608,7 +608,7 @@ class QgsLabelComponent

// methods

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

const QgsPoint& origin() const;
@@ -46,7 +46,7 @@ class QgsProject : QObject
void setTitle( const QString& title );

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

/**
@@ -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
@@ -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/;
@@ -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
@@ -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:
@@ -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_;
}
@@ -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:

@@ -644,7 +644,7 @@ void QgsAtlasComposition::prepareMap( QgsComposerMap* map )
map->setNewAtlasFeatureExtent( newExtent );
}

const QString& QgsAtlasComposition::currentFilename() const
QString QgsAtlasComposition::currentFilename() const
{
return mCurrentFilename;
}
@@ -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;

@@ -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; }
@@ -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;
}
@@ -79,7 +79,7 @@ QVariant::Type QgsField::type() const
return d->type;
}

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

const QString & QgsField::comment() const
QString QgsField::comment() const
{
return d->comment;
}
@@ -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;
@@ -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.
@@ -102,7 +102,7 @@ class CORE_EXPORT QgsField
/**
Returns the field comment
*/
const QString& comment() const;
QString comment() const;

/**
Set the field name.
@@ -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;
@@ -129,7 +129,7 @@ QString QgsMapLayer::publicSource() const
return safeName;
}

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

0 comments on commit fe221d5

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