[Qt-creator] "Editing not possible" solution

Pawel pawelfaron87 at wp.pl
Tue Jan 20 23:48:44 CET 2015


Hello,

In my company we work in multinational teams. Many people uses strange  
file encodings and they don't plan to change it...
In QtCreator I quite often see the "Editing not possible" error. I know  
that file decoding is a difficult subject, but I'm sure we can do better  
than this.

I've implemented simple code to help a bit. It is located in  
textdocument.cpp, and differs from current solution with:

- [Current solution] In functions read() when decoding with default codec  
fails we return error.
- [My Solution] In functions read() when decoding with default codec fails  
I try all available codecs (QTextCodec::availableCodecs()), and if any one  
success I return success.

What do you think about this?

Full code can be reviewed here:
https://codereview.qt-project.org/#/c/104124/

best regards
Pawel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20150120/73aaefbd/attachment.html>


More information about the Qt-creator mailing list