Lutz is right with his problem report: Using a QDict for the orphaned children we really need to take into account that a parent (UID) might have multiple children, so the same key might have multiple entries in the dict. Now, you always only have access to the last inserted one, so to remove the correct entry, we need to remove all and then re-add those that we don't want to remove.
Lutz is right with his problem report: Using a QDict for the orphaned children we really need to take into account that a parent (UID) might have multiple children, so the same key might have multiple entries in the dict. Now, you always only have access to the last inserted one, so to remove the correct entry, we need to remove all and then re-add those that we don't want to remove.

Also extend Lutz' solution a little bit to clean the dict of orphaned pairs (the parent UID stored in the dict does not necessarily have to be the incidence->relatedTo()->uid(), so theck the whole list for all matching pointers) because the parent uid for an incidence has been changed before the parent was inserted. The old parent UID <=> child pointer relation will still be in the list.

CCMAIL: lutz@rogowski.info


svn path=/branches/KDE/3.5/kdepim/; revision=443892

lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi