Review Request 116845: Add KCoreConfigSkeleton::read() which doesn't call reparseConfiguration.

Matthew Dawson matthew at mjdsystems.ca
Mon Mar 17 03:10:28 UTC 2014


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


The unit test situation seems far from ideal, but since it fits with the current setup it can be left for now.  Changing them can be left for another patch :)

Otherwise, I imagined readConfig would become a regular method, and read is the new virtual method to implement to override the KConfig parsing.  I've opened some issues about that below.

Also, I'd like to get the usrReadConfig function renamed in this patch, as we were discussing in RR #116461, unless we decide to leave the name alone.


src/core/kcoreconfigskeleton.h
<https://git.reviewboard.kde.org/r/116845/#comment37415>

    Regarding the virtual methods, once they change this needs to be updated.



src/core/kcoreconfigskeleton.h
<https://git.reviewboard.kde.org/r/116845/#comment37412>

    Can you remove the virtual from readConfig, since there isn't a reason to override readConfig, and may in fact break if other code uses read() instead.



src/core/kcoreconfigskeleton.h
<https://git.reviewboard.kde.org/r/116845/#comment37414>

    Regarding the virtual methods, once they change this needs to be updated.



src/core/kcoreconfigskeleton.h
<https://git.reviewboard.kde.org/r/116845/#comment37413>

    I can't find any instances (lxr.kde.org returns way too many results to thoroughly check) where readConfig() was overridden and I don't know why you would want to override it, but since some users may have anyways I'd prefer if read() stayed a virtual for compatibility, since it replaces readConfig.



src/core/kcoreconfigskeleton.cpp
<https://git.reviewboard.kde.org/r/116845/#comment37416>

    I'd prefer to keep the same behaviour we implemented before.  This allows for applications to make use of the optimization if they haven't been ported yet.
    
    It also reduces developer thought in the simple case, as they can just always call readConfig/loadConfig, and be ensured they get the latest values from disk, while avoiding an extra read off disk.  That leaves the read() function there as an optimization for the more advanced cases.



src/core/kcoreconfigskeleton.cpp
<https://git.reviewboard.kde.org/r/116845/#comment37410>

    Since we are modifying this function, can you also kill this line please?


- Matthew Dawson


On March 16, 2014, 7:08 p.m., David Faure wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/116845/
> -----------------------------------------------------------
> 
> (Updated March 16, 2014, 7:08 p.m.)
> 
> 
> Review request for KDE Frameworks and Matthew Dawson.
> 
> 
> Repository: kconfig
> 
> 
> Description
> -------
> 
> Add KCoreConfigSkeleton::read() which doesn't call reparseConfiguration.
> 
> Call it from generated singletons, since the constructor creates
> a KConfig from a filename, which already loads from disk.
> This removes the need for using DelayedParsing.
> 
> 
> Diffs
> -----
> 
>   autotests/kconfig_compiler/test4main.cpp 8f1c1ec8d41ea123893a59526c52cdbd0b5ee075 
>   autotests/kconfig_compiler/test5.cpp.ref 088cc78f4dc96a719628ece342e149553c1d22aa 
>   autotests/kconfig_compiler/test8b.cpp.ref dcd61693ff86f02eaeb93b4c4da9e6ed20463469 
>   autotests/kconfig_compiler/test_dpointer.cpp.ref e50bf8aa29a2d009c4156dabf429c3ffb74eb7ba 
>   autotests/kconfig_compiler/test_signal.cpp.ref 35b5cba2736761753d1ba32baa6f9fc2e7808ba1 
>   autotests/kconfigskeletontest.cpp 31278e767655f7e3d25a4ed9984345e8c4e67d82 
>   src/core/kcoreconfigskeleton.h a2b828a4ef3f881b551049901d4bc26bb23a014b 
>   src/core/kcoreconfigskeleton.cpp 0c1a96faaa9c511d349a26ad8af4b7b2c9bf313e 
>   src/kconfig_compiler/kconfig_compiler.cpp 7d84cfbc28b1648ca999116726455183d88a7f0a 
>   autotests/kconfig_compiler/test4.cpp.ref 66d0357f114b0aca6148a2091880dd2f62fbf624 
>   autotests/kconfig_compiler/test1main.cpp d7dc038d91d2f8babcd281960100d1c6fa264d7c 
>   autotests/kconfig_compiler/test10.cpp.ref 21aea9d87af5fce01e64032257283e0883af2d81 
> 
> Diff: https://git.reviewboard.kde.org/r/116845/diff/
> 
> 
> Testing
> -------
> 
> Added two unittests (which is how I discovered I had to remove DelayedParsing, so the tests were useful).
> 
> The "bool ok + qWarning" thing is a bit clumsy, maybe we want to port these main() to qtestlib too, even though they are themselves executed by a unittest :-)
> 
> 
> Thanks,
> 
> David Faure
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140317/36bf5a4d/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list