Review Request 123707: Set session manager discard command

David Faure faure at kde.org
Sun May 10 20:14:36 UTC 2015


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


If filePath() is relative, it can't be used in a discard command. I assume you meant "always absolute". This is true in your case (SimpleConfig) but not in all cases.

The method filePath() itself assumes a file-based backend (once in the past there was an idea of an ldap-based backend, or a binary db...).

I'm not sure which of the two solutions I prefer:
1) filePath() method, but documented to only make sense for SimpleConfig objects
2) using QStandardPaths to find the file from KConfig::name(). This is done a lot more than you think ;) 

In fact the KConfig constructor takes a QStandardPaths::StandardLocation optional 3rd argument. So it's not unreasonable to look up KConfig::name() in there.... it's just that in general it'll be a locateAll(), not just a locate() (which is good enough for SimpleConfig).
So yeah no LDAP there :-)

I think option 2 is better than providing an API that will make KConfig users shoot themselves in the foot.

- David Faure


On May 10, 2015, 5:11 p.m., Stefan Becker wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123707/
> -----------------------------------------------------------
> 
> (Updated May 10, 2015, 5:11 p.m.)
> 
> 
> Review request for KDE Frameworks and Rex Dieter.
> 
> 
> Bugs: 346768
>     https://bugs.kde.org/show_bug.cgi?id=346768
> 
> 
> Repository: kconfig
> 
> 
> Description
> -------
> 
> If KConfig object provides a non-empty file path then set the session manager discard command to "rm <file path>". This makes sure that obsolete session files are deleted after creating a new one.
> 
> 
> Diffs
> -----
> 
>   src/core/kconfig.h 6cc7323 
>   src/core/kconfig.cpp 3819716 
>   src/gui/kconfiggui.h 173400f 
>   src/gui/kconfiggui.cpp 0048c60 
> 
> Diff: https://git.reviewboard.kde.org/r/123707/diff/
> 
> 
> Testing
> -------
> 
> F22 kwrite & konsole, ksmserver and "Save Session..."
> 
> 
> Thanks,
> 
> Stefan Becker
> 
>

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


More information about the Kde-frameworks-devel mailing list