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

Olivier JG olivier.jg at gmail.com
Tue Oct 12 07:59:49 UTC 2010

  On 01/05/2010 02:57 AM, Andreas Pakulat wrote:
> On 04.01.10 16:23:08, Milian Wolff wrote:
>> On Monday, 4. January 2010 14:43:00 Andreas Pakulat wrote:
>>> On 04.01.10 00:35:52, Milian Wolff wrote:
>>>>> 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.
>>>> You mean one should temporarily disable the watcher before filesave? But
>>>> we still have to reparse the "new" cmakefile and that will (currently)
>>>> lead to a reload of the cmake project's model as far as I saw in the
>>>> sources. Hence _all_ item's (below a given folder) get invalidated.
>>> I guess currently thats true. However it shouldn't be needed at all in
>>> theory. All thats "updated" with the parsing (thats not updated otherwise)
>>> is the DUChain information, which the CMake support could also "manually"
>>> update on such a change. But of course that means limiting what the user
>>> can do in that editor window.
>> I'd personally don't want to limit the user in what he can do. Esp.
>> considering that I doubt it would be easy with the KTextEditor API (afaik
>> there is no such thing as "drag selection" events or similar).
> Another thing that could be done is simply disabling editing support in the
> dialog. Eclipse does that and so far I never wanted to change the proposed
> changes or if I really wanted to do that it was more than moving some small
> part around and hence I wanted a full blown editor anyway. Its nice to have
> full highlighting etc. in the dialog but I'm not convinced editing is
> needed, especially since AFAIK the cmake support already guesses pretty
> well were to add new code (i.e. adds to a set(XYZ) instead of the
> add_executable(XYZ))
> Andreas
Only now that I post in the bug do I realize all the discussion that has 
been happening on it...
A few notes:
(1) At this point, disabling editing in the dialog is a Bad Idea, as 
it's often just wrong (try to make a folder with a space, or a triple 
nested folder). Also, if it's just for this, the removeProjectItems() 
API should fix it.
(2) I don't think a wrapper is good either. For one thing you may check 
the moment before its invalidated, for another I doubt handling would be 
more useful than "Error: unknown error"
(3) By my reading of the source currently CMake support made the good 
move of not invalidating the entire folder on a reload, but rather 
checking for new and removed files.

-Olivier JG

More information about the KDevelop-devel mailing list