Bug 405563 - Don't create config files for versions of GTK that aren't installed
Summary: Don't create config files for versions of GTK that aren't installed
Status: RESOLVED INTENTIONAL
Alias: None
Product: kde-gtk-config
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: 5.15.3
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Manuel Tortosa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-17 13:04 UTC by foss
Modified: 2019-03-18 16:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description foss 2019-03-17 13:04:55 UTC
SUMMARY
GTK[n] is not installed, so no need to create the config file(s) for it.    
In this case, gtk2 is not installed, but ~/.gtkrc-2.0 , ~/.gtkrc-2.0-kde4 and ~/.config/gtkrc-2.0 are beieng created. Considering GTK4 is in development and more apps/desktops (xfce,lxde...) are moving or moved already to GTK3, GTK2 will be less relevant but that is another story.    
Am just requesting to make it optional and/or select which GTK version 2/3/4... a config file will be created.  

STEPS TO REPRODUCE
1. Well, one would need a "GTK2 free system"
2. 
3. 

OBSERVED RESULT
The mentioned config files are created

EXPECTED RESULT
Create config file(s) only for installed GTK versions.

SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.56.1
Qt Version: 5.12.2

ADDITIONAL INFORMATION
Comment 1 Aleix Pol 2019-03-17 13:48:20 UTC
Arguably a system without GTK wouldn't have the KCM installed, would it?
Comment 2 foss 2019-03-17 14:11:52 UTC
(In reply to Aleix Pol from comment #1)
> Arguably a system without GTK wouldn't have the KCM installed, would it?

It would, but not necessarily GTK2, I have GTK3 installed and am using GTK3 applications. My request, sorry if that wasn't clear, is to create the config files only for GTK versions installed on the system (let's say GTK3 and GTK4).    
I am hoping for a flexible choice in the KCM, e.g autodetect what GTK versions are installed and offer only those detected in the KCM, or some kind of checkbox/multi choice (don't know the technical term for it), where a user checks the desired GTK version. Or what you see fits.
Comment 3 Aleix Pol 2019-03-18 15:04:06 UTC
There's no way of knowing if there's a GTK2 app. It could be in an appimage.

And even in the traditional case, we want to cater to the prospect installation of applications. Otherwise the user would need to open the kcm and force write so the kcm could check whether there's gtk2 installed.
Comment 4 foss 2019-03-18 15:51:57 UTC
(In reply to Aleix Pol from comment #3)

If GTK2 is installed then in most cases as a dependency of other app(s), in other words, if there is GTK2, there is also a GTK2 app.    
My experience with appimage (inkscape), flatpak (libreoffice),.. is that they (apps) tend to use their own theme anyway and ignore user setting (Wayland session). GTK2 here is an example, in future it can be GTK3. I think opening the kcm and applying the changes is "very normal" :-)
Comment 5 Nate Graham 2019-03-18 15:56:49 UTC
(In reply to udevnull from comment #4)
> (In reply to Aleix Pol from comment #3)
> 
> If GTK2 is installed then in most cases as a dependency of other app(s), in
> other words, if there is GTK2, there is also a GTK2 app.    
> My experience with appimage (inkscape), flatpak (libreoffice),.. is that
> they (apps) tend to use their own theme anyway and ignore user setting
> (Wayland session). GTK2 here is an example, in future it can be GTK3. I
> think opening the kcm and applying the changes is "very normal" :-)

As Aleix mentioned, you could be using an AppImage app that bundles GTK2, so you could be using GTK2 without realizing it and without it being installed via your package manager.
Comment 6 foss 2019-03-18 16:23:28 UTC
I understand you Nate & Aleix, they dont use system libraries,.. bundle everything. In oder not to "break" stuff in case one uses gtk2/3/.. without knowing it, I would suggest a setting/checkbox by default switched on, so that we are on the safe side and can be unchecked by those who like to disable it. Do you think that is possible/feasible/should I forget it?
Comment 7 Nate Graham 2019-03-18 16:53:48 UTC
I think it's unlikely to be implemented. This level of specificity generally isn't very helpful to most users, and actually becomes an annoyance to most of them. It seems like a lot of potentially fragile code to add for the strong possibility of irritating most of our users. :)