[arch-commits] Commit in amarok/trunk (PKGBUILD fix-random-with-repeat.patch)

2009-12-16 Thread Andrea Scarpino
Date: Wednesday, December 16, 2009 @ 15:18:44
  Author: andrea
Revision: 61491

upgpkg: amarok 2.2.1.90-1
upstream beta release

Modified:
  amarok/trunk/PKGBUILD
Deleted:
  amarok/trunk/fix-random-with-repeat.patch

--+
 PKGBUILD |   18 +--
 fix-random-with-repeat.patch |  206 -
 2 files changed, 6 insertions(+), 218 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2009-12-16 19:41:39 UTC (rev 61490)
+++ PKGBUILD2009-12-16 20:18:44 UTC (rev 61491)
@@ -4,26 +4,20 @@
 
 pkgname=amarok
 replaces=('amarok-base' 'amarok-engine-xine' 'amarok-base-mysqlfree')
-pkgver=2.2.1
-pkgrel=2
+pkgver=2.2.1.90
+pkgrel=1
 pkgdesc=A media player for KDE
 arch=(i686 x86_64)
 url=http://amarok.kde.org;
 license=('GPL2' 'LGPL2' 'FDL')
-depends=('mysql=5.1.41' 'kdebase-runtime=4.3' 'libmtp=0.3.7' 
'libgpod=0.7.2'
-   'qtscriptgenerator=0.1.0' 'taglib-extras=1.0.1' 'liblastfm=0.3.0'
-   'loudmouth=1.4.3' 'qca')
+depends=('mysql' 'kdebase-runtime' 'libmtp' 'libgpod' 'qtscriptgenerator'
+   'taglib-extras' 'liblastfm' 'loudmouth' 'qca')
 makedepends=('pkgconfig' 'automoc4' 'cmake')
 install=amarok.install
-source=(http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2;
-   'fix-random-with-repeat.patch')
-md5sums=('4f6f45f0c25f85f2a2a1fff169ac7193'
- '4932796051747035e67a6ff68b4ea561')
+source=(http://download.kde.org/unstable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2;)
+md5sums=('0fb6c98618c91159a26e3f2e837ef132')
 
 build() {
-   cd ${srcdir}/${pkgname}-${pkgver}
-   patch -Np1 -i ${srcdir}/fix-random-with-repeat.patch || return 1
-
cd ${srcdir}
mkdir build
cd build

Deleted: fix-random-with-repeat.patch
===
--- fix-random-with-repeat.patch2009-12-16 19:41:39 UTC (rev 61490)
+++ fix-random-with-repeat.patch2009-12-16 20:18:44 UTC (rev 61491)
@@ -1,206 +0,0 @@
 amarok-2.2.1/src/playlist/navigators/RandomTrackNavigator.cpp~ 
2009-11-11 22:09:13.0 +0100
-+++ amarok-2.2.1/src/playlist/navigators/RandomTrackNavigator.cpp  
2009-11-20 13:24:12.310019258 +0100
-@@ -33,13 +33,15 @@
- Playlist::RandomTrackNavigator::RandomTrackNavigator()
- {
- m_model = Playlist::ModelStack::instance()-top();
-+
-+reset();
-+
- connect( model(), SIGNAL( insertedIds( const QListquint64 ) ),
-  this, SLOT( recvInsertedIds( const QListquint64 ) ) );
- connect( model(), SIGNAL( removedIds( const QListquint64 ) ),
-  this, SLOT( recvRemovedIds( const QListquint64 ) ) );
--connect( model(), SIGNAL( layoutChanged() ), this, SLOT( 
modelLayoutChanged() ) );
--
--reset();
-+connect( model(), SIGNAL( activeTrackChanged( const quint64 ) ),
-+ this, SLOT( recvActiveTrackChanged( const quint64 ) ) );
- }
- 
- void
-@@ -51,12 +53,6 @@
- {
- m_unplayedRows.append( t );
- }
--else
--{
--// insert a new, but played, track at a random position
--int pos = KRandom::random() % m_playedRows.size();
--m_playedRows.insert( pos, t );
--}
- }
- 
- std::random_shuffle( m_unplayedRows.begin(), m_unplayedRows.end() );
-@@ -75,7 +71,11 @@
- void
- Playlist::RandomTrackNavigator::recvActiveTrackChanged( const quint64 id )
- {
--if ( m_unplayedRows.contains( id ) )
-+if( m_replayedRows.contains( id ) )
-+{
-+m_playedRows.prepend( m_replayedRows.takeAt( m_replayedRows.indexOf( 
id ) ) );
-+}
-+else if( m_unplayedRows.contains( id ) )
- {
- m_playedRows.prepend( m_unplayedRows.takeAt( m_unplayedRows.indexOf( 
id ) ) );
- }
-@@ -86,7 +86,7 @@
- {
- if( !m_queue.isEmpty() )
- return m_queue.takeFirst();
--if( m_unplayedRows.isEmpty()  m_playedRows.isEmpty() )
-+if( m_model-tracks().isEmpty() )
- return 0;
- else if( m_unplayedRows.isEmpty()  !m_repeatPlaylist )
- return 0;
-@@ -94,8 +94,8 @@
- {
- if ( m_unplayedRows.isEmpty() )
- {
--m_unplayedRows = m_playedRows;
--m_playedRows.clear();
-+// reset when playlist finishes
-+reset();
- }
- 
- quint64 requestedTrack = 0;
-@@ -106,14 +106,22 @@
- // remove the id from the unplayed rows list
- m_unplayedRows.removeAll( requestedTrack );
- }
--else if ( !m_unplayedRows.isEmpty() )
-+else if ( !m_replayedRows.isEmpty() )
-+{
-+requestedTrack = m_replayedRows.takeFirst();
-+}
-+else if (!m_unplayedRows.isEmpty() )
-+{
- requestedTrack = m_unplayedRows.takeFirst();
-+}
- 
- if ( requestedTrack == m_model-activeId())
- {
- m_playedRows.prepend( 

[arch-commits] Commit in amarok/trunk (PKGBUILD fix-random-with-repeat.patch)

2009-11-20 Thread Andrea Scarpino
Date: Friday, November 20, 2009 @ 09:08:17
  Author: andrea
Revision: 59141

upgpkg: amarok 2.2.1-2
fix random mode when repeat mode is enabled

Added:
  amarok/trunk/fix-random-with-repeat.patch
Modified:
  amarok/trunk/PKGBUILD

--+
 PKGBUILD |   13 +-
 fix-random-with-repeat.patch |  206 +
 2 files changed, 215 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2009-11-20 11:18:17 UTC (rev 59140)
+++ PKGBUILD2009-11-20 14:08:17 UTC (rev 59141)
@@ -5,20 +5,25 @@
 pkgname=amarok
 replaces=('amarok-base' 'amarok-engine-xine' 'amarok-base-mysqlfree')
 pkgver=2.2.1
-pkgrel=1
+pkgrel=2
 pkgdesc=A media player for KDE
 arch=(i686 x86_64)
 url=http://amarok.kde.org;
 license=('GPL2' 'LGPL2' 'FDL')
-depends=('mysql=5.1.37' 'kdebase-runtime=4.3' 'libmtp=0.3.7' 
'libgpod=0.7.2'
+depends=('mysql=5.1.41' 'kdebase-runtime=4.3' 'libmtp=0.3.7' 
'libgpod=0.7.2'
'qtscriptgenerator=0.1.0' 'taglib-extras=1.0.1' 'liblastfm=0.3.0'
'loudmouth=1.4.3' 'qca')
 makedepends=('pkgconfig' 'automoc4' 'cmake')
 install=amarok.install
-source=(http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2;)
-md5sums=('4f6f45f0c25f85f2a2a1fff169ac7193')
+source=(http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2;
+   'fix-random-with-repeat.patch')
+md5sums=('4f6f45f0c25f85f2a2a1fff169ac7193'
+ '4932796051747035e67a6ff68b4ea561')
 
 build() {
+   cd ${srcdir}/${pkgname}-${pkgver}
+   patch -Np1 -i ${srcdir}/fix-random-with-repeat.patch || return 1
+
cd ${srcdir}
mkdir build
cd build

Added: fix-random-with-repeat.patch
===
--- fix-random-with-repeat.patch(rev 0)
+++ fix-random-with-repeat.patch2009-11-20 14:08:17 UTC (rev 59141)
@@ -0,0 +1,206 @@
+--- amarok-2.2.1/src/playlist/navigators/RandomTrackNavigator.cpp~ 
2009-11-11 22:09:13.0 +0100
 amarok-2.2.1/src/playlist/navigators/RandomTrackNavigator.cpp  
2009-11-20 13:24:12.310019258 +0100
+@@ -33,13 +33,15 @@
+ Playlist::RandomTrackNavigator::RandomTrackNavigator()
+ {
+ m_model = Playlist::ModelStack::instance()-top();
++
++reset();
++
+ connect( model(), SIGNAL( insertedIds( const QListquint64 ) ),
+  this, SLOT( recvInsertedIds( const QListquint64 ) ) );
+ connect( model(), SIGNAL( removedIds( const QListquint64 ) ),
+  this, SLOT( recvRemovedIds( const QListquint64 ) ) );
+-connect( model(), SIGNAL( layoutChanged() ), this, SLOT( 
modelLayoutChanged() ) );
+-
+-reset();
++connect( model(), SIGNAL( activeTrackChanged( const quint64 ) ),
++ this, SLOT( recvActiveTrackChanged( const quint64 ) ) );
+ }
+ 
+ void
+@@ -51,12 +53,6 @@
+ {
+ m_unplayedRows.append( t );
+ }
+-else
+-{
+-// insert a new, but played, track at a random position
+-int pos = KRandom::random() % m_playedRows.size();
+-m_playedRows.insert( pos, t );
+-}
+ }
+ 
+ std::random_shuffle( m_unplayedRows.begin(), m_unplayedRows.end() );
+@@ -75,7 +71,11 @@
+ void
+ Playlist::RandomTrackNavigator::recvActiveTrackChanged( const quint64 id )
+ {
+-if ( m_unplayedRows.contains( id ) )
++if( m_replayedRows.contains( id ) )
++{
++m_playedRows.prepend( m_replayedRows.takeAt( m_replayedRows.indexOf( 
id ) ) );
++}
++else if( m_unplayedRows.contains( id ) )
+ {
+ m_playedRows.prepend( m_unplayedRows.takeAt( m_unplayedRows.indexOf( 
id ) ) );
+ }
+@@ -86,7 +86,7 @@
+ {
+ if( !m_queue.isEmpty() )
+ return m_queue.takeFirst();
+-if( m_unplayedRows.isEmpty()  m_playedRows.isEmpty() )
++if( m_model-tracks().isEmpty() )
+ return 0;
+ else if( m_unplayedRows.isEmpty()  !m_repeatPlaylist )
+ return 0;
+@@ -94,8 +94,8 @@
+ {
+ if ( m_unplayedRows.isEmpty() )
+ {
+-m_unplayedRows = m_playedRows;
+-m_playedRows.clear();
++// reset when playlist finishes
++reset();
+ }
+ 
+ quint64 requestedTrack = 0;
+@@ -106,14 +106,22 @@
+ // remove the id from the unplayed rows list
+ m_unplayedRows.removeAll( requestedTrack );
+ }
+-else if ( !m_unplayedRows.isEmpty() )
++else if ( !m_replayedRows.isEmpty() )
++{
++requestedTrack = m_replayedRows.takeFirst();
++}
++else if (!m_unplayedRows.isEmpty() )
++{
+ requestedTrack = m_unplayedRows.takeFirst();
++}
+ 
+ if ( requestedTrack == m_model-activeId())
+ {
+ m_playedRows.prepend( requestedTrack );
+-if ( !m_unplayedRows.isEmpty() )
+-