Fixing 49564 - dependency/BC problem?
bastian at kde.org
Sun Mar 9 01:31:41 GMT 2003
On Sunday 09 March 2003 01:55, Ravikiran Rajagopal wrote:
> KConfigBackEnd::sync() returns nothing, and hence fails silently when the
> user's local config file is not writable. As I understand it, we cannot
> have kdecore dependent on kdeui. So we cannot use a UI element to make the
> user aware of the situation.
> The only alternatives I can think of:
> 1. Add a sync() function which indicates success or failure - not possible
> to due to BC issues as sync() is virtual. Don't know whether changing a
> return type is BC though.
> 2. Emit a signal saying it failed, and let the app take care of it. Does
> not help existing binaries, and _all_ apps need to be ported.
> 3. Add a function canWeSaveConfig(). This has the same problem as #2.
> 4. If the user's local config file is not writable, try to make it
> writable. Very invasive, and I don't like it.
kconfig could emit a signal that was caught by kapplication. kapplication then
needs to show a dialog without linking to kdeui. That in itself is a solvable
problem. Probably the easiest solution would be to exec kdialog for that. We
may want to limit this to the moment at which kapp->config() gets created. At
this moment we can be pretty certain that no GUI elements are visible who
could be deprived from paint-events by using exec. Using anything other than
exec is probably a bad idea since that would involve the event loop which may
lead to unexpected reentrancy problems.
What's harder is to decide whether a non-writable local config file is
non-writable by accident or by intention. I think a config option for that
would be appropriate. The dialog could have a "don't show/ask this again"
checkbox to change this option, someone who intentionally makes a config file
non-writable can then easily disable these warnings. (Although it might be
somewhat tricky to save the don't ask again setting if the file isn't
The above should not apply to config files that are made non-writable with
[$i] since that is always intentional.
bastian at kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian at suse.com
More information about the kde-core-devel