Bug 322797 - kde-gtk-config doesn't keep the unsupported configuration
Summary: kde-gtk-config doesn't keep the unsupported configuration
Status: RESOLVED FIXED
Alias: None
Product: kde-gtk-config
Classification: Plasma
Component: general (show other bugs)
Version: 2.2.1
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Manuel Tortosa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-25 00:48 UTC by Weng Xuetian
Modified: 2019-08-24 13:06 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.17.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Weng Xuetian 2013-07-25 00:48:26 UTC
There are some options which is not supported by kde-gtk-config, but people can change them manually in ~/.config/gtk-3.0/settings.ini . But if someone try to use kde-gtk-config again, it will not write those configuration into new settings.ini

Reproducible: Always

Steps to Reproduce:
1. add gtk-enable-primary-paste=1 to ~/.config/gtk-3.0/settings.ini
2. make some change in kde-gtk-config and apply
Actual Results:  
gtk-enable-primary-paste=1 will be removed.

Expected Results:  
gtk-enable-primary-paste=1 will still be there.
Comment 1 Yichao Yu 2013-07-25 00:56:12 UTC
The same thing happens to gtk2 settings as well. Other gtk2 theme switchers, e.g. gtk-chtheme and gtk-theme-switch2, usually support user gtk2rc file (sth like include ~/.gtkrc-2.0.mine). I am not sure if the same thing can be done for gtk3 settings file as well, but it will be better if it is possible to specify user defined additional configure file (at least for gtk2).
Comment 2 Aleix Pol 2013-07-29 11:18:31 UTC
That does happen, I'm setting it as a wish, although I don't really have the time to work on this at the moment.

I guess that having a separate ini file would be indeed the way to go, if somebody is interested I'll be happy to review the changes.
Comment 3 Nate Graham 2019-08-24 13:06:54 UTC
Git commit a9f3a3ddcb0b197f96b750323201da438f15c4ad by Nate Graham, on behalf of Mikhail Zolotukhin.
Committed on 24/08/2019 at 13:06.
Pushed by ngraham into branch 'master'.

Keep existing configurations' strings               

Summary:
Gtk configurator has been replacing .gtkrc-2.0 config file with it's own settings, discarding present file contents. Now it only modifies configuration strings, or add them if they are not present at the beginning of the file.

This patch also removes redundant configurations, such as including theme from /usr/share/themes gtkrc's, "user-font" style, widget_class and unneeded symlink .gtkrc-2.0-kde4. Those options do not seem needed, as gtk2 applications look the same without these options without any regressions. This was tested on Gimp, Inkscape and BleachBit apps on Manjaro, OpenSUSE and KDE Neon distributions.

As for gtk3 ini file - this is not reproducible anymore, any line, which does not hold parameter changeable in configurator, remains in settings.ini.
Related: bug 354963, bug 342320
FIXED-IN: 5.17.0

Test Plan:
Insert some lines in .gtkrc-2.0 file, that do not represent settings, that configurator changes, check if they are still present after applying new settings.

Check if gtk2 apps look identical with or without .gtkrc-2.0-kde4 symlink, with or without similar lines in .gtrkrc-2.0:

```
include "/usr/share/themes/Breeze/gtk-2.0/gtkrc"
style "user-font"
{
	font_name="Noto Sans Regular"
}
widget_class "*" style "user-font"

```

Reviewers: apol, #plasma

Reviewed By: apol

Subscribers: GB_2, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D21524

M  +52   -51   src/appearancegtk2.cpp
M  +2    -0    src/appearancegtk2.h

https://commits.kde.org/kde-gtk-config/a9f3a3ddcb0b197f96b750323201da438f15c4ad