[Kde-pim] I'm new and I have a patch [update]

David Faure faure at kde.org
Tue Feb 5 09:16:45 GMT 2008


On Monday 04 February 2008, Till Adam wrote:
> On Monday 04 February 2008 19:22:43 David Faure wrote:
> > On Monday 04 February 2008, Mischael Schill wrote:
> > > Am Montag 04 Februar 2008 14:23:53 schrieb David Faure:
> > > > On Saturday 02 February 2008, Mischael Schill wrote:
> > > > > Hello again
> > > > > I updated my patch using QSize instead of two int's and
> > > > > making the saveSize()-Slot private.
> > > >
> > > > This should use KDialog::saveDialogSize and
> > > > KDialog::restoreDialogSize instead.
> > >
> > > Thanks for the advice. Here's the new patch.
> >
> > I expected the code to become much shorter :)
> >
> > > +  KSharedConfigPtr config = KSharedConfig::openConfig();
> > > +  KConfigGroup group(config, "AboutDialog");
> > > +  restoreDialogSize(group);
> >
> > restoreDialogSize(KConfigGroup(KGlobal::config(), "AboutDialog"));
> > or
> > KConfigGroup group(KGlobal::config(), "AboutDialog");
> > restoreDialogSize(group);
> > if the first solution doesn't compile.
> >
> > +void AboutDialog::saveSize()
> > +{
> > +  KSharedConfigPtr config = KSharedConfig::openConfig();
> > +  KConfigGroup group(config, "AboutDialog");
> > +  saveDialogSize(group);
> > Same here.
> >
> > +  group.sync();
> > +  config->sync();
> > That's belt and suspenders :) One sync call is enough (I would choose
> > group.sync()).
> 
> 
> Does the sync make sense at all, here? Given that this is during application 
> close.

You're right, it's quite pointless (and slow) here.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list