More const ref with method arguments

parent 6a2af954
......@@ -776,7 +776,7 @@ QString ControlView::externalMapEditor() const
return m_externalEditor;
}
void ControlView::addGeoDataFile( QString filename )
void ControlView::addGeoDataFile( const QString &filename )
{
QFileInfo const file( filename );
if ( file.exists() ) {
......
......@@ -69,7 +69,7 @@ class ControlView : public QWidget
void moveUp();
void moveDown();
void addGeoDataFile( QString filename );
void addGeoDataFile( const QString &filename );
QPixmap mapScreenShot() { return m_marbleWidget->mapScreenShot(); }
......
......@@ -49,7 +49,7 @@ Q_SIGNALS:
void updateAvailable();
private:
Q_PRIVATE_SLOT( d, void tileCompleted( TileId, QImage ) )
Q_PRIVATE_SLOT( d, void tileCompleted( const TileId&, const QImage& ) )
private:
friend class ElevationModelPrivate;
......
......@@ -46,7 +46,7 @@ GeoPainterPrivate::~GeoPainterPrivate()
}
void GeoPainterPrivate::createAnnotationLayout ( qreal x, qreal y,
QSizeF bubbleSize,
const QSizeF& bubbleSize,
qreal bubbleOffsetX, qreal bubbleOffsetY,
qreal xRnd, qreal yRnd,
QPainterPath& path, QRectF& rect )
......
......@@ -37,7 +37,7 @@ class GeoPainterPrivate
static void createAnnotationLayout ( qreal x, qreal y,
QSizeF bubbleSize,
const QSizeF& bubbleSize,
qreal bubbleOffsetX, qreal bubbleOffsetY,
qreal xRnd, qreal yRnd,
QPainterPath& path, QRectF& rect );
......
......@@ -95,7 +95,7 @@ public:
void startSearch();
void updateSearchResult( QVector<GeoDataPlacemark*> placemarks );
void updateSearchResult( const QVector<GeoDataPlacemark*>& placemarks );
void updateSearchMode();
......@@ -335,7 +335,7 @@ void GoToDialogPrivate::startSearch()
updateResultMessage( 0 );
}
void GoToDialogPrivate::updateSearchResult( QVector<GeoDataPlacemark*> placemarks )
void GoToDialogPrivate::updateSearchResult( const QVector<GeoDataPlacemark*>& placemarks )
{
m_searchResultModel.setRootDocument( 0 );
m_searchResult->clear();
......
......@@ -55,7 +55,7 @@ public:
Q_PRIVATE_SLOT( d, void startSearch() )
Q_PRIVATE_SLOT( d, void updateSearchResult( QVector<GeoDataPlacemark*> placemarks ) )
Q_PRIVATE_SLOT( d, void updateSearchResult( const QVector<GeoDataPlacemark*>& placemarks ) )
Q_PRIVATE_SLOT( d, void updateSearchMode() )
......
......@@ -101,14 +101,14 @@ class PreviewDialog : public QDialog
{
Q_OBJECT
public:
PreviewDialog( QWidget* parent, QString mapThemeId );
PreviewDialog( QWidget* parent, const QString& mapThemeId );
virtual void closeEvent(QCloseEvent* e );
private:
bool deleteTheme( QString directory );
bool deleteTheme( const QString& directory );
QString m_mapThemeId;
};
PreviewDialog::PreviewDialog( QWidget* parent, QString mapThemeId ) : QDialog( parent ), m_mapThemeId( mapThemeId )
PreviewDialog::PreviewDialog( QWidget* parent, const QString& mapThemeId ) : QDialog( parent ), m_mapThemeId( mapThemeId )
{
QGridLayout *layout = new QGridLayout();
MarbleWidget *widget = new MarbleWidget();
......@@ -144,7 +144,7 @@ void PreviewDialog::closeEvent(QCloseEvent* e)
QDialog::closeEvent( e );
}
bool PreviewDialog::deleteTheme( QString directory )
bool PreviewDialog::deleteTheme( const QString &directory )
{
QDir dir(directory);
bool result = true;
......@@ -557,7 +557,7 @@ void MapWizard::queryLegendImage()
d->uiWidget.textBrowserLegend->setHtml( legendHtml );
}
QString MapWizard::createArchive( QWidget *parent, QString mapId )
QString MapWizard::createArchive( QWidget *parent, const QString& mapId )
{
QStringList splitMapId( mapId.split(QLatin1Char('/')) );
QString body = splitMapId[0];
......@@ -634,7 +634,7 @@ QString MapWizard::createArchive( QWidget *parent, QString mapId )
return QString( "%1/%2.tar.gz" ).arg( QDir::tempPath() ).arg( theme );
}
void MapWizard::deleteArchive( QString mapId )
void MapWizard::deleteArchive( const QString& mapId )
{
QStringList splitMapId( mapId.split(QLatin1Char('/')) );
QString theme = splitMapId[1];
......
......@@ -44,8 +44,8 @@ public:
QStringList staticUrlServers() const;
void setStaticUrlServers( const QStringList& uris );
static QString createArchive( QWidget *parent, QString mapId );
static void deleteArchive( QString mapId );
static QString createArchive( QWidget *parent, const QString& mapId );
static void deleteArchive( const QString& mapId );
// QWizard's functions
virtual void accept();
......
......@@ -336,7 +336,7 @@ bool MarbleDefaultInputHandler::handleWheel(QWheelEvent *wheelevt)
return true;
}
bool MarbleDefaultInputHandler::handlePinch(QPointF center, qreal scaleFactor, Qt::GestureState state)
bool MarbleDefaultInputHandler::handlePinch(const QPointF &center, qreal scaleFactor, Qt::GestureState state)
{
qreal destLat;
qreal destLon;
......
......@@ -130,7 +130,7 @@ class MARBLE_EXPORT MarbleDefaultInputHandler : public MarbleInputHandler
protected:
bool eventFilter( QObject *, QEvent * );
bool handleMouseEvent(QMouseEvent *e);
bool handlePinch(QPointF center, qreal scaleFactor, Qt::GestureState state);
bool handlePinch(const QPointF &center, qreal scaleFactor, Qt::GestureState state);
//FIXME - refactor (abstraction & composition)
QPointer<AbstractDataPluginItem> lastToolTipItem();
......
......@@ -27,7 +27,7 @@ class MovieCapturePrivate;
class MovieFormat
{
public:
explicit MovieFormat( QString type, QString name, QString extension) :
explicit MovieFormat( const QString &type, const QString &name, const QString &extension) :
m_type( type ),
m_name( name ),
m_extension( extension )
......
......@@ -306,7 +306,10 @@ void PlacemarkEditHeaderPrivate::selectAll()
using namespace Marble;
PlacemarkEditHeader::PlacemarkEditHeader(QWidget *parent, GeoDataCoordinates::Notation notation,
QString name, QString iconLink, QString id, const QStringList &idFilter)
const QString& name,
const QString& iconLink,
const QString& id,
const QStringList &idFilter)
: QWidget( parent ), d(new PlacemarkEditHeaderPrivate(this))
{
d->init(this);
......
......@@ -29,7 +29,10 @@ class MARBLE_EXPORT PlacemarkEditHeader : public QWidget
public:
explicit PlacemarkEditHeader(QWidget *parent = 0,
GeoDataCoordinates::Notation notation = GeoDataCoordinates::DMS,
QString name = "", QString iconLink = "", QString id = "", const QStringList &idFilter = QStringList() );
const QString& name = QString(),
const QString& iconLink = QString(),
const QString& id = QString(),
const QStringList &idFilter = QStringList() );
~PlacemarkEditHeader();
QString name() const;
QString iconLink() const;
......
......@@ -267,7 +267,7 @@ int PlacemarkLayout::maxLabelHeight() const
}
/// feed an internal QMap of placemarks with TileId as key when model changes
void PlacemarkLayout::addPlacemarks( QModelIndex parent, int first, int last )
void PlacemarkLayout::addPlacemarks( const QModelIndex& parent, int first, int last )
{
Q_ASSERT( first < m_placemarkModel->rowCount() );
Q_ASSERT( last < m_placemarkModel->rowCount() );
......@@ -297,7 +297,7 @@ void PlacemarkLayout::addPlacemarks( QModelIndex parent, int first, int last )
emit repaintNeeded();
}
void PlacemarkLayout::removePlacemarks( QModelIndex parent, int first, int last )
void PlacemarkLayout::removePlacemarks( const QModelIndex& parent, int first, int last )
{
Q_ASSERT( first < m_placemarkModel->rowCount() );
Q_ASSERT( last < m_placemarkModel->rowCount() );
......
......@@ -94,8 +94,8 @@ class PlacemarkLayout : public QObject
void setShowMaria( bool show );
void requestStyleReset();
void addPlacemarks( QModelIndex index, int first, int last );
void removePlacemarks( QModelIndex index, int first, int last );
void addPlacemarks( const QModelIndex& index, int first, int last );
void removePlacemarks( const QModelIndex& index, int first, int last );
void resetCacheData();
Q_SIGNALS:
......
......@@ -394,8 +394,8 @@ QSize PluginItemDelegate::nameSize( const QModelIndex& index )
return nameSize;
}
QRect PluginItemDelegate::alignRect( QRect object,
QRect frame,
QRect PluginItemDelegate::alignRect( const QRect& object,
const QRect& frame,
int position,
Qt::AlignmentFlag alignment )
{
......
......@@ -76,7 +76,7 @@ class PluginItemDelegate : public QAbstractItemDelegate
Qt::AlignmentFlag alignment = Qt::AlignLeft ) const;
static QSize nameSize( const QModelIndex& index );
static QRect alignRect( QRect object, QRect frame, int position, Qt::AlignmentFlag alignment );
static QRect alignRect( const QRect& object, const QRect& frame, int position, Qt::AlignmentFlag alignment );
QModelIndex m_configPressedIndex;
QModelIndex m_aboutPressedIndex;
......
......@@ -37,7 +37,7 @@ public:
GeoDataDocument *m_document;
SearchWidgetPrivate();
void setSearchResult( QVector<GeoDataPlacemark*> );
void setSearchResult( const QVector<GeoDataPlacemark*>& );
void search( const QString &searchTerm, SearchMode searchMode );
void clearSearch();
void centerMapOn( const QModelIndex &index );
......@@ -55,7 +55,7 @@ SearchWidgetPrivate::SearchWidgetPrivate() :
m_document->setName( QObject::tr( "Search Results" ) );
}
void SearchWidgetPrivate::setSearchResult( QVector<GeoDataPlacemark *> locations )
void SearchWidgetPrivate::setSearchResult( const QVector<GeoDataPlacemark *>& locations )
{
if( locations.isEmpty() ) {
return;
......
......@@ -32,7 +32,7 @@ public:
~SearchWidget();
private:
Q_PRIVATE_SLOT( d, void setSearchResult( QVector<GeoDataPlacemark*> ) )
Q_PRIVATE_SLOT( d, void setSearchResult( const QVector<GeoDataPlacemark*>& ) )
Q_PRIVATE_SLOT( d, void search( const QString &searchTerm, SearchMode searchMode ) )
Q_PRIVATE_SLOT( d, void centerMapOn( const QModelIndex &index ) )
......
......@@ -298,7 +298,7 @@ void ViewportParams::setHeight(int newHeight)
setSize( QSize( width(), newHeight ) );
}
void ViewportParams::setSize(QSize newSize)
void ViewportParams::setSize(const QSize& newSize)
{
if ( newSize == d->m_size )
return;
......
......@@ -106,7 +106,7 @@ class MARBLE_EXPORT ViewportParams
void setWidth(int newWidth);
void setHeight(int newHeight);
void setSize(QSize newSize);
void setSize(const QSize& newSize);
qreal centerLongitude() const;
qreal centerLatitude() const;
......
......@@ -293,7 +293,7 @@ void DeclarativeDataPlugin::setCopyrightYears( const QString & copyrightYears )
}
}
void DeclarativeDataPlugin::setDescription( const QString description )
void DeclarativeDataPlugin::setDescription( const QString & description )
{
if( d->m_description != description ) {
d->m_description = description;
......
......@@ -72,7 +72,7 @@ public:
virtual QString description() const;
void setDescription( const QString description );
void setDescription( const QString & description );
virtual QList<Marble::PluginAuthor> pluginAuthors() const;
......
......@@ -546,7 +546,7 @@ namespace Marble
emit projectionChanged(projection);
}
void MarbleQuickItem::setMapThemeId(QString mapThemeId)
void MarbleQuickItem::setMapThemeId(const QString& mapThemeId)
{
if (this->mapThemeId() == mapThemeId) {
return;
......@@ -753,7 +753,7 @@ namespace Marble
return &d->m_inputHandler;
}
void MarbleQuickItem::pinch(QPointF center, qreal scale, Qt::GestureState state)
void MarbleQuickItem::pinch(const QPointF& center, qreal scale, Qt::GestureState state)
{
d->m_inputHandler.pinch(center, scale, state);
}
......
......@@ -98,7 +98,7 @@ namespace Marble
void setMapHeight(int mapHeight);
void setShowFrameRate(bool showFrameRate);
void setProjection(Projection projection);
void setMapThemeId(QString mapThemeId);
void setMapThemeId(const QString& mapThemeId);
void setShowAtmosphere(bool showAtmosphere);
void setShowCompass(bool showCompass);
void setShowClouds(bool showClouds);
......@@ -194,7 +194,7 @@ namespace Marble
protected:
QObject *getEventFilter() const;
void pinch(QPointF center, qreal scale, Qt::GestureState state);
void pinch(const QPointF& center, qreal scale, Qt::GestureState state);
private Q_SLOTS:
void resizeMap();
......
......@@ -112,7 +112,7 @@ QString GeoDataDocument::property() const
return p()->m_property;
}
void GeoDataDocument::setProperty( QString property )
void GeoDataDocument::setProperty( const QString& property )
{
p()->m_property = property;
}
......
......@@ -81,7 +81,7 @@ public:
void setDocumentRole( DocumentRole role );
QString property() const;
void setProperty( QString property );
void setProperty( const QString& property );
/**
* @brief The filename of the document
......
......@@ -93,7 +93,7 @@ QString GeoDataLink::href() const
return d->m_href;
}
void GeoDataLink::setHref( QString href )
void GeoDataLink::setHref( const QString& href )
{
d->m_href = href;
}
......
......@@ -50,7 +50,7 @@ public:
QString href() const;
void setHref( QString href );
void setHref( const QString& href );
RefreshMode refreshMode() const;
......
......@@ -55,7 +55,7 @@ QString GeoDataStyleMap::lastKey() const
return d->lastKey;
}
void GeoDataStyleMap::setLastKey( QString key )
void GeoDataStyleMap::setLastKey( const QString& key )
{
d->lastKey = key;
}
......
......@@ -53,7 +53,7 @@ class GEODATA_EXPORT GeoDataStyleMap : public GeoDataStyleSelector,
* and add both to this map
* @param key the last key
*/
void setLastKey( QString key );
void setLastKey( const QString& key );
/**
* @brief assignment operator
......
......@@ -15,7 +15,7 @@
namespace Marble
{
GeoSceneGeodata::GeoSceneGeodata( QString name )
GeoSceneGeodata::GeoSceneGeodata( const QString& name )
: GeoSceneAbstractDataset( name ),
m_sourceFile( QString() ),
m_alpha( 1.0 ),
......@@ -46,7 +46,7 @@ QString GeoSceneGeodata::property() const
return m_property;
}
void GeoSceneGeodata::setProperty( QString property )
void GeoSceneGeodata::setProperty( const QString& property )
{
m_property = property;
}
......@@ -56,7 +56,7 @@ QString GeoSceneGeodata::sourceFile() const
return m_sourceFile;
}
void GeoSceneGeodata::setSourceFile(QString sourceFile)
void GeoSceneGeodata::setSourceFile(const QString& sourceFile)
{
m_sourceFile = sourceFile;
}
......@@ -66,7 +66,7 @@ QString GeoSceneGeodata::colorize() const
return m_colorize;
}
void GeoSceneGeodata::setColorize( QString colorize )
void GeoSceneGeodata::setColorize( const QString& colorize )
{
m_colorize = colorize;
}
......
......@@ -24,20 +24,20 @@ namespace Marble
class GEODATA_EXPORT GeoSceneGeodata : public GeoSceneAbstractDataset
{
public:
explicit GeoSceneGeodata( QString name );
explicit GeoSceneGeodata( const QString& name );
virtual ~GeoSceneGeodata();
virtual const char* nodeType() const;
bool operator==( const GeoSceneGeodata &other ) const;
QString property() const;
void setProperty( QString property );
void setProperty( const QString& property );
QString sourceFile() const;
void setSourceFile( QString sourceFile );
void setSourceFile( const QString& sourceFile );
QString colorize() const;
void setColorize( QString colorize );
void setColorize( const QString& colorize );
qreal alpha() const;
void setAlpha( const qreal &alpha );
......
......@@ -93,7 +93,7 @@ QPointF KineticModel::position() const
return d_ptr->position;
}
void KineticModel::setPosition(QPointF position)
void KineticModel::setPosition(const QPointF& position)
{
setPosition( position.x(), position.y() );
}
......@@ -120,7 +120,7 @@ void KineticModel::setPosition(qreal posX, qreal posY)
d_ptr->timestamp.start();
}
void KineticModel::jumpToPosition(QPointF position)
void KineticModel::jumpToPosition(const QPointF& position)
{
jumpToPosition( position.x(), position.y() );
}
......
......@@ -54,9 +54,9 @@ public:
public Q_SLOTS:
void setDuration(int ms);
void setPosition(QPointF position);
void setPosition(const QPointF& position);
void setPosition(qreal posX, qreal posY);
void jumpToPosition(QPointF position);
void jumpToPosition(const QPointF& position);
void jumpToPosition(qreal posX, qreal posY);
void setUpdateInterval(int ms);
void stop();
......
......@@ -604,7 +604,7 @@ void GeometryLayerPrivate::removeGraphicsItems( const GeoDataFeature *feature )
}
}
void GeometryLayer::addPlacemarks( QModelIndex parent, int first, int last )
void GeometryLayer::addPlacemarks( const QModelIndex& parent, int first, int last )
{
Q_ASSERT( first < d->m_model->rowCount( parent ) );
Q_ASSERT( last < d->m_model->rowCount( parent ) );
......@@ -619,7 +619,7 @@ void GeometryLayer::addPlacemarks( QModelIndex parent, int first, int last )
}
void GeometryLayer::removePlacemarks( QModelIndex parent, int first, int last )
void GeometryLayer::removePlacemarks( const QModelIndex& parent, int first, int last )
{
Q_ASSERT( last < d->m_model->rowCount( parent ) );
bool isRepaintNeeded = false;
......
......@@ -50,8 +50,8 @@ public:
QVector<const GeoDataFeature*> whichFeatureAt( const QPoint& curpos, const ViewportParams * viewport );
public Q_SLOTS:
void addPlacemarks( QModelIndex index, int first, int last );
void removePlacemarks( QModelIndex index, int first, int last );
void addPlacemarks( const QModelIndex& index, int first, int last );
void removePlacemarks( const QModelIndex& index, int first, int last );
void resetCacheData();
/**
......
......@@ -55,8 +55,8 @@ public:
void updateTextureLayers();
void updateTile( const TileId &tileId, const QImage &tileImage );
void addGroundOverlays( QModelIndex parent, int first, int last );
void removeGroundOverlays( QModelIndex parent, int first, int last );
void addGroundOverlays( const QModelIndex& parent, int first, int last );
void removeGroundOverlays( const QModelIndex& parent, int first, int last );
void resetGroundOverlaysCache();
void updateGroundOverlays();
......@@ -175,7 +175,7 @@ bool TextureLayer::Private::drawOrderLessThan( const GeoDataGroundOverlay* o1, c
return o1->drawOrder() < o2->drawOrder();
}
void TextureLayer::Private::addGroundOverlays( QModelIndex parent, int first, int last )
void TextureLayer::Private::addGroundOverlays( const QModelIndex& parent, int first, int last )
{
for ( int i = first; i <= last; ++i ) {
QModelIndex index = m_groundOverlayModel.index( i, 0, parent );
......@@ -194,7 +194,7 @@ void TextureLayer::Private::addGroundOverlays( QModelIndex parent, int first, in
m_parent->reset();
}
void TextureLayer::Private::removeGroundOverlays( QModelIndex parent, int first, int last )
void TextureLayer::Private::removeGroundOverlays( const QModelIndex& parent, int first, int last )
{
for ( int i = first; i <= last; ++i ) {
QModelIndex index = m_groundOverlayModel.index( i, 0, parent );
......
......@@ -135,8 +135,8 @@ public Q_SLOTS:
Q_PRIVATE_SLOT( d, void requestDelayedRepaint() )
Q_PRIVATE_SLOT( d, void updateTextureLayers() )
Q_PRIVATE_SLOT( d, void updateTile( const TileId &tileId, const QImage &tileImage ) )
Q_PRIVATE_SLOT( d, void addGroundOverlays( QModelIndex parent, int first, int last ) )
Q_PRIVATE_SLOT( d, void removeGroundOverlays( QModelIndex parent, int first, int last ) )
Q_PRIVATE_SLOT( d, void addGroundOverlays( const QModelIndex& parent, int first, int last ) )
Q_PRIVATE_SLOT( d, void removeGroundOverlays( const QModelIndex& parent, int first, int last ) )
Q_PRIVATE_SLOT( d, void resetGroundOverlaysCache() )
private:
......
......@@ -143,7 +143,7 @@ void OsmRelationManagerWidget::handleItemChange( QTreeWidgetItem *item, int colu
update();