Bug 292096 - Last.fm plugin: invalid KWallet handling
Summary: Last.fm plugin: invalid KWallet handling
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Services/Last.fm (show other bugs)
Version: 2.5.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: 2.6
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-21 09:25 UTC by Lassi Väätämöinen
Modified: 2012-12-12 22:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.7
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lassi Väätämöinen 2012-01-21 09:25:09 UTC
Version:           2.5.0 (using KDE 4.7.4) 
OS:                Linux

When wallet is not open yet (no other app is using wallet), and Amarok is started, the wallet is closed immediately after giving the KWallet password that last.fm plugin needs. This does not happen with, e.g., Kopete. 

KWallet is in "close when last application stops using it"-mode.


Reproducible: Always

Steps to Reproduce:
1. Enable Last.fm plugin from Amarok settings, use KWallet for storing password.
2. Close Amarok 
3. Close KWallet from system tray (check in system tray settings that KWallet is in "auto" mode, in "Entries" section)
4. Start Amarok, a KWallet password is requested
5. Enter password.

Actual Results:  
Open wallet icon is displayed for a second and then gets hidden as KWallet is closed.

Expected Results:  
Wallet stays open (and "open mode" icon is shown)
Comment 1 Lassi Väätämöinen 2012-01-21 09:30:44 UTC
Note that if Kopete is running before starting Amarok (step 4.) and KWallet is open due to that, then the wallet is not closed.

So the invalid wallet handling is reproduced if the Last.fm plugin is accessing a closed wallet.
Comment 2 Matěj Laitl 2012-12-12 22:54:44 UTC
Git commit d9a72268a5cfe5f53d84f8fd57c5f8611f54fd76 by Matěj Laitl.
Committed on 12/12/2012 at 23:31.
Pushed by laitl into branch 'master'.

Last.fm plugin: major rework of configuration and more

This work started as an attempt to fix bug 306134. I figured out that
the synchronous KWallet API is simply dangerous, and the async one must
be used. But that meant to make LastFmServiceConfig a "living" object
with updated() signal, which triggered refactoring of all its usage.

Users of LastFmServiceConfig now watch for its changes and should act
appropriately. The LastFmServiceConfig now has only one instance shared
between LastFmService and LastFmServiceSettings - I had to introduce
another shared library because KCM modules use separate library, silly.

Moreover, some extremely ugly things in Last.fm plugin got reworked to
me clean and maintainable, reducing code duplication.

Patrick, please tests whether this still builds on Windows, I hope I've
done KDE_EXPORT/KDE_IMPORT right, but I cannot test under Linux.

CHANGES:
 * When configuring Last.fm plug-in, the changes are now applied
   immediately in most places.

BUGFIXES:
 * Fix suboptimal KWallet usage in Last.fm plugin.
 * Fix crash in Last.fm plugin caused by sloppy KWallet usage.
Related: bug 311331, bug 306134
FIXED-IN: 2.7
DIGEST: Last.fm plugin configuration reworked for smoother experience
CCMAIL: Patrick von Reth <vonreth@kde.org>

M  +4    -0    ChangeLog
M  +15   -2    src/services/lastfm/CMakeLists.txt
M  +166  -147  src/services/lastfm/LastFmService.cpp
M  +9    -5    src/services/lastfm/LastFmService.h
M  +5    -7    src/services/lastfm/LastFmServiceCollection.cpp
M  +1    -2    src/services/lastfm/LastFmServiceCollection.h
M  +160  -110  src/services/lastfm/LastFmServiceConfig.cpp
M  +50   -24   src/services/lastfm/LastFmServiceConfig.h
M  +37   -41   src/services/lastfm/LastFmServiceSettings.cpp
M  +3    -1    src/services/lastfm/LastFmServiceSettings.h
M  +4    -4    src/services/lastfm/LastFmTreeModel.cpp
M  +1    -2    src/services/lastfm/LastFmTreeModel.h
M  +3    -4    src/services/lastfm/ScrobblerAdapter.cpp
M  +3    -2    src/services/lastfm/ScrobblerAdapter.h
M  +5    -6    src/services/lastfm/SynchronizationAdapter.cpp
M  +3    -2    src/services/lastfm/SynchronizationAdapter.h
C  +16   -35   src/services/lastfm/amarok_lastfm_shared_export.h [from: src/services/lastfm/LastFmServiceSettings.h - 058% similarity]
M  +0    -9    src/services/lastfm/meta/LastFmMeta.cpp
M  +1    -1    src/services/lastfm/meta/LastFmMeta.h

http://commits.kde.org/amarok/d9a72268a5cfe5f53d84f8fd57c5f8611f54fd76