[SCM] Amarok packaging branch, master, updated. debian/2.4.2-1

Modestas Vainius modax at alioth.debian.org
Sun Jul 24 11:09:34 UTC 2011


The following commit has been merged in the master branch:
commit 894229f35406a765d92d938e2cb2373fcbd9f3e0
Author: Modestas Vainius <modax at debian.org>
Date:   Sun Jul 24 08:51:32 2011 +0300

    Backport "Prevent KWallet being queried on every track change by last.fm".
    
    Backport a patch to fix a bug which caused KWallet to prompt for a password on
    every track change (backport_no_kwallet_prompt_on_track_change.patch).
---
 debian/changelog                                   |    2 +
 ...ackport_no_kwallet_prompt_on_track_change.patch |  159 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 3 files changed, 162 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 89bedfb..080324f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ amarok (2.4.2-0r1) UNRELEASED; urgency=low
   * Adapt debian_disable_qtscriptbindings_check_fix.diff to upstream changes.
   * Add ${perl:Depends} to amarok-common Depends.
   * Update install files.
+  * Backport a patch to fix a bug which caused KWallet to prompt for a password
+    on every track change (backport_no_kwallet_prompt_on_track_change.patch).
 
  -- Modestas Vainius <modax at debian.org>  Sat, 04 Jun 2011 20:38:34 +0300
 
diff --git a/debian/patches/backport_no_kwallet_prompt_on_track_change.patch b/debian/patches/backport_no_kwallet_prompt_on_track_change.patch
new file mode 100644
index 0000000..cdd1faa
--- /dev/null
+++ b/debian/patches/backport_no_kwallet_prompt_on_track_change.patch
@@ -0,0 +1,159 @@
+From: Sam Lade <sam at sentynel.com>
+Date: Sat, 23 Jul 2011 23:25:00 +0100
+Subject: [PATCH] Prevent KWallet being queried on every track change by last.fm
+Bug: htts://bugs.kde.org/278177
+Applied-Upstream: 2.4.3
+origin: backport commit:8c9728264176b9da37b7118a700ae383a98a4d04
+Last-Update: 2011-07-24
+Acked-By: Modestas Vainius <modax at debian.org>
+
+Just look up the scrobbleComposer value from config directly,
+rather than creating a whole lastFmServiceConfig object just to get it
+BUG:278177
+FIXED-IN:2.4.3
+---
+ src/services/lastfm/LastFmService.cpp    |   11 ++++-------
+ src/services/lastfm/LastFmService.h      |    1 +
+ src/services/lastfm/ScrobblerAdapter.cpp |   25 +++++++++++++------------
+ src/services/lastfm/ScrobblerAdapter.h   |    1 +
+ 4 files changed, 19 insertions(+), 19 deletions(-)
+
+--- a/src/services/lastfm/LastFmService.cpp
++++ b/src/services/lastfm/LastFmService.cpp
+@@ -182,6 +182,7 @@ LastFmService::LastFmService( LastFmServ
+       m_userinfo( 0 ),
+       m_userName( username ),
+       m_sessionKey( sessionKey ),
++      m_password( password ),
+       m_scrobbleComposer( scrobbleComposer ),
+       m_userNameArray( 0 ),
+       m_sessionKeyArray( 0 )
+@@ -221,9 +222,6 @@ LastFmService::~LastFmService()
+ void
+ LastFmService::init()
+ {
+-    LastFmServiceConfig config;
+-    const QString password = config.password();
+-    const QString sessionKey = config.sessionKey();
+     // set the global static Lastfm::Ws stuff
+     lastfm::ws::ApiKey = Amarok::lastfmApiKey();
+     lastfm::ws::SharedSecret = "fe0dcde9fcd14c2d1d50665b646335e9";
+@@ -237,10 +235,10 @@ LastFmService::init()
+ 
+     debug() << "username:" << QString( QUrl::toPercentEncoding( lastfm::ws::Username ) );
+ 
+-    const QString authToken = md5( QString( "%1%2" ).arg( m_userName ).arg( md5( password.toUtf8() ) ).toUtf8() );
++    const QString authToken = md5( QString( "%1%2" ).arg( m_userName ).arg( md5( m_password.toUtf8() ) ).toUtf8() );
+ 
+     // now authenticate w/ last.fm and get our session key if we don't have one
+-    if( sessionKey.isEmpty() )
++    if( m_sessionKey.isEmpty() )
+     {
+         debug() << "got no saved session key, authenticating with last.fm";
+         QMap<QString, QString> query;
+@@ -254,9 +252,8 @@ LastFmService::init()
+     } else
+     {
+         debug() << "using saved sessionkey from last.fm";
+-        m_sessionKeyArray = qstrdup( sessionKey.toLatin1().data() );
++        m_sessionKeyArray = qstrdup( m_sessionKey.toLatin1().data() );
+         lastfm::ws::SessionKey = m_sessionKeyArray;
+-        m_sessionKey = sessionKey;
+ 
+         if( m_scrobble )
+             m_scrobbler = new ScrobblerAdapter( this, "ark" );
+--- a/src/services/lastfm/LastFmService.h
++++ b/src/services/lastfm/LastFmService.h
+@@ -116,6 +116,7 @@ private:
+ 
+     QString m_userName;
+     QString m_sessionKey;
++    QString m_password;
+     QString m_station;
+     QString m_age;
+     QString m_gender;
+--- a/src/services/lastfm/ScrobblerAdapter.cpp
++++ b/src/services/lastfm/ScrobblerAdapter.cpp
+@@ -81,8 +81,6 @@ ScrobblerAdapter::trackPlaying( Meta::Tr
+     {
+         m_lastSaved = m_lastPosition; // HACK engineController is broken :(
+ 
+-        LastFmServiceConfig config;
+-    
+         debug() << "track type:" << track->type();
+         const bool isRadio = ( track->type() == "stream/lastfm" );
+         
+@@ -92,8 +90,8 @@ ScrobblerAdapter::trackPlaying( Meta::Tr
+         
+         m_current.setTitle( track->name() );
+         m_current.setDuration( track->length() / 1000 );
+-        debug() << "scrobbleComposer: " << config.scrobbleComposer();
+-        if( track->composer() && config.scrobbleComposer() )
++        debug() << "scrobbleComposer: " << scrobbleComposer();
++        if( track->composer() && scrobbleComposer() )
+             m_current.setArtist( track->composer()->name() );
+         else if( track->artist() )
+             m_current.setArtist( track->artist()->name() );
+@@ -133,12 +131,10 @@ void
+ ScrobblerAdapter::trackMetadataChanged( Meta::TrackPtr track )
+ {
+     DEBUG_BLOCK
+-    LastFmServiceConfig config;
+-
+     // if we are listening to a stream, take the new metadata as a "new track" and, if we have enough info, save it for scrobbling
+     if( track &&
+         ( track->type() == "stream" && ( !track->name().isEmpty() 
+-          && ( track->artist() || ( track->composer() && config.scrobbleComposer() ) ) ) ) )
++          && ( track->artist() || ( track->composer() && scrobbleComposer() ) ) ) ) )
+         // got a stream, and it has enough info to be a new track
+     {
+         // don't use checkScrobble as we don't need to check timestamps, it is a stream
+@@ -150,12 +146,12 @@ ScrobblerAdapter::trackMetadataChanged(
+                     
+         m_current.setTitle( track->name() );
+         m_current.setArtist(
+-              track->composer() && config.scrobbleComposer()
++              track->composer() && scrobbleComposer()
+             ? track->composer()->name()
+             : track->artist()->name()
+         );
+         m_current.stamp();
+-        
++
+         m_current.setSource( lastfm::Track::NonPersonalisedBroadcast );
+ 
+         if( !m_current.isNull() )
+@@ -227,11 +223,9 @@ ScrobblerAdapter::loveTrack( Meta::Track
+ 
+     if( track )
+     {
+-        LastFmServiceConfig config;
+-
+         lastfm::MutableTrack trackInfo;
+         trackInfo.setTitle( track->name() );
+-        if( track->composer() && config.scrobbleComposer() )
++        if( track->composer() && scrobbleComposer() )
+             trackInfo.setArtist( track->composer()->name() );
+         else if( track->artist() )
+             trackInfo.setArtist( track->artist()->name() );
+@@ -280,3 +274,10 @@ ScrobblerAdapter::checkScrobble()
+     }
+     resetVariables();
+ }
++
++bool
++ScrobblerAdapter::scrobbleComposer()
++{
++    KConfigGroup config = KGlobal::config()->group( LastFmServiceConfig::configSectionName() );
++    return config.readEntry( "scrobbleComposer", false );
++}
+--- a/src/services/lastfm/ScrobblerAdapter.h
++++ b/src/services/lastfm/ScrobblerAdapter.h
+@@ -50,6 +50,7 @@ private slots:
+ private:
+     void resetVariables();
+     void checkScrobble();
++    bool scrobbleComposer();
+ 
+     lastfm::Audioscrobbler *m_scrobbler;
+     lastfm::MutableTrack m_current;
diff --git a/debian/patches/series b/debian/patches/series
index d784895..d9189e1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
+backport_no_kwallet_prompt_on_track_change.patch
 debian_disable_qtscriptbindings_check_fix.diff
 debian_mysqle_amarok_local_errmsg_feature.diff

-- 
Amarok packaging



More information about the pkg-kde-commits mailing list