[korganizer] [Bug 406881] Infinite loop in sortedPrenodes
Kevin Funk
bugzilla_noreply at kde.org
Thu Apr 25 10:41:40 BST 2019
https://bugs.kde.org/show_bug.cgi?id=406881
--- Comment #2 from Kevin Funk <kfunk at kde.org> ---
Managed to find the culprit by printing some more debug output and thereby
locating the problematic calendar folder
The final fix was to clear the Akonadi cache for that particular calendar
folder; I think that helped. Not sure how I got in that state to begin with.
I think that 'sortedPrenodes' should probably be more graceful for situations
like this and not run into an infinite loop in any case(?)
Here's the tmp patch (just for the record):
```
diff --git a/src/todo/incidencetreemodel.cpp b/src/todo/incidencetreemodel.cpp
index c6b03d4..88dc935 100644
--- a/src/todo/incidencetreemodel.cpp
+++ b/src/todo/incidencetreemodel.cpp
@@ -59,11 +59,13 @@ static PreNode::List sortedPrenodes(const PreNode::List
&nodes)
PreNode::List remainingNodes = nodes;
while (prenodeByUid.count() < count) {
+ qDebug() << "FOO: " << remainingNodes << "- prenodeByUid.count:" <<
prenodeByUid.count() << "- count:" << count;
bool foundAtLeastOne = false; // this bool saves us from infinit
looping if the parent doesn't exist
for (const PreNode::Ptr &node : nodes) {
Q_ASSERT(node);
const QString uid = node->incidence->instanceIdentifier();
const QString parentUid = node->incidence->relatedTo();
+ qDebug() << " uid" << uid << "- parent uid:" << parentUid << "-
desc:" << node->incidence->description() << "- summary:" <<
node->incidence->summary();
if (parentUid.isEmpty()) { // toplevel todo
prenodeByUid.insert(uid, node);
remainingNodes.removeAll(node);
```
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Kdepim-bugs
mailing list