Reload documents in 'KateDocument::setEncoding' already

Review Request #105978 - Created Aug. 11, 2012 and discarded

Michel Ludwig
The document should be reloaded in 'KateDocument::setEncoding' when the encoding is changed. Currently, this is only done in 'KateViewEncodingAction::setEncoding'.

As a consequence, the text may be rendered in the view using the wrong encoding even if the encoding is changed in 'KateDocument::readParameterizedSessionConfig'.

Also see bug #304853 (note that Kile should also be fixed in the sense that documents should be opened with the right encoding from the start, i.e. there should be no need to reload them).

Michel Ludwig
Michel Ludwig
Michel Ludwig
Review request changed

Status: Discarded

Change Summary:

Ok, after reading the semantics of 'setEncoding' again, I think the problem lies with Kile after all.

Sorry for the noise!
Christoph Cullmann
Hi, its not that easy.
setEncoding is called e.g. by the buffer, too, after loading, and there you don't want any reload, else we load all files twice.
And other places behave same like that.
(for example the save as with different encoding will do setEncoding, too, but there a reload isn't a good idea neither)
If we want that, we need an extra API to set encoding and load, or you set it and then trigger reload yourself.