ktoolbar and index value

David Faure faure at kde.org
Mon Jul 19 15:25:35 BST 2004


On Monday 19 July 2004 16:06, Benjamin Meyer wrote:
> How about this?  If there is only 1 toolbar don't store the Index.  I added
> another parameter to KToolBar::saveSettings with a default value.  And then
> in KMainWindow it passes the arg stating if it is a lone toolbar or not.

You can't add an argument (even with a default value) to a public method, that's BIC.
And IMHO this is an implementation detail, it shouldn't be a method argument.

How about 

    KMainWindow *kmw = dynamic_cast<KMainWindow *>(mainWindow());
    if ( !kmw || kmw->toolBarIterator().count() > 1 ); // don't save if there's only one toolbar
        config->writeEntry("Index", index);

--
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