while (nextParent == commonParent) { if (ansList.size() < bestParentRow + 1) // If the list is longer, it means that at the end of it is a descendant of the new index. // We insert the ancestors items first in that case. break; const QModelIndex nextSibling = ansList.value(bestParentRow + 1); if (!nextSibling.isValid()) { continue; } I ran into this when I added a fourth mail repository to KMail. The code loops from line 185 to line 194; nothing in between affects the condition of line 185. In effect, KMail hangs on startup and I am unable to access its preferences.
The backtrace is in Bug 289476
If nextSibling is ever invalid, this indeed results in an endless loop. I'm not sure how to fix it though.
Hi, kdelibs (version 4 and earlier) is no longer maintained since a few years. KDE Frameworks 5 or 6 might already have resolved this bug. If not, please re-open against the matching framework if feasible or against the application that shows the issue. We then can still dispatch it to the right Bugzilla product or component. Greetings Christoph Cullmann