Introducing a plugin loading approach inside of the KWallet convenience API

Valentin Rusu kde at rusu.info
Sun Oct 28 18:42:29 GMT 2012


Hello,

After quite a while of being busy with some other, "real world", tasks, 
I managed to finish the plugin loading logic inside the KWallet API.
:-)

** The context **
Be able to switch from KWallet to KSecretsService, which is an 
implementation of the freedesktop.org secret service [1]
This is quite a complex task to do, as existing applications must not be 
affected.

In order to do that, it was proposed [2] to introduce a plugin loading 
approach inside the KWallet logic.

** The news **
First of all, I created a branch named "ksecretsservice" in kdelibs. All 
the preparatory work was (and will) be done inside that branch. I also 
merged the master branch into that branch from time time so today it's 
in sync with it.

The Wallet logic was modified:
- load a default plugin when first called,
- all the Wallet API calls now delegate to the loaded plugin, excepting 
the following methods:
     * LocalWallet,
     * NetworkWallet,
     * PasswordFolder,
     * FormDataFolder.
- some extra, internal, methods were added to the API to let the plugin 
trigger wallet signals [3]:
     * emitWalletOpened()
     * emitWalletClosed()
     * emitFolderUpdated(const QString&)
     * emitFolderListUpdated()
     * emitFolderRemoved(const QString&)
- a new KDE service type was defined "KWallet/Plugin" via 
kdeui/util/kwallet-plugin.desktop
     * this is the type that the future wallet plugins should declare
- new header was added : kdeui/util/kwalletplugin.h
     * this holds a base class named WalletPlugin that all wallet 
plugins must implement

kdelibs/kwalletdefaultplugin was introduced :
- it gets the original org.kde.KWallet.xml file from kdeui/util,
- it gets the original code from kdeui/util/kwallet.cpp,
- as it's name suggests, it's loaded by default when applications access 
KWallet API.

I'm currently using this setup on my computer without problems. 
KWalletManager functions as usual, and the network manager plasmoid is 
continuing to load my wifi password, to only mention these applications.

I also did a full rebuild of my KDE setup (94 kdesrc-build components), 
holding my kdelibs version, to ensure no issues were introduced into 
kwallet.h

** Next moves **
Any thoughts about this?

The current ksecretsservice branch should now be merged with kdelibs 
master in order to bring in the plugin logic. I marked the commit that 
should be merged to master with the tag "plugin.ready".
How should that be done? What would be the next steps to accomplish 
that? Who can help with that?

Cheers,

[1] http://standards.freedesktop.org/secret-service/
[2] http://mail.kde.org/pipermail/kde-utils-devel/2011-November/000705.html
[3] This is the only way I managed to do that. Connecting signals did 
not work as some forum threads suggest.

-- 
Valentin Rusu (IRC valir, KDE vrusu)
KSecretsService (former KSecretService, KWallet replacement)





More information about the kde-core-devel mailing list