Re: Questions about the migration from GConf to GSettings/DConf



On Sun, 2015-07-19 at 23:17 +0800, Oliver Luo wrote:
I've been spending several days working on the migration from GConf 
to GSettings/DConf in our project evolution EAS...

        Hi,
I suppose you mean evolution-activesync, as it's named in the GNOME
repositories.

1. Use relocatable schemas. In this case, we have one schema being
relocatable, and multiple instance of that schema so we can store
accounts of uncertain number. But the question is that the instances
are separated and there seems no API to control them as a whole,
which means we lost the structure information and make things harder
in our project.

Briefly grepping the evolution-activesync code, the keys being read
from the GConf look like:
  /apps/activesyncd/accounts/<email>/<key1>
  /apps/activesyncd/accounts/<email>/<key2>
  ...
so you can have a relocatable schema with { key1, key2, ... } and
"attach" it under /apps/activesyncd/accounts/<email>. That feels pretty
straightforward, and if I understand your text properly then you know
it. The thing you face is to know the list of configured accounts.

I would create a 'list' key with a list of known accounts in
/apps/activesyncd/accounts/, which will contain the <email> of each
configured accounts, and an existing path in GSettings. I saw this
approach being used in another project, I think it was gtk+.

 I don't have the perfect solution yet, so I'm here to see if anyone 
could help me.

The evolution(-data-server) also used to store its account settings
into GConf, but then moved away from that idea and instead of migrating
account settings into GSettings it uses its own ESourceRegistry. You
can create tree of ESource-s there, each can have its own extension,
where it stores its data. Maybe it would work better than the
GSettings. See how evolution-ews stores its settings on an ESource for
an example (it uses an ESourceCollection for the parent ESource).

Alternatively, maybe, create your own API on top of a GKeyFile and
store the account information in it?

        Bye,
        Milan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]