[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/utils/kpager
From:       Pino Toscano <pino () kde ! org>
Date:       2010-12-31 22:25:49
Message-ID: 20101231222549.6C32CAC8AE () svn ! kde ! org
[Download RAW message or body]

SVN commit 1210517 by pino:

use a QListIterator to iterate safely from the end to the begin of the list


 M  +5 -5      desktop.cpp  


--- trunk/extragear/utils/kpager/desktop.cpp #1210516:1210517
@@ -137,9 +137,12 @@
 	if (list.count() <= 0)
 		return 0L;
 
-	for (QList<WId>::ConstIterator it = list.constEnd(); ; --it)
+	QListIterator<WId> it(list);
+	it.toBack();
+	while (it.hasPrevious())
 	{
-		KWindowInfo* info = pager()->info( *it );
+		const WId id = it.previous();
+		KWindowInfo* info = pager()->info(id);
 		if (shouldPaintWindow(info))
 		{
 			r=info->geometry();
@@ -156,9 +159,6 @@
 				return info;
 			}
 		}
-
-		if (it == list.constBegin())
-			break;
 	}
 	return 0L;
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic