On Friday, January 15, 2016 9:46:00 AM EST Boudewijn Rempt wrote:
> I noticed that krita on windows wrote its kritarc to Roaming\local\ or
> Local\local instead of Roaming\krita\kritarc, and I was wondering why that
> was. I now think it's because KConfig's default is to write to
> GenericConfigLocation instead of ConfigLocation.
> 
> Is that really intended to be the default for kconfig? I guess it's wrong
> for pretty much 100% of applications that use kconfig, because pretty much
> every application should write its config to ConfigLocation instead.
> 
> There are a couple of hundred places in Krita where a config object is
> retrieved and before I start adapting all those by adding two extra
> parameter (or writing a wrapper around kconfig, or something else...) I'd
> like to know why GenericConfigLocation is the default :-)
It appears this is the desired behaviour.  On most platforms, 
GenericConfigLocation and ConfigLocation are the same things, except Windows.  
According to Qt's history, ConfigLocation was supposed to act like 
GenericConfigLocation, but a mistake was made and GenericConfigLocation was 
introduced to fix that without breaking existing applications.  See commit 
44d48862c0ff4b67a76734deae5e76f926a77bce .

KConfig was then changed to use GenericConfigLocation as well, see commit 
b3487a0684fa464ada0cd3407e96d0406345a42a in kdelibs (this happened before the 
split).  On all platforms except Windows, that is how KConfig has all behaved.  
Even in KDE4, config files were often put in the same directory, just not a 
standard directory shared by the platform.

Based on the commit history, I'd say it makes sense.  Anything else would 
yield platform inconsistent behaviour, which is more likely to confuse people.  
If ConfigLocation wasn't inconsistent across platforms, that would be a 
different story.

Regardless, changing the default behaviour now is a no go, as that would break 
everyone's setup.  However, I wouldn't be opposed to a method to allow KConfig 
to easily store config files in an application appropriate folder.  It 
couldn't break existing applications though.  I also don't think most things 
should need it anyways, since most applications only have one config file.  
Something like akonadi (which already uses a subfolder in my .config) makes 
sense, and I could see it making sense for Krita.  Maybe some way to use 
AppConfigLocation?  We'd have to be careful with that though, since it's 
>=5.5.
-- 
Matthew

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel

Reply via email to