The docs say:
* Open the wallet @p name. The user will be prompted to
* allow your application to open the wallet, and may be
* prompted for a password. You are responsible for deleting
* this object when you are done with it.
* @param name The name of the wallet to open.
* @param ot If Asynchronous, the call will return
* immediately with a non-null pointer to an
* invalid wallet. You must immediately connect
* the walletOpened() signal to a slot so that
* you will know when it is opened, or when it
* @param w The window id to associate any dialogs with. You can pass
* 0 if you don't have a window the password dialog should
* associate with.
* @return Returns a pointer to the wallet if successful,
* or a null pointer on error or if rejected.
static Wallet* openWallet(const QString& name, WId w, OpenType ot = Synchronous);
We in Amarok do (LastFmServiceConfig.cpp):
m_wallet = Wallet::openWallet( Wallet::NetworkWallet(), 0, Wallet::Asynchronous );
connect( m_wallet, SIGNAL(walletOpened(bool)), SLOT(slotWalletOpenedToWrite(bool)) );
Expecting that all failures would be covered in slotWalletOpenedToWrite(false). However, only the "access denied" failure is covered there, when KWallet is disabled, the openWallet() call returns null here, despite the docs saying the contrary for the Wallet::Asynchronous case. See bug 315306 comment 23.
Either the behaviour or the documentation should be changed.
Git commit fe9628d596e7546b5526aed9d1dac81d350f75a5 by Matěj Laitl.
Committed on 29/07/2013 at 20:46.
Pushed by laitl into branch 'master'.
LastFmServiceConfig: prompt to save credentials in ASCII even if KWallet is disabled
I believe there is inconsistency in KWallet documentation/behaviour that
lead to assumptions not being fulfilled in credential-saving code. Lessen
* Definitely fix a bug where storing Last.fm credentials in plain-text
isn't offered when KWallet is disabled. (BR 315306)
@Vedant, you might need to incorporate this fix to your
Related: bug 315306
CCMAIL: Vedant Agarwala <email@example.com>
M +2 -0 ChangeLog
M +20 -4 src/services/lastfm/LastFmServiceConfig.cpp