From ktexteditor-devel Fri Sep 01 21:32:08 2006 From: Andras Mantia Date: Fri, 01 Sep 2006 21:32:08 +0000 To: ktexteditor-devel Subject: EncodingInterface::setEncoding in 3.5.x Message-Id: <200609020032.14615.amantia () kde ! org> X-MARC-Message: https://marc.info/?l=ktexteditor-devel&m=115714668209945 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0900582492==" --===============0900582492== Content-Type: multipart/signed; boundary="nextPart2634289.JCrK4uyxx3"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2634289.JCrK4uyxx3 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, if one calls EncodingInterface::setEncoding, it will issues a=20 close/openURL, which asks for saving the document before closing. This=20 is bad, as if I don't want to use the saveAs action provided by the=20 part, because I want a more extended one, and I try to save a document=20 with save as and to have the new document in a new encoding, I will get=20 the following: =2D a dialog asking if I want to save before close (remember it was a Save= =20 As action, nothing about closing) =2D if I answer yes, the *original* document will be overwritten as well =2D if I answer discard, the new document won't have my last changes Basicly it's impossible to save under new name. I could also see data=20 loss in the original document for some reason (the content got screwed=20 up).=20 I found no easy way to workaround from outside, so I think the problem=20 needs to be solved inside the part. Namely, setEncoding shouldn't close=20 the document and reopen it. If the only way to use a new document is=20 when you open it, than a solution would be using a temporary file to=20 load the changed (with the new encoding) document from. To reproduce, try Quanta until 3.5.4, open a file, modify and try to=20 save as. The bug is partly visible in Kate/Kwrite as well, if you=20 switch the encoding for a modified document. Save As is not affected=20 there because they use the saveAs from the part and there the encoding=20 changing is different as the code has access to the part's internal=20 KateConfig object. Andras =2D-=20 Quanta Plus developer - http://quanta.kdewebdev.org K Desktop Environment - http://www.kde.org --nextPart2634289.JCrK4uyxx3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBE+KbeTQdfac6L/08RAn+mAJ9WlCQUC7Vqb8sxoAa/11Cun+nTeQCfem7B P+Nj9rAlDzzZK+PB5UCxPgA= =jrdq -----END PGP SIGNATURE----- --nextPart2634289.JCrK4uyxx3-- --===============0900582492== 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 --===============0900582492==--