Commit 2f886abc authored by Boudewijn Rempt's avatar Boudewijn Rempt

use const & in foreach loops where applicable (but krazy shouldn't warn if we

loop over quint32, I think), and there are some legitimate cases where we don't
want to make the loop variable const.

svn path=/trunk/koffice/; revision=850345
parent 361d9b8a
......@@ -93,7 +93,7 @@ void KisBaseNode::mergeNodeProperties( const KoProperties & properties )
}
}
bool KisBaseNode::check( const KoProperties & properties )
bool KisBaseNode::check( const KoProperties & properties ) const
{
QMapIterator<QString, QVariant> iter = properties.propertyIterator();
while ( iter.hasNext() ) {
......
......@@ -146,7 +146,7 @@ public:
* but with a different value. Properties that are not in both
* lists are disregarded.
*/
bool check( const KoProperties & properties );
bool check( const KoProperties & properties ) const;
/**
* Accept the KisNodeVisitor (for the Visitor design pattern),
......
......@@ -61,7 +61,7 @@ KisSerializableConfiguration* KisBookmarkedConfigurationManager::load(const QStr
return 0;
}
KConfigGroup cfg = KGlobal::config()->group(configEntryGroup());
QDomDocument doc;
doc.setContent( cfg.readEntry<QString>(configname, "") );
QDomElement e = doc.documentElement();
......@@ -91,7 +91,7 @@ QList<QString> KisBookmarkedConfigurationManager::configurations() const
QMap< QString, QString > m = cfg->entryMap(configEntryGroup());
QList<QString> keys = m.keys();
QList<QString> configsKey;
foreach(QString key, keys)
foreach(const QString & key, keys)
{
if(key != ConfigDefault.id() && key != ConfigLastUsed.id())
{
......
......@@ -182,16 +182,16 @@ public:
KisPainter gc(m_projection);
gc.setChannelFlags( layer->channelFlags() );
KisBottomUpUpdateStrategy * updateStrategy =
KisBottomUpUpdateStrategy * updateStrategy =
static_cast<KisBottomUpUpdateStrategy*>(layer->updateStrategy());
if (updateStrategy->isDirty(rc)) {
QRegion dirty = updateStrategy->dirtyRegion( m_rc );
foreach (QRect rect, dirty.rects() ) {
foreach (const QRect & rect, dirty.rects() ) {
layer->updateProjection(rect);
}
}
KisPaintDeviceSP source = layer->projection();
if (tempTarget) {
......@@ -203,7 +203,7 @@ public:
gc.bitBlt(dx, dy, m_projection->colorSpace()->compositeOp(COMPOSITE_COPY), source, layer->opacity(), sx, sy, w, h);
else
gc.bitBlt(dx, dy, layer->compositeOp(), source, layer->opacity(), sx, sy, w, h);
updateStrategy->setClean( rc );
......@@ -253,7 +253,7 @@ public:
return true;
QRect tmpRc = m_rc;
KisPaintDeviceSP tempTarget = layer->temporaryTarget();
dbgImage << "tempTarget: " << tempTarget;
if (tempTarget) {
......@@ -283,7 +283,7 @@ public:
gc1.setCompositeOp(layerProjection->colorSpace()->compositeOp(COMPOSITE_COPY));
gc1.bitBlt(m_rc.topLeft(), m_projection, m_rc);
gc1.end();
KisConstProcessingInformation srcCfg(m_projection, tmpRc .topLeft(), 0);
KisProcessingInformation dstCfg(layerProjection, tmpRc .topLeft(), 0);
......@@ -388,12 +388,12 @@ public:
KisNodeWSP node;
KisImageSP image;
KisProjection * projection;
#ifdef USE_PAINTERPATH
QPainterPath dirtyArea;
#else
QRegion dirtyRegion;
#endif
#endif
QMutex regionLock;
};
......@@ -424,8 +424,8 @@ void KisBottomUpUpdateStrategy::setDirty(const QRect & rc )
m_d->dirtyArea.addRect(rc)
#else
m_d->dirtyRegion += QRegion(rc);
#endif
#endif
if (m_d->projection) {
emit rectDirtied(rc);
}
......@@ -443,18 +443,18 @@ void KisBottomUpUpdateStrategy::unlock()
m_d->projection->unlock();
}
void KisBottomUpUpdateStrategy::setImage(KisImageSP image)
void KisBottomUpUpdateStrategy::setImage(KisImageSP image)
{
// Hey, we're the root node!
if (image && m_d->node->inherits("KisGroupLayer") && !m_d->node->parent()) {
m_d->image = image;
m_d->projection = new KisProjection(image);
m_d->projection->setRootLayer(static_cast<KisGroupLayer*>(m_d->node.data()));
connect( m_d->projection, SIGNAL( sigProjectionUpdated( const QRect & ) ),
connect( m_d->projection, SIGNAL( sigProjectionUpdated( const QRect & ) ),
m_d->image.data(), SLOT( slotProjectionUpdated( const QRect &) ) );
connect( this, SIGNAL( rectDirtied(const QRect &)),
connect( this, SIGNAL( rectDirtied(const QRect &)),
m_d->projection, SLOT( addDirtyRect( const QRect & ) ) );
}
}
......@@ -484,9 +484,9 @@ void KisBottomUpUpdateStrategy::setClean( const QRect & rc )
QPainterPath p;
p.addRect(QRectF(rc));
m_d->dirtyArea = m_d->dirtyArea.subtracted(p);
#else
#else
m_d->dirtyRegion -= QRegion( rc );
#endif
#endif
}
void KisBottomUpUpdateStrategy::setClean()
......@@ -494,9 +494,9 @@ void KisBottomUpUpdateStrategy::setClean()
QMutexLocker(&m_d->regionLock);
#ifdef USE_PAINTERPATH
m_d->dirtyArea = QPainterPath();
#else
#else
m_d->dirtyRegion = QRegion();
#endif
#endif
}
QRegion KisBottomUpUpdateStrategy::dirtyRegion( const QRect & rc )
......@@ -522,7 +522,7 @@ KisPaintDeviceSP KisBottomUpUpdateStrategy::updateGroupLayerProjection( const QR
else {
projection->clear( rc );
}
KisLayerSP startWith = KisLayerSP(0);
KisAdjustmentLayerSP adjLayer = KisAdjustmentLayerSP(0);
......@@ -542,14 +542,14 @@ KisPaintDeviceSP KisBottomUpUpdateStrategy::updateGroupLayerProjection( const QR
// If this adjustment layer is dirty, start compositing with the
// previous layer, if there's one.
if ( static_cast<KisBottomUpUpdateStrategy*>(tmpAdjLayer->updateStrategy())->isDirty(rc)
&& !adjLayer.isNull()
&& adjLayer->visible())
&& !adjLayer.isNull()
&& adjLayer->visible())
{
startWith = dynamic_cast<KisLayer*>( adjLayer->prevSibling().data() );
break;
}
else if ( tmpAdjLayer->visible()
&& !static_cast<KisBottomUpUpdateStrategy*>(tmpAdjLayer->updateStrategy())->isDirty(rc))
else if ( tmpAdjLayer->visible()
&& !static_cast<KisBottomUpUpdateStrategy*>(tmpAdjLayer->updateStrategy())->isDirty(rc))
{
// This is the first adj. layer that is not dirty -- the perfect starting point
adjLayer = tmpAdjLayer;
......@@ -615,7 +615,7 @@ KisPaintDeviceSP KisBottomUpUpdateStrategy::updateGroupLayerProjection( const QR
child->accept(visitor);
child = dynamic_cast<KisLayer*>( child->nextSibling().data() );
}
return projection;
}
......
......@@ -50,7 +50,7 @@ KisNode::KisNode()
{
m_d->parent = 0;
m_d->graphListener = 0;
init();
}
......@@ -61,7 +61,7 @@ KisNode::KisNode( const KisNode & rhs )
{
m_d->parent = 0;
m_d->graphListener = rhs.m_d->graphListener;
foreach( KisNodeSP node, rhs.m_d->nodes ) {
foreach( const KisNodeSP & node, rhs.m_d->nodes ) {
m_d->nodes.append( node.data()->clone() );
}
init();
......@@ -120,7 +120,7 @@ void KisNode::setDirty( const QRegion & region)
{
if ( region.isEmpty() ) return;
foreach (QRect rc, region.rects()) {
foreach (const QRect & rc, region.rects()) {
m_d->updateStrategy->setDirty( rc );
}
}
......@@ -194,9 +194,9 @@ QList<KisNodeSP> KisNode::childNodes( const QStringList & nodeTypes, const KoPro
{
QList<KisNodeSP> nodes;
foreach( KisNodeSP node, m_d->nodes ) {
foreach( const KisNodeSP & node, m_d->nodes ) {
if ( !nodeTypes.isEmpty() ) {
foreach ( QString nodeType, nodeTypes ) {
foreach ( const QString & nodeType, nodeTypes ) {
if ( node->inherits( nodeType.toAscii() ) ) {
if ( properties.isEmpty() || node->check( properties ) )
nodes.append( node );
......@@ -263,9 +263,9 @@ bool KisNode::remove( quint32 index )
m_d->graphListener->aboutToRemoveANode( this, index );
removedNode->setParent( 0 ); // after calling aboutToRemoveANode or then the model get broken according to TT's modeltest
m_d->nodes.removeAt( index );
setDirty(); // FIXME Would probably better if we could set a QRect
if ( m_d->graphListener ) m_d->graphListener->nodeHasBeenRemoved(this, index);
......
......@@ -92,11 +92,11 @@ void PriorityToFirstMergeStrategy::merge(Store* dst, QList<const Store*> srcs, Q
{
Q_UNUSED(score);
dbgImage << "Priority to first meta data";
foreach( const Store* store, srcs )
{
QList<QString> keys = store->keys();
foreach(QString key, keys)
foreach(const QString & key, keys)
{
if( !dst->containsEntry( key ) )
{
......@@ -136,10 +136,10 @@ void OnlyIdenticalMergeStrategy::merge(Store* dst, QList<const Store*> srcs, QLi
Q_UNUSED(score);
dbgImage << "OnlyIdenticalMergeStrategy";
dbgImage << "Priority to first meta data";
Q_ASSERT(srcs.size() > 0 );
QList<QString> keys = srcs[0]->keys();
foreach(QString key, keys)
foreach(const QString & key, keys)
{
bool keep = true;
const Entry& e = srcs[0]->getEntry(key);
......@@ -270,20 +270,20 @@ void SmartMergeStrategy::merge(Store* dst, QList<const Store*> srcs, QList<doubl
srcs = scores2srcs.values();
scores = scores2srcs.keys();
}
// First attempt to see if one of the store has a higher score than the others
if(scores[0] > 2 * scores[1])
{ // One of the store has a higher importance than the other ones
dst->copyFrom( srcs[0] );
} else {
// Merge exif info
// Election
foreach(const Store* store, srcs)
{
QList<QString> keys = store->keys();
foreach(QString key, keys)
foreach(const QString & key, keys)
{
if(!dst->containsEntry( key ) )
{
......@@ -291,7 +291,7 @@ void SmartMergeStrategy::merge(Store* dst, QList<const Store*> srcs, QList<doubl
}
}
}
// Compute rating
double rating = 0.0;
double norm = 0.0;
......
......@@ -104,7 +104,7 @@ void KisRecordedBezierCurvePaintAction::toXML(QDomDocument& doc, QDomElement& el
{
KisRecordedPaintAction::toXML(doc,elt);
QDomElement waypointsElt = doc.createElement( "Waypoints");
foreach(Private::BezierCurveSlice info, d->infos)
foreach(const Private::BezierCurveSlice & info, d->infos)
{
QDomElement infoElt = doc.createElement( "Waypoint");
// Point1
......
......@@ -133,7 +133,6 @@ void KisPaintDeviceTest::testGeometry()
QVERIFY( dev->extent() == QRect( 50, 50, 50, 50 ) );
QColor c;
quint8 opacity;
dev->clear( QRect( 50, 50, 50, 50 ) );
dev->pixel( 80, 80, &c );
......@@ -336,7 +335,6 @@ void KisPaintDeviceTest::testPixel()
dev->setPixel( 5, 5, c );
QColor c2;
quint8 opacity2;
dev->pixel( 5, 5, &c2 );
......@@ -380,7 +378,7 @@ void KisPaintDeviceTest::testDirty()
QVERIFY( layer->isDirty() );
QVERIFY( !layer->isDirty( QRect( -10, -10, 5, 5 ) ) );
QVERIFY( layer->isDirty( QRect( 0, 0, 512, 512 ) ) );
#endif
#endif
}
void KisPaintDeviceTest::testMirror()
......
......@@ -109,7 +109,7 @@ void KisBrightnessContrastFilterConfiguration::fromXML( const QString& s )
else if (e.attribute("name") == "curve") { // ### 1.6 needs .tagName("name") here!
QStringList data = e.text().split( ';' );
curve.clear();
foreach (QString pair, data) {
foreach (const QString & pair, data) {
if (pair.indexOf(',') > -1) {
QPointF p;
p.rx() = pair.section(',', 0, 0).toDouble();
......@@ -147,8 +147,7 @@ QString KisBrightnessContrastFilterConfiguration::toString()
e = doc.createElement("curve");
QString sCurve;
QPointF pair;
foreach (pair, curve) {
foreach (const QPointF & pair, curve) {
sCurve += QString::number(pair.x());
sCurve += ',';
sCurve += QString::number(pair.y());
......
......@@ -129,7 +129,7 @@ void KisPerChannelFilterConfiguration::fromXML( const QString& s )
if (!curvesElement.isNull() && !curvesElement.text().isEmpty()) {
QStringList data = curvesElement.text().split( ';' );
foreach (QString pair, data) {
foreach (const QString & pair, data) {
if (pair.indexOf(',') > -1) {
QPointF p;
p.rx() = pair.section(',', 0, 0).toDouble();
......@@ -179,8 +179,8 @@ QString KisPerChannelFilterConfiguration::toString()
QDomElement t = doc.createElement("curve");
KisCurve curve = curves[i];
QString sCurve;
QPointF pair;
foreach (pair, curve) {
foreach (const QPointF & pair, curve) {
sCurve += QString::number(pair.x());
sCurve += ',';
sCurve += QString::number(pair.y());
......
......@@ -94,7 +94,7 @@ void KisEmbossFilter::process(KisConstProcessingInformation srcInfo,
QPoint srcTopLeft = srcInfo.topLeft();
Q_ASSERT(src != 0);
Q_ASSERT(dst != 0);
//read the filter configuration values from the KisFilterConfiguration object
quint32 embossdepth = config ? config->getInt("depth",30) : 30;
......@@ -174,6 +174,8 @@ int KisEmbossFilter::Lim_Max (int Now, int Up, int Max) const
KisFilterConfigWidget * KisEmbossFilter::createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP, const KisImageSP image) const
{
Q_UNUSED(image);
vKisIntegerWidgetParam param;
param.push_back( KisIntegerWidgetParam( 10, 300, 30, i18n("Depth"), "depth" ) );
KisFilterConfigWidget * w = new KisMultiIntegerFilterWidget( id().id(), parent, id().id(), param );
......
......@@ -109,7 +109,7 @@ void KisFilterRandomPick::process(KisConstProcessingInformation srcInfo,
int seedThreshold = rand();
int seedH = rand();
int seedV = rand();
if( config )
{
seedThreshold = config->getInt( "seedThreshold", seedThreshold);
......@@ -155,6 +155,7 @@ void KisFilterRandomPick::process(KisConstProcessingInformation srcInfo,
KisFilterConfigWidget * KisFilterRandomPick::createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev, const KisImageSP image ) const
{
Q_UNUSED(image);
Q_UNUSED(dev);
return new KisWdgRandomPick((KisFilter*)this, (QWidget*)parent);
}
......@@ -168,6 +169,6 @@ KisFilterConfiguration* KisFilterRandomPick::factoryConfiguration(const KisPaint
config->setProperty("seedThreshold", rand() );
config->setProperty("seedH", rand() );
config->setProperty("seedV", rand() );
return config;
}
......@@ -52,7 +52,7 @@ KSColorSpacesPlugin::KSColorSpacesPlugin(QObject *parent, const QStringList &)
list = KGlobal::mainComponent().dirs()->findAllResources("illuminant_profiles", "*.xll", KStandardDirs::Recursive);
KisIlluminantProfile *p;
foreach(QString curr, list) {
foreach(const QString & curr, list) {
p = new KisIlluminantProfile(curr);
bool r = p->load();
if(!r) {
......
......@@ -50,7 +50,7 @@ KisToolPolygon::KisToolPolygon(KoCanvasBase *canvas)
QAction *action = new QAction(i18n("&Finish Polygon"), this);
addAction("finish_polygon", action );
connect(action, SIGNAL(triggered()), this, SLOT(finish()));
action = new QAction(KIcon("cancel"), i18n("&Cancel"), this);
action = new QAction(KIcon("dialog-cancel"), i18n("&Cancel"), this);
addAction("cancel_polygon", action );
connect(action, SIGNAL(triggered()), this, SLOT(cancel()));
......
......@@ -50,7 +50,7 @@ KisToolPolyline::KisToolPolyline(KoCanvasBase * canvas)
QAction *action = new QAction(i18n("&Finish Polyline"), this);
addAction("finish_polyline", action );
connect(action, SIGNAL(triggered()), this, SLOT(finish()));
action = new QAction(KIcon("cancel"), i18n("&Cancel"), this);
action = new QAction(KIcon("dialog-cancel"), i18n("&Cancel"), this);
addAction("cancel_polyline", action );
connect(action, SIGNAL(triggered()), this, SLOT(cancel()));
......
......@@ -140,8 +140,7 @@ void Bracketing2HDRPlugin::slotAddImages()
// dbgPlugins <<"Add image";
QStringList openfiles = KFileDialog::getOpenFileNames(KUrl(),"*", m_view);
// dbgPlugins << openfiles.size() <<" files selected for inclusion";
QString filename;
foreach(filename, openfiles)
foreach(const QString & filename, openfiles)
{
addImage( filename );
}
......@@ -536,7 +535,7 @@ bool Bracketing2HDRPlugin::loadImagesInMemory()
f.apexBrightness = 2.0 * log(f.aperture ) + log( 1.0 / f.exposure) - log( f.sensitivity / 3.125 );
f.apexBrightness /= log(2.0);
f.apexBrightness = 1.0 / ( powf(2.0, f.apexBrightness) );// * ( 1.0592f * 11.4f / 3.125f ) ); // TODO: the magic number is apparrently dependent of the camera, this value is taken from pfscalibrate, this need to be configurable (it is the reflected-light meter calibration constant)
if( i >= m_wdgBracketing2HDR->tableWidgetImages->rowCount() / 2 &&
if( i >= m_wdgBracketing2HDR->tableWidgetImages->rowCount() / 2 &&
i < m_wdgBracketing2HDR->tableWidgetImages->rowCount() / 2 + 1)
{
apexNorm = f.apexBrightness;
......
......@@ -48,7 +48,7 @@ KisMetaDataEditor::KisMetaDataEditor(QWidget* parent, KisMetaData::Store* origin
QStringList files = KGlobal::dirs()->findAllResources("data", "kritaplugins/metadataeditor/*.rc");
foreach(QString file, files)
foreach(const QString & file, files)
{
QFile xmlFile(file);
......
......@@ -65,7 +65,7 @@ const QList<KisControlPoint>& KisControlPoints::controlPoints() const
void KisControlPoints::addMatches( const lMatches& matches, int frameRef, int frameMatch )
{
foreach( KisMatch m, matches )
foreach( const KisMatch & m, matches )
{
KisControlPoint cp( d->framesCount );
if( findControlPoint( m.ref, frameRef, cp) )
......
......@@ -212,7 +212,7 @@ MatchHypothesis findSeed( const KisInterestPoint* ref, const lInterestPoints& po
dbgPlugins << " preHypothesis : " << preHs.size() << " median = " << median;
MatchHypothesis currentHypo;
currentHypo.sumScore = 0.0;
foreach( MatchPreHypothesis mph, preHs )
foreach( const MatchPreHypothesis & mph, preHs )
{
if( diffAngle(mph.angle, median ) < 0.1)
{
......
......@@ -96,8 +96,7 @@ void PanoramaPlugin::slotAddImages()
// dbgPlugins <<"Add image";
QStringList openfiles = KFileDialog::getOpenFileNames(KUrl(),"*", m_view);
// dbgPlugins << openfiles.size() <<" files selected for inclusion";
QString filename;
foreach(filename, openfiles)
foreach(const QString & filename, openfiles)
{
addImage( filename );
}
......@@ -110,7 +109,7 @@ void PanoramaPlugin::slotRemoveImage()
void PanoramaPlugin::slotImageUp()
{
if (m_wdgPanoramaCreation->listImages->currentRow() == 0) return;
if (m_wdgPanoramaCreation->listImages->currentRow() == 0) return;
QListWidgetItem * w = m_wdgPanoramaCreation->listImages->takeItem(m_wdgPanoramaCreation->listImages->currentRow());
m_wdgPanoramaCreation->listImages->insertItem(m_wdgPanoramaCreation->listImages->currentRow(), w);
m_wdgPanoramaCreation->listImages->setCurrentItem(w);
......@@ -121,10 +120,10 @@ void PanoramaPlugin::slotImageDown()
if (m_wdgPanoramaCreation->listImages->currentRow() == m_wdgPanoramaCreation->listImages->count() - 1) return;
int i = m_wdgPanoramaCreation->listImages->currentRow();
QListWidgetItem * w = m_wdgPanoramaCreation->listImages->takeItem(m_wdgPanoramaCreation->listImages->currentRow());
if (i == 0)
if (i == 0)
m_wdgPanoramaCreation->listImages->insertItem(m_wdgPanoramaCreation->listImages->currentRow() + 1, w);
else
m_wdgPanoramaCreation->listImages->insertItem(m_wdgPanoramaCreation->listImages->currentRow() + 2, w);
......@@ -136,7 +135,7 @@ void PanoramaPlugin::slotCreatePanoramaLayer()
dbgPlugins <<"Create a panorama layer";
delete m_wdgPanoramaCreation;
m_wdgPanoramaCreation = new Ui_WdgPanoramaCreation();
QDialog* dialog = new QDialog(m_view);
dialog->setWindowTitle(i18n("Create Panorama Layer"));
dialog->setModal(true);
......@@ -184,7 +183,7 @@ void PanoramaPlugin::slotCreatePanoramaLayer()
m_wdgPanoramaCreation->bnRemove->setIcon(SmallIcon("list-remove"));
m_wdgPanoramaCreation->bnUp->setIcon(SmallIcon("go-up"));
m_wdgPanoramaCreation->bnDown->setIcon(SmallIcon("go-down"));
if(dialog->exec()==QDialog::Accepted)
{
......
......@@ -66,7 +66,7 @@ KisFiltersModel::KisFiltersModel(KisPaintDeviceSP thumb) : d(new Private)
{
d->thumb = thumb;
KisFilterRegistry* registry = KisFilterRegistry::instance();
foreach(QString key, registry->keys())
foreach(const QString & key, registry->keys())
{
KisFilterSP filter = registry->get(key);
Q_ASSERT(filter);
......
......@@ -152,7 +152,7 @@ void KisPaintopBox::colorSpaceChanged(const KoColorSpace *cs)
m_displayedOps.clear();
m_cmbPaintops->clear();
foreach (KoID paintopId, m_paintops) {
foreach (const KoID & paintopId, m_paintops) {
if (KisPaintOpRegistry::instance()->userVisible(paintopId, cs)) {
QPixmap pm = paintopPixmap(paintopId);
......@@ -223,7 +223,7 @@ void KisPaintopBox::slotCurrentNodeChanged(KisNodeSP node)
it != m_inputDevicePresets.end();
++it)
{
foreach(KisPaintOpPresetSP preset, it.value())
foreach(const KisPaintOpPresetSP & preset, it.value())
{
if(preset && preset->settings()) {
preset->settings()->setNode(node);
......@@ -278,7 +278,7 @@ KisPaintOpPresetSP KisPaintopBox::activePreset(const KoID & paintop, const KoInp
InputDevicePresetsMap::iterator it = m_inputDevicePresets.find( inputDevice );
if (it == m_inputDevicePresets.end()) {
foreach (KoID paintopId, m_paintops) {
foreach (const KoID & paintopId, m_paintops) {
KisPaintOpPresetSP preset =
KisPaintOpRegistry::instance()->defaultPreset( paintopId, 0, inputDevice, m_view->image() );
if (preset && preset->settings() && preset->settings()->widget()) {
......
......@@ -345,7 +345,7 @@ void KisSelectionManager::updateGUI()
if (data)
{
QStringList mimeTypes = m_view->canvasBase()->toolProxy()->supportedPasteMimeTypes();
foreach(QString mimeType, mimeTypes)
foreach(const QString & mimeType, mimeTypes)
{
if ( data->hasFormat( mimeType ) ) {
shapePasteEnable = true;
......@@ -421,7 +421,7 @@ void KisSelectionManager::selectionChanged()
void KisSelectionManager::updateSimpleOutline()
{
simpleOutline.clear();
foreach(QPolygon polygon, outline) {
foreach(const QPolygon & polygon, outline) {
QPolygon simplePolygon;
simplePolygon << polygon.at(0);
......@@ -1781,13 +1781,13 @@ void KisSelectionManager::paint(QPainter& gc, const KoViewConverter &converter)
int i=0;
gc.setPen(pen);
if(1/m_view->image()->xRes()*sx<3)
foreach(QPolygon polygon, simpleOutline)
foreach(const QPolygon & polygon, simpleOutline)
{
gc.drawPolygon(polygon);
i++;
}
else
foreach(QPolygon polygon, outline)
foreach(const QPolygon & polygon, outline)
{
gc.drawPolygon(polygon);
i++;
......