Review Request 125598: Allow KConfig to use resources as fallback config files

Christoph Cullmann cullmann at kde.org
Mon Oct 12 21:06:23 UTC 2015



> On Oct. 12, 2015, 9:02 p.m., Milian Wolff wrote:
> > in principle, I'm cool with that change, but why do you need to ship a default file anyways?
> > 
> > KConfig is always used in the form
> > 
> >     ...read("value", default)
> > 
> > so the defaults are hardcoded there already. Why ship another default config file in ini format?

Because we ship not single default values but e.g. stuff like the default color schemes with that:


# Normal Schema, NEEDED
[Normal]
ShippedDefaultSchema=9999
Color Background=255,255,255
Color Code Folding=148,202,239
Color Highlighted Bracket=255,255,0
Color Highlighted Line=248,247,246
Color Icon Bar=240,240,240
Color Indentation Line=210,210,210
Color Line Number=160,160,160
Color Current Line Number=30,30,30
Color MarkType 1=0,0,255
Color MarkType 2=255,0,0
Color MarkType 3=255,255,0
Color MarkType 4=255,0,255
Color MarkType 5=160,160,164
Color MarkType 6=0,255,0
Color MarkType 7=255,0,0
Color Modified Lines=253,188,75
Color Replace Highlight=0,255,0
Color Saved Lines=46,204,113
Color Search Highlight=255,255,0
Color Selection=148,202,239
Color Separator=137,136,135
Color Spelling Mistake Line=191,3,3
Color Tab Marker=210,210,210
Color Template Background=214,210,208
Color Template Editable Placeholder=186,248,206
Color Template Focused Editable Placeholder=118,218,152
Color Template Not Editable Placeholder=246,230,230
Color Word Wrap Marker=237,237,237


> On Oct. 12, 2015, 9:02 p.m., Milian Wolff wrote:
> > src/core/kconfig.cpp, line 720
> > <https://git.reviewboard.kde.org/r/125598/diff/1/?file=410634#file410634line720>
> >
> >     is prepending it really a fallback?

I think yes, as we prepend for the locateAll, too, which inverts the order.


- Christoph


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125598/#review86756
-----------------------------------------------------------


On Oct. 12, 2015, 12:55 p.m., Christoph Cullmann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125598/
> -----------------------------------------------------------
> 
> (Updated Oct. 12, 2015, 12:55 p.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Repository: kconfig
> 
> 
> Description
> -------
> 
> Like KXMLGui, KConfig has now a fallback to config files bundled with the application in resources.
> 
> Like kxmlgui, its in :/kconfig5.
> 
> This allows e.g. KTextEditor deployment without any installed files beside the library itself and should easy the shipping of default configs for non-linux/unix platforms.
> 
> Question is if :/kconfig5 is that nice a prefix, at least it is unique and matches what we do with kxmlgui5.
> 
> 
> Diffs
> -----
> 
>   autotests/CMakeLists.txt 8213bc4 
>   autotests/fallbackconfigresources.qrc PRE-CREATION 
>   autotests/fallbackconfigresourcestest.cpp PRE-CREATION 
>   src/core/kconfig.cpp 7f03869 
> 
> Diff: https://git.reviewboard.kde.org/r/125598/diff/
> 
> 
> Testing
> -------
> 
> Added an unit test to show that the fallback resource is found and read.
> 
> 
> Thanks,
> 
> Christoph Cullmann
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20151012/8e9e3664/attachment.html>


More information about the Kde-frameworks-devel mailing list