Bug 230098 - Amarok asks for access to kwallet although it does not need any passwords
Summary: Amarok asks for access to kwallet although it does not need any passwords
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Services/Last.fm (show other bugs)
Version: 2.3-GIT
Platform: openSUSE Linux
: NOR normal
Target Milestone: 2.3.2
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-09 14:45 UTC by S. Burmeister
Modified: 2010-05-29 10:34 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description S. Burmeister 2010-03-09 14:45:19 UTC
Version:           2.3-GIT (using KDE 4.4.1)
OS:                Linux
Installed from:    openSUSE RPMs

When I start amarok it asks for access to kwallet. Since I do not use any external mysql db or any other service that needs a username/password, I wonder why amarok still asks for access to kwallet.
Comment 1 Myriam Schweingruber 2010-03-10 21:26:44 UTC
You don't use last.fm at all?
Comment 2 S. Burmeister 2010-03-10 21:38:42 UTC
No, I have not set it up. I checked and username and password are empty although the service as such is enabled by default.
Comment 3 S. Burmeister 2010-03-10 21:44:31 UTC
.
Comment 4 Myriam Schweingruber 2010-03-11 10:44:21 UTC
Thank you for your feedback.
Comment 5 Casey Link 2010-05-29 02:01:01 UTC
commit 32101128c377a68f08d3aa5e085d3596b8777508
Author: Casey Link <unnamedrambler@gmail.com>
Date:   Fri May 28 17:46:30 2010 -0500

    The last.fm service will now only open the wallet on startup if the user
    has enabled features that require authentication.
    BUG: 230098

diff --git a/src/services/lastfm/LastFmServiceConfig.cpp b/src/services/lastfm/LastFmServiceConfig.cpp
index e50444e..c5dec70 100644
--- a/src/services/lastfm/LastFmServiceConfig.cpp
+++ b/src/services/lastfm/LastFmServiceConfig.cpp
@@ -32,11 +32,18 @@ LastFmServiceConfig::LastFmServiceConfig()
 {
     KConfigGroup config = KGlobal::config()->group( configSectionName() );
 
-    // open wallet unless explicitly told not to
-    if( !( config.readEntry( "ignoreWallet", QString() ) == "yes" ) ) {
-        m_wallet = KWallet::Wallet::openWallet( KWallet::Wallet::NetworkWallet(), 0, KWallet::Wallet::Synchronous );
-    }
 
+    // we only want to load the wallet if the user has enabled features that require a user/pass
+    bool scrobble = config.readEntry( "scrobble", false );
+    bool fetch_sim = config.readEntry( "fetchSimilar", false );
+
+    if( scrobble || fetch_sim ) // if either of these are true we need the wallet.
+    {
+        // open wallet unless explicitly told not to
+        if( !( config.readEntry( "ignoreWallet", QString() ) == "yes" ) ) {
+            m_wallet = KWallet::Wallet::openWallet( KWallet::Wallet::NetworkWallet(), 0, KWallet::Wallet::Synchronous );
+        }
+    }
     load();
 }