[Bug 221109] Crash when deleting multiple folder [ProjectManagerViewPlugin::removeFolderFromContextMenu, ProjectManagerViewPlugin::qt_metacall, QMetaObject::metacall]

Andreas Pakulat apaku at gmx.de
Sun Jan 3 20:12:46 UTC 2010


I'm moving this to the devel list as thats a better place to discuss
technical details.

On 03.01.10 18:32:52, Milian Wolff wrote:
> But you are aware that the watcher is the culprit here and that this would fix
> the crash(es)?

So the problem is:

1. User selects multiple cmake-known dirs and selects "delete"
2. User gets to the cmake edit dialog, because the first item is about
to be removed
3. User deletes multiple entries from the cmake files
4. CMake stores the new file, which triggers the watcher, which reloads
the file which deletes the items from the model
5. the next item is tried to be removed, but it doesn't exist anymore

?

So the first question is: Why is the watcher active for a file that is
being saved by us. Or rather, why do we reload it if we just saved it. I
had a similar problem at work and the solution was to simply store the
modification time right after the save and only reload if the
modification time is newer than this stored one. That saves all these
kind of problems.

Another thing is that the cmake support should save the cmake file only
once he deleted all project items, not after deleting the first one or
even before that.

Just IMHO of course and I didn't look at the code!

> Making them ref-counted would remove the crash but would still be confusing to
> the User:
> 
> - delete first
> - in wizard delete others
> - all other delete actions will trigger error messages (since the folders are
> not found and hence cannot be deleted etc.)

No that wouldn't happen, the items would still be deleted as either the
watcher or the real deleteFolder code would do that. Just that either
can check wether the item has already been deleted or not. 

Andreas

-- 
You will outgrow your usefulness.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100103/79c80c3c/attachment.sig>


More information about the KDevelop-devel mailing list