From koffice-devel Mon Sep 20 13:29:37 2004 From: David Faure Date: Mon, 20 Sep 2004 13:29:37 +0000 To: koffice-devel Subject: Re: [patch] initDoc in koffice/example usage Message-Id: <200409201529.37539.faure () kde ! org> X-MARC-Message: https://marc.info/?l=koffice-devel&m=109568690221216 On Saturday 18 September 2004 14:18, Brad Hards wrote: > On Fri, 17 Sep 2004 22:37 pm, David Faure wrote: > > While you're at it, please make sure InitDocEmpty is handled, and > > parentWidget is passed to KoTemplateChooseDia::choose() :) > Like this? > > diff -u -4 -p -r1.19 example_part.cc > --- example_part.cc 12 Sep 2004 11:53:55 -0000 1.19 > +++ example_part.cc 18 Sep 2004 12:14:40 -0000 > @@ -33,16 +33,25 @@ bool ExamplePart::initDoc(InitDocFlags f > { > // If nothing is loaded, do initialize here > // Most KOffice applications use the template dialog here, with code like: > /* > + if (flags==KoDocument::InitDocEmpty) > + { > + bool ok = loadNativeFormat( /* QString containing path to a sensible default template */ ); If a template is needed - that's not necessarily the case. > + resetURL(); > + setEmpty(); > + setModified( FALSE ); > + return ok; > + } > + > KoTemplateChooseDia::DialogType dlgtype; > - if (initDocFlags() != KoDocument::InitDocFileNew ) > + if (flags != KoDocument::InitDocFileNew ) > dlgtype = KoTemplateChooseDia::Everything; > else > dlgtype = KoTemplateChooseDia::OnlyTemplates; > > - KoTemplateChooseDia::ReturnType ret = KoTemplateChooseDia::choose( > - .... ) > + // You need to read the doco for KoTemplateChooseDia::choose() to figure out what to do next :-) > + KoTemplateChooseDia::ReturnType ret = KoTemplateChooseDia::choose(...., dlgtype, ... , parentWidget ); OK. (doco? strange word, I usually say docu :) -- David Faure, faure@kde.org, sponsored by Trolltech to work on KDE, Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org). _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org https://mail.kde.org/mailman/listinfo/koffice-devel