Summary: | Setting encoding from .kateconfig doesn't fully work | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Niels <niels.misc> |
Component: | encoding | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | christoph, cyberbeat |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kate/902ce49204de1035910cc504e249fd0eacf64471 | Version Fixed In: | |
Sentry Crash Report: |
Description
Niels
2006-04-20 21:01:08 UTC
Yes, this would be a katepart bug. KDevelop doesn't read the .kateconfig file, katepart does and the menu action is merged in by katepart. Reassigning. Kate sets the encoding after loading the file, but it doesn't reload the file with the right encoding. Still valid in KDE4. related bug for kate modelines: bug #125974 related bug for kate modelines: bug #187033 (comment #8 is wrong number) related bug for modes/filetypes: bug #159135 *** Bug 202409 has been marked as a duplicate of this bug. *** Please, please please someone have a look at this. This bug exists for years now, and I think will be easy to fix for someone who has good knowledge of the kate code. I fixed this bug successfully for the kde3 version, see http://reviewboard.kde.org/r/1915/ but when I apply the same bugfix strategy for the kde4-version, it works (and I really patch every new kate-package in my opensuse installation with my fix), but not completely (the menubar-entry is not updated), and I could not figure out, how to fix that. I have so many projects with different encoding, and this feature really helps me much to not mess up my files in different directory trees. here is my actual diff, that I apply regularly for me: Index: document/katedocument.cpp =================================================================== --- document/katedocument.cpp (Revision 1150298) +++ document/katedocument.cpp (Arbeitskopie) @@ -2070,6 +2070,11 @@ history()->doEdit( new KateEditInfo(Kate::CloseFileEdit, documentRange(), QStringList(), KTextEditor::Range(0,0,0,0), QStringList()) ); emit KTextEditor::Document::textRemoved(this, documentRange()); + + // read dir config (if possible and wanted) + if (!m_reloading) + readDirConfig (); + bool success = m_buffer->openFile (localFilePath()); // disable view updates @@ -2087,9 +2092,6 @@ // update file type updateFileType (KateGlobal::self()->modeManager()->fileType (this)); - // read dir config (if possible and wanted) - readDirConfig (); - // read vars readVariables(); could you please please fix this bug? Sorry, but just applying your patch won't cut it, as then we have no longer the filetype => dir config => variables levels. btw I have a review request pending here: https://git.reviewboard.kde.org/r/106420 How do you think can this problem be solved? I am willing to invest some more work, if you could explain me how I should do it right. Git commit 902ce49204de1035910cc504e249fd0eacf64471 by Christoph Cullmann. Committed on 01/11/2012 at 18:23. Pushed by cullmann into branch 'master'. add encoding: xxxx modeline change order of reading of variables that it can have effects for load/save for .kateconfig and on save for variable in the file itself REVIEW: 106420 needed more modifications than in review request 106420, otherwise we regress M +8 -0 doc/kate/configuring.docbook M +33 -24 part/document/katedocument.cpp M +10 -2 part/mode/katemodemanager.cpp M +1 -1 part/mode/katemodemanager.h http://commits.kde.org/kate/902ce49204de1035910cc504e249fd0eacf64471 I am sorry your review request got not action that long. I look at it and fixed the remaining problems myself. Thanks for the contribution, btw.! thank you very much! You just made my day! |