[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: Re: plasma-framework in kdereview
From: David Edmundson <david () davidedmundson ! co ! uk>
Date: 2014-04-25 23:22:05
Message-ID: CAGeFrHCG07VDwpA-j8S6ewu3kbQOaZqd97A+p5V_NPiA-dZPFA () mail ! gmail ! com
[Download RAW message or body]
I don't think we can tap into the parser too easily, we're not using
the ConfigLoaderHandler for actually loading a config; we're just
sharing the XML parser.
It seems there's a very simple option that works.
KConfigSkeleton keeps track of groups already.
If we replace the core of Service::setOperationsScheme with the
following it looks to work.
KSharedConfigPtr config = KSharedConfig::openConfig("/dev/null");
KConfigLoader loader(config, xml);
foreach (KConfigSkeletonItem *item, loader.items()) {
d->operationsMap[item->group()][item->key()] = item->property();
}
I ran plasmaengineexplorer and the UI for the activities service
appeared properly.
The /dev/null is a bit of a hack, I'm required to pass a string so
KSharedConfigPtr can try to share objects properly, but it doesn't get
used.
This is theoretically slower quite a bit slower but in practice a
service won't have so many entries so I don't think it will make a
real difference.
Alternatively we can fork just the ConfigLoaderHandler; we don't need
all of KConfigLoader, this part is only ~300 lines which isn't /too/
bad.
David
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic