From 20af95eee14213e73ab05d22db5860c7b6d8eae3 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Wed, 27 Aug 2008 22:17:28 +0000 Subject: [PATCH] Bogus foreach. svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=853577 --- containment.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/containment.cpp b/containment.cpp index f522e69d0..04e676c49 100644 --- a/containment.cpp +++ b/containment.cpp @@ -1542,11 +1542,10 @@ void ContainmentPrivate::appletDestroyed(QObject* object) focusedApplet = 0; } - foreach (AppletHandle* handle, handles) { - if (handles.contains(applet)) { - handles.remove(handle->applet()); - handle->deleteLater(); - } + if (handles.contains(applet)) { + AppletHandle *handle = handles.value(applet); + handles.remove(applet); + handle->deleteLater(); } emit q->appletRemoved(applet);