Porting problems with KMainWindow::readProperties()
Tobias Koenig
tokoe at kde.org
Tue Feb 27 09:52:22 GMT 2007
On Mon, Feb 26, 2007 at 08:35:05PM +0100, David Faure wrote:
> On Saturday 24 February 2007, Tobias Koenig wrote:
Hi David,
> > So to port the following code:
> >
> > void FooBarMainWindow::readProperties( KConfig *config )
> > {
> > const KConfigGroup group = config->group( "view" );
> > value = group.readValue("bar");
> > }
> >
> > we shall write now
> >
> > void FooBarMainWindow::readProperties( const KConfigGroup &config )
> > {
> > const KConfigGroup group = config.config()->group( "view" );
> > value = group.readValue("bar");
> > }
>
> No, value = config.readValue("bar"). And fix saveProperties to do the same.
But it seems that some apps need the possibility to have namespaces
_inside_ a group. At the moment they use the toplevel groups as namespaces, so
how shall we map them to the new design?
I'd really like to see KConfig offering the same hierarchical structure
(groups in groups) that QSettings offers. We have so many broken code
that fakes it by having a 'NumGroups=x' entry with '[Group_1]' '[Group_2]' groups.
That's really something the framework should offer!
Ciao,
Tobias
--
Separate politics from religion and economy!
The Council of the European Union is an undemocratic and illegal institution!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070227/282f10e7/attachment.sig>
More information about the kde-core-devel
mailing list