KConfig race condition?
Clarence Dang
dang at kde.org
Tue Apr 20 13:47:29 BST 2004
On Tue, 20 Apr 2004 06:41 am, Rob Kaper wrote:
> The applications needn't know about each other's new options yet, so
> signals on file alteration aren't necessary fortunately
In some cases it would be desirable that other processes are notified of a
config file change.
e.g. Open 2 KWrite processes. Change the orientation of the main toolbar in
the 1st process. After .5s KMainWindow, will call KConfig::sync().
Then open up a new window in the 2nd process (you might have to type something
to force CTRL+N to work). The new window's main toolbar's orientation is
still the old one. But if you open a new window in the 1st process instead,
the new orientation is used.
IIRC, this is because the KConfig object in the 2nd process isn't notified of
the change.
In KolourPaint, I solve this using kapp->config ()->reparseConfiguration ()
before every config read. But this is hopelessly inefficient. Automatic
interprocess config change notification or interprocess KConfig objects would
be a nice solution, IMHO.
Clarence
More information about the kde-core-devel
mailing list