ktoolbar and index value
David Faure
faure at kde.org
Mon Jul 19 01:06:09 BST 2004
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.
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])".
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel
mailing list