Fix non-const ref iterator issues reported by Krazy2 checker foreach
This commit is contained in:
parent
533d57da60
commit
47ddf1384c
4 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
|
|
|
@ -98,7 +98,7 @@ QVariant ClientModel::data(const QModelIndex& index, int role) const
|
|||
QString ClientModel::longestCaption() const
|
||||
{
|
||||
QString caption;
|
||||
foreach (QWeakPointer<TabBoxClient> clientPointer, m_clientList) {
|
||||
foreach (const QWeakPointer<TabBoxClient> &clientPointer, m_clientList) {
|
||||
QSharedPointer<TabBoxClient> 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);
|
||||
}
|
||||
|
|
|
@ -600,7 +600,7 @@ ClientList TabBox::currentClientList()
|
|||
{
|
||||
TabBoxClientList list = m_tabBox->clientList();
|
||||
ClientList ret;
|
||||
foreach (QWeakPointer<TabBoxClient> clientPointer, list) {
|
||||
foreach (const QWeakPointer<TabBoxClient> &clientPointer, list) {
|
||||
QSharedPointer<TabBoxClient> client = clientPointer.toStrongRef();
|
||||
if (!client)
|
||||
continue;
|
||||
|
|
|
@ -455,7 +455,7 @@ void TabBoxHandler::createModel(bool partialReset)
|
|||
// TODO: C++11 use lambda function
|
||||
bool lastRaised = false;
|
||||
bool lastRaisedSucc = false;
|
||||
foreach (QWeakPointer<TabBoxClient> clientPointer, stackingOrder()) {
|
||||
foreach (const QWeakPointer<TabBoxClient> &clientPointer, stackingOrder()) {
|
||||
QSharedPointer<TabBoxClient> client = clientPointer.toStrongRef();
|
||||
if (!client) {
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue