KATE: the interface, once again

Roland Krause rokrau at yahoo.com
Thu Jun 21 00:01:36 UTC 2001


regarding Kate::View and Kate::Document, how can we guarantee
that there is a valid document for each view?

The reason I ask is, that we have fixed at least a dozen bugs at
places where there is a view but it doesnt have a document
anymore, i.e. the pointer has become invalid. 

So, in this iteration I would like to avoid this alltogether - the
question is, how.

One possibility would be to change the Kate::View method
getDoc() to return a reference to an object instead of a
pointer. Additionally, I believe we should completely prevent
that a view can be constructed without a document, so  the
Kate::View constructor should also take a reference to a
KTextEditor::Document instead of a pointer.

Possibly this will cause a lot of internal changes, and we can
still not make completely sure that the referenced object is
not simply deleted w/o the view knowing about it. I am a firm 
believer, that this is the reason auto_ptr was invented :9)

Another problem, neither Kate::Document nor Kate::View
implements save() or saveAs(), but we need that of course. 

I went ahead and changed the interface, in which form do you want
the patch?

Also, why didnt you make Kate::View and Kate::Document pure
virtual? I am just curious, was there any particular reason for this?


Roland Krause
In the garage of life there are mechanics and 
there are drivers. Mechanics wanted!

Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail

to unsubscribe from this list send an email to kdevelop-devel-request at kdevelop.org with the following body:
unsubscribe »your-email-address«

More information about the KDevelop-devel mailing list