diff --git a/geometry.cpp b/geometry.cpp index 6a7ded4cc2..c3deb3437c 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1046,7 +1046,7 @@ void Client::checkWorkspacePosition(QRect oldGeometry, int oldDesktop) oldGeomTall = QRect(oldGeometry.x(), 0, oldGeometry.width(), workspace()->oldDisplayHeight()); // Full screen height oldGeomWide = QRect(0, oldGeometry.y(), workspace()->oldDisplayWidth(), oldGeometry.height()); // Full screen width int distance = INT_MAX; - foreach( QRect r, workspace()->previousScreenSizes()) { + foreach(const QRect &r, workspace()->previousScreenSizes()) { int d = r.contains( oldGeometry.center()) ? 0 : ( r.center() - oldGeometry.center()).manhattanLength(); if( d < distance ) { distance = d; diff --git a/tabbox/clientmodel.cpp b/tabbox/clientmodel.cpp index daa063af05..c8b1d19df2 100644 --- a/tabbox/clientmodel.cpp +++ b/tabbox/clientmodel.cpp @@ -98,7 +98,7 @@ QVariant ClientModel::data(const QModelIndex& index, int role) const QString ClientModel::longestCaption() const { QString caption; - foreach (QWeakPointer clientPointer, m_clientList) { + foreach (const QWeakPointer &clientPointer, m_clientList) { QSharedPointer client = clientPointer.toStrongRef(); if (!client) { continue; @@ -218,7 +218,7 @@ void ClientModel::createClientList(int desktop, bool partialReset) break; } } - foreach (QWeakPointer< TabBoxClient > c, stickyClients) { + foreach (const QWeakPointer< TabBoxClient > &c, stickyClients) { m_clientList.removeAll(c); m_clientList.prepend(c); } diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp index 0541e5948d..825a4a70d2 100644 --- a/tabbox/tabbox.cpp +++ b/tabbox/tabbox.cpp @@ -600,7 +600,7 @@ ClientList TabBox::currentClientList() { TabBoxClientList list = m_tabBox->clientList(); ClientList ret; - foreach (QWeakPointer clientPointer, list) { + foreach (const QWeakPointer &clientPointer, list) { QSharedPointer client = clientPointer.toStrongRef(); if (!client) continue; diff --git a/tabbox/tabboxhandler.cpp b/tabbox/tabboxhandler.cpp index 66d2acb1af..ad3919aa03 100644 --- a/tabbox/tabboxhandler.cpp +++ b/tabbox/tabboxhandler.cpp @@ -455,7 +455,7 @@ void TabBoxHandler::createModel(bool partialReset) // TODO: C++11 use lambda function bool lastRaised = false; bool lastRaisedSucc = false; - foreach (QWeakPointer clientPointer, stackingOrder()) { + foreach (const QWeakPointer &clientPointer, stackingOrder()) { QSharedPointer client = clientPointer.toStrongRef(); if (!client) { continue;