Porting problems with KMainWindow::readProperties()

Tobias Koenig tokoe at kde.org
Sat Feb 24 02:32:44 GMT 2007


On Fri, Feb 23, 2007 at 09:18:15PM +0100, David Faure wrote:
> On Friday 23 February 2007, Aaron J. Seigo wrote:
Hi,

> > i think this is the other side of the bug being discussed in the "Re: 
> > kmainwindow settings group (Re: KDE/kdelibs/kparts)" thread. i don't see any 
> > resolution/conclusion yet, but between coolo and dfaure one can only hope =)
> 
> No this is completely orthogonal to apply/saveMainWindowSettings.
> 
> readProperties is called by KMainWindow in the first place, so the group is known.
> The apps should just honour it IMHO.

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");
  }
?

That looks really strange... passing just a group here when the
application needs the whole config object to access also other groups
is really pointless IMHO. We should pass the KConfig* object here...

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/20070224/ef6097ad/attachment.sig>


More information about the kde-core-devel mailing list