Bug 307107 - (Kate 3.8.5) does not save and reflect disabling background color settings for highlighting
Summary: (Kate 3.8.5) does not save and reflect disabling background color settings fo...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 340032 355615 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-20 15:11 UTC by Torsten Eichstädt
Modified: 2016-05-28 12:36 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch to fix comparison of signed/unsigned (1.74 KB, patch)
2012-09-28 12:59 UTC, Torsten Eichstädt
Details
test_syntax.pl (1.96 KB, application/x-perl)
2012-11-14 18:42 UTC, Torsten Eichstädt
Details
prolog-iso.xml.zip (15.19 KB, application/zip)
2012-11-14 18:42 UTC, Torsten Eichstädt
Details
Proposed fix (2.65 KB, patch)
2015-10-28 17:28 UTC, Oleksandr Senkovych
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Eichstädt 2012-09-20 15:11:35 UTC
When I e.g. disable the background color of alerts, the changes are 
1st: not applied immediately and
2nd: not saved so I can not get rid of the old settings
(That's very annoying!)

Reproducible: Always

Steps to Reproduce:
1. Settings|Configure Kate...|Fonts & Colors|Styles for Markups|Others/Alerts (any other as well)
2. Disable background color for an item that has one
3. Click Apply and OK
Actual Results:  
The change I made is not applied to the text and the next time I start Kate the old setting is still active.

Expected Results:  
Any changes in the settings, be it color or whatever else, should be immediately applied to the program and it's data (the text I'm editing) when the user clicks "Apply" and be saved on disk
latest when the program quits.
Nice to have would be a log of changes so one could go back to previous settings.
Comment 1 Dominik Haumann 2012-09-20 18:58:28 UTC
Hi Torsten. Can you please build Kate by following http://kate-editor.org/get-it/ and test, whether this is already fixed? This would be a huge help. Alternatively, try KDE 4.9.x.
Comment 2 Torsten Eichstädt 2012-09-28 12:59:32 UTC
Created attachment 74209 [details]
patch to fix comparison of signed/unsigned

The 1st two affect local vars => IMHO save but the 3rd needs review by s/o who is "in" the source code!!!
Comment 3 Dominik Haumann 2012-10-24 21:49:34 UTC
Hi Torsten: Question remains: Can you confirm this is fixed now, or is the initial issue still there?

PS: The patch is somehow unrelated...
Comment 4 Torsten Eichstädt 2012-10-25 09:35:00 UTC
Hi Dominik,

no, it isn't fixed neither in the version I compiled from git nor in the update I got from KDE SC 4.9 via kubuntu backports-ppa later (the two versions look the same).
Settings handling is improved, but still somewhat buggy :/
I found out that there are problems with string handling for saved settings.  I had unusual names for <item datas> in my syntax file - with backslash and spaces - that could not not be written and read back correctly in the cache and settings files.  Maybe that's related.  The settings are spread over _various_ cache and ini files.  From my experience I can say that after some time of programming such a module I have a gordic knot between my ears and make mistakes...
Comment 5 Christoph Cullmann 2012-11-03 14:42:16 UTC
Created attachment 75266 [details]
test_syntax.pl

I rewrote most parts of that code yesterday and if I try your steps from the first comment, it is saved well, too.

And yeah, the stuff is split mostly in two files: kateschemarc for the base colors and font, katesyntaxhighlightingrc for the highlighting colors (default + specialized).

Could you retry? (The unsigned/signed stuff is fixed, too, beside the on in kateviewinternal, that needs one look more ;)
Comment 6 Torsten Eichstädt 2012-11-14 18:42:05 UTC
I downloaded and installed from git like described on the Kate web page.
Unfortunately, the bug is still there :(
Steps to reproduce:
0. Have the ISO-Prolog syntax file (prolog-iso.xml) installed in your 
~/.kde/share/apps/katepart/syntax folder.
1. load the test syntax file
2. Open the fonts & colors settings
3. Disable the background color and selected background color of "ISO Bogus"
   (Right mouse click on the color field)
4. Click "Apply"

Status Quo: The background colors come back.

I deleted the "Prolog (ISO)" settings in 
~/.kde/share/config/katesysntaxhighlightingrc before testing.

To say it with Melody: "Who Will Comfort Me?"...
http://www.youtube.com/watch?v=SntJNLeHNS0

Have a nice day and smile,  =|o)

Am Samstag, 3. November 2012, 14:42:16 schrieben Sie:
> https://bugs.kde.org/show_bug.cgi?id=307107
> 
> Christoph Cullmann <cullmann@kde.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
> Status|UNCONFIRMED                 |NEEDSINFO
>                  CC|                            |cullmann@kde.org
>          Resolution|---                         |WAITINGFORINFO
> 
> --- Comment #5 from Christoph Cullmann <cullmann@kde.org> ---
> I rewrote most parts of that code yesterday and if I try your steps from the
> first comment, it is saved well, too.
> 
> And yeah, the stuff is split mostly in two files: kateschemarc for the base
> colors and font, katesyntaxhighlightingrc for the highlighting colors
> (default + specialized).
> 
> Could you retry? (The unsigned/signed stuff is fixed, too, beside the on in
> kateviewinternal, that needs one look more ;)
Comment 7 Torsten Eichstädt 2012-11-14 18:42:07 UTC
Created attachment 75267 [details]
prolog-iso.xml.zip
Comment 8 Oleksandr Senkovych 2015-10-28 17:28:19 UTC
Created attachment 95183 [details]
Proposed fix

So I think I've found the error and attaching the patch to fix it.
The most proper way to fix this  should be renaming enums to enum-classes (C++11 feature) but I suppose it will break some other projects that use ktexteditor api, so I just added type specifier.
Comment 9 Oleksandr Senkovych 2015-10-28 17:50:37 UTC
(In reply to Oleksandr Senkovych from comment #8)
> Created attachment 95183 [details]
> Proposed fix
> 
> So I think I've found the error and attaching the patch to fix it.
> The most proper way to fix this  should be renaming enums to enum-classes
> (C++11 feature) but I suppose it will break some other projects that use
> ktexteditor api, so I just added type specifier.

Oops, sorry, this patch doesn't fix all problem places. Added a new one to phabricator: https://phabricator.kde.org/D457
Comment 10 Kevin Funk 2015-10-29 10:19:25 UTC
Fixed in ktexteditor.git:

commit 4e1fb2a5f1c74510c1a1e1ab91260735c1df21bf
Author: Oleksandr Senkovych <bjsenya@gmail.com>
Date:   Thu Oct 29 11:14:07 2015 +0100

    Fix bug #307107
    
    (Kate does not save and reflect disabling background color settings for highlighting)
    
    Summary: Naming issue: enum items from KateStyleTreeWidgetItem::columns had same names as CustomProperties and were used for getting text attribute properties.
    
    Test Plan: Successfully saved background color settings after applying a patch
    
    Differential Revision: https://phabricator.kde.org/D457
Comment 11 Dominik Haumann 2016-05-28 12:36:41 UTC
*** Bug 355615 has been marked as a duplicate of this bug. ***
Comment 12 Dominik Haumann 2016-05-28 12:36:58 UTC
*** Bug 340032 has been marked as a duplicate of this bug. ***