config stuff
Bernd Gehrmann
bernd at physik.hu-berlin.de
Mon Sep 11 22:20:57 UTC 2000
On Mon, 11 Sep 2000, Falk Brettschneider wrote:
> Hi,
>
> Are there any ideas how to design loading/saving the
> configuration/session in a distributed app like KDevelop?
*brainstorming*
Would be easier if KDockWidget::readConfig() had useful
documentation ...
/me looks for the documentation maintainer ;-)
It seems that in order restore a window configuration
from a config file, it looks up widgets by name
(QObject::name) in the childDock variable of
KDockManager. This list in turn contains all
KDockWidgets (according to the KDockWidget constructor).
So in principle, in order to restore a window layout,
one must first construct all widgets, put each of them in a
KDockWidget and then call readConfig(). And for all this
to work, each widget must have a unique name.
The difficult part comes comes from out component
architecture. Up to now, all existent components (by
a call to the trader) are constructed on startup. This
sucks (I'm guilty...). We want to have configurability
on a per-project level, right? Then we want to store
the list of components in the project file (more precisely
in the user project file, which now seems to be separate).
An initial list of components for a project is generated
by some app wizard. Afterwards, the user may add or
remove components.
Now what do we need to restore a session?
1. obtain a list of all components to laod from
the project management
2. load the components
3. ask the components to initialize their gui
(now a number of embedWidget() calls comes in,
where a KDockWidget is created for each of them)
4. readConfig()
It becomes more difficult if a components wants to
store session data itself. I'm too tired to think
about it now ;-)
Just my thoughts. If this was completely stupid or
I missed anything, say so.
Bernd.
More information about the KDevelop-devel
mailing list