From ktexteditor-devel Wed Jun 08 23:32:29 2005 From: Matt Rogers Date: Wed, 08 Jun 2005 23:32:29 +0000 To: ktexteditor-devel Subject: Re: Global Editor object, factory Message-Id: <200506081832.30054.mattr () kde ! org> X-MARC-Message: https://marc.info/?l=ktexteditor-devel&m=111827359327713 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1109462133==" --===============1109462133== Content-Type: multipart/signed; boundary="nextPart1561017.5XigWXX2rx"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1561017.5XigWXX2rx Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 08 June 2005 04:19 pm, Christoph Cullmann wrote: > hi, > as for some tasks, like config managment, command registration, document > lists and so on, the KTextEditor::Document/View's would need one global > object, and my first plan to use the factory for this fails, as: > > 1) factories get's deleted automagic by klibloader and that's not nice at > app shutdown if still docs exists 2) kate and yzis internal singleton > doesn't want such "hey, you will die now" stuff ;) > > here I propose a new way ;) > > 1) we add KTextEditor::Factory : public KParts::Factory > in addition to normal factory, it has a method to query the global > editor object, which will stay alive at least as long as the factory itself > + any remaining document/view (or even for eternity) > > 2) we add KTextEditor::Editor : public QObject > this should be the baseclass for the global editor object of the part, > the document get's access for it, the editor object itself provides > methodes to create KTextEditor::Document's and to provide a document list, > additional, the config stuff is moved to this class, and we can provide > interfaces for it, too > > This way we would have some safe global Editor object, and it would be > still possible to load several different editor components in the same > process. I would prefer that Factory and global object would be the same, > but this would cause the above mentioned probs, see no real way to avoid > this, as the factory will be deleted, and this will kill everything, and > even if not, you could create 2 factory objects, which would be no good > idea, too, if it is the global object, this way, the part can construct the > global object itself in secret, and the apps only access it, which looks > more safe > > cu > Christoph Seems sane enough, I suppose. Matt --nextPart1561017.5XigWXX2rx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBCp4AOA6Vv5rghv0cRAvzjAJ4uZNTJHAbRTOU8A4XoF+9YqiynTQCdEn2H bfhxisWuLiYKxne0PW4L5g4= =Yite -----END PGP SIGNATURE----- --nextPart1561017.5XigWXX2rx-- --===============1109462133== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Ktexteditor-devel mailing list Ktexteditor-devel@kde.org https://mail.kde.org/mailman/listinfo/ktexteditor-devel --===============1109462133==--