[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ktexteditor-devel
Subject:    EncodingInterface::setEncoding in 3.5.x
From:       Andras Mantia <amantia () kde ! org>
Date:       2006-09-01 21:32:08
Message-ID: 200609020032.14615.amantia () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hi,

 if one calls EncodingInterface::setEncoding, it will issues a 
close/openURL, which asks for saving the document before closing. This 
is bad, as if I don't want to use the saveAs action provided by the 
part, because I want a more extended one, and I try to save a document 
with save as and to have the new document in a new encoding, I will get 
the following:
- a dialog asking if I want to save before close (remember it was a Save 
As action, nothing about closing)
- if I answer yes, the *original* document will be overwritten as well
- 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 
loss in the original document for some reason (the content got screwed 
up). 

I found no easy way to workaround from outside, so I think the problem 
needs to be solved inside the part. Namely, setEncoding shouldn't close 
the document and reopen it. If the only way to use a new document is 
when you open it, than a solution would be using a temporary file to 
load the changed (with the new encoding) document from.

To reproduce, try Quanta until 3.5.4, open a file, modify and try to 
save as. The bug is partly visible in Kate/Kwrite as well, if you 
switch the encoding for a modified document. Save As is not affected 
there because they use the saveAs from the part and there the encoding 
changing is different as the code has access to the part's internal 
KateConfig object.

Andras

-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org

[Attachment #5 (application/pgp-signature)]

_______________________________________________
KTextEditor-Devel mailing list
KTextEditor-Devel@kde.org
https://mail.kde.org/mailman/listinfo/ktexteditor-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic