XML KAction problem.

Mickael Marchand marchand at kde.org
Wed Sep 25 18:36:04 BST 2002

Hash: SHA1

Le Mercredi 25 Septembre 2002 04:23, Zack Rusin a écrit :
> On Tuesday 24 September 2002 18:51, Simon Hausmann wrote:
> > Hm, strange, very strange. Can you try if reverting my patch changes
> > anything?
> Does 'doesn't crash anymore' count as a change? ;) I reverted and
> checked what's wrong. Here's something funny - your patch fixes the
> dangling pointer problem by going through the guarder pointer but even
> after deletion of the area a call to removeDockWindow is a requirement.
> Beats me what happens but the following change in the destructor of
> QDockWindow fixes applications:
> -    if ( area )
> -       area->removeDockWindow( this, FALSE, FALSE );
> +    if ( this->area() )
> +       this->area()->removeDockWindow( this, FALSE, FALSE );
> it's obviously wrong because we go back to dealing with dangling
> pointers and I sure as hell am not sure why the call to
> removeDockWindow is a requirement considering that the area shouldn't
> even exist. Weird...

why should the area do not exist anymore ?
I think QDockArea are QMainWindow's stuff and they don't get destroy (these
are area created by QMainWindow and destroyed when the mainwindow is destroyed.
when you set the QDockWindow as floating, that will remove the window out of
the area but the area is still here (so that you can bring back your window
in, for example when you bring back your floating toolbar in).

actually, I think Simon's patch was good, but it 'inverted' the problem
because it appears to me that dockWindowData is initialized to '0' and is
updated later (in updatePosition), so in some cases the destructor can be
called before any action has occured on the QDockWindow, then dockWindowData
is null.
I think that something like :
  if ( dockWindowData )
		area = ( (QDockArea::DockWindowData*)dockWindowData )->area;
		area = this->area();
will do it so that we fall back on area() (nearly what Zack proposed before).
That seems to fix all the bugs (the one Simon fixed and the one we got in

but while working on this I found another problem (maybe related, maybe not) :
start kedit, set the toolbar as floating, save settings, close kedit
start kedit again => the toolbar is not shown
now, click on showToolbar in the menu, that will uncheck, reclick on it, then
it will show the toolbar
thoughts ?


- -- 
Mickael Marchand, marchand at kde.org, marchand at freenux.org
KVim maintainer, http://freehackers.org/kvim
"Leading Vim to the K Desktop Environment !"

Version: GnuPG v1.2.0 (GNU/Linux)


More information about the kde-core-devel mailing list