ktoolbar and index value

Benjamin Meyer ben at meyerhome.net
Mon Jul 19 02:50:45 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 18 July 2004 8:06 pm, David Faure wrote:
> On Monday 19 July 2004 01:17, Benjamin Meyer wrote:
> > I found that many of the config files in my cvs head account for apps
> > contained a lone entry for index=0.  Taking a look at the code I agree
> > with the comment above the patch (in ktoolbar.cpp) that states that the
> > initial value (-1) will never be the same at the stored default value
> > (0).  So I added a check for 0.
>
> Hmm. Not writing out the Index [because it's 0, in your patch] means that
> on reloading, QMainWindow::moveDockWindow will be called with index set to
> -1. This ends up in QDockArea::moveDockWindow(), which treats -1 as "append
> to the end". This is quite different from 0, which means "make it first".
>
> So I suspect that if you make some random toolbar the first one, your patch
> breaks repositioning the toolbars in the same position the next time,
> since it will be made last instead of first.

Thanks, didn't think it would be this easy.

> If you want to avoid the Index=0 entries for simple apps with a single
> toolbar, I would agree to a patch that says "if my kmainwindow has only one
> toolbar, no need to save the position (it's obviously 0 [well a check
> wouldn't hurt])".

Hmm, but that would only work for apps with one toolbar and not in the general 
case.  I'll investigate some more and see what I can come up for a more 
general case.

- -Benjamin Meyer

- -- 
aka icefox
Public Key: http://www.csh.rit.edu/~benjamin/public_key.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA+yj11rZ3LTw38vIRAjmhAJ9T1WwRiw6Os3u4g9g9bgeQvWZygACgvpMr
yTwxaqmB7jc0JRMXjX2n1NI=
=vKfu
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list