Bug 427654 - custom-styles are erased on save
Summary: custom-styles are erased on save
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.75.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-13 19:36 UTC by Juraj
Modified: 2020-10-17 13:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.76.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juraj 2020-10-13 19:36:59 UTC
SUMMARY
The custom styles are erased on save of the dialog.

STEPS TO REPRODUCE
1. Use new version of this thing
2. Open kate/kdevelop and color settings
3. Import same theme with multiple! (for multiple languages) custom styles (if not already present)
4. Set the theme as default and save the changes
5. Check the file for systax

OBSERVED RESULT
All styles apart from currently viewed one were removed in kate and probably everything in kdevelop.

EXPECTED RESULT
Dont touch my custom styles when not asked to.

SOFTWARE/OS VERSIONS
Operating System: Artix Linux
KDE Plasma Version: 5.20.0
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Kernel Version: 5.8.14-artix1-1
OS Type: 64-bit
Processors: 12 × AMD Ryzen 5 3600XT 6-Core Processor
Memory: 31,4 GiB of RAM
Graphics Processor: Radeon RX 570 Series

ADDITIONAL INFORMATION
For these production tests I used my script to convert my old theme to new format and imported it.
On import the current theme in editor changed to it immediately but not the one in the dialog box.
SO I changed it to my theme, I set it as default and pressed Apply (or OK?)
Than I went mad that my changes which I sepnt my sweat and blood to keep were gone and the theme file was almost empty.

By copying the full file to right place everything works fine unless I try to change some color in settings.

And here I hoped it will work just fine.
Comment 1 Christoph Cullmann 2020-10-13 20:02:54 UTC
Hi,

I might misunderstand the bug.

Do I understand correctly:

1) You import some theme, let's name it "A".
2) You set it as the default
3) You apply that by say "OK"

=> The custom styles in theme "A" vanish?

Was there before some theme called "A" already?
Comment 2 Juraj 2020-10-13 20:14:49 UTC
On second thought, all what is needed is probably to select theme with custom styles as default and save.
Before I described my exact steps how I did it.

We can forget about importing, lets say you have theme with multiple custom styles for multiple languages and press save or ok when you set it as default.
It should erase all custom styles, at most keep the currently selected one.
Comment 3 Christoph Cullmann 2020-10-13 20:36:12 UTC
Ok, then I guess I see my fault :(
Comment 4 Juraj 2020-10-13 20:47:29 UTC
(In reply to Christoph Cullmann from comment #3)
> Ok, then I guess I see my fault :(

Even I did not test it so deeply when I was working on converter.
Comment 5 Christoph Cullmann 2020-10-15 13:23:02 UTC
Git commit d80782ebd1d4d92b8ef9fa1593eb93a4c052f3a4 by Christoph Cullmann.
Committed on 15/10/2020 at 13:22.
Pushed by cullmann into branch 'master'.

try to avoid to erase custom-styles for highlightings we didn't touch at all

M  +10   -5    src/syntax/katethemeconfig.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/d80782ebd1d4d92b8ef9fa1593eb93a4c052f3a4
Comment 6 Christoph Cullmann 2020-10-15 13:23:32 UTC
Could you try the patch I commited?
I am at the moment bit short on time here, it did compile and shall not make it worse, thought have not tried that out a lot.
Comment 7 Christoph Cullmann 2020-10-17 13:21:48 UTC
I tested this here now, seems to work fine for me with this patch.