1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

Merge branch 'stable'

This commit is contained in:
Leo Franchi
2012-03-31 10:27:31 -04:00
9 changed files with 16 additions and 10 deletions

View File

@@ -585,6 +585,8 @@ LastFmPlugin::topTracksReturned()
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() ); QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
QStringList topTracks = lastfm::Artist::getTopTracks( reply ); QStringList topTracks = lastfm::Artist::getTopTracks( reply );
topTracks.removeDuplicates();
QVariantMap returnedData; QVariantMap returnedData;
returnedData["tracks"] = topTracks; returnedData["tracks"] = topTracks;

View File

@@ -38,6 +38,8 @@ RelatedArtistsContext::RelatedArtistsContext()
m_relatedModel->setColumnStyle( TreeModel::TrackOnly ); m_relatedModel->setColumnStyle( TreeModel::TrackOnly );
m_relatedView->setTreeModel( m_relatedModel ); m_relatedView->setTreeModel( m_relatedModel );
m_relatedView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); m_relatedView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
m_relatedView->setSortingEnabled( false );
m_relatedView->proxyModel()->sort( -1 );
QPalette pal = m_relatedView->palette(); QPalette pal = m_relatedView->palette();
pal.setColor( QPalette::Window, QColor( 0, 0, 0, 0 ) ); pal.setColor( QPalette::Window, QColor( 0, 0, 0, 0 ) );

View File

@@ -85,7 +85,7 @@ InfoBar::InfoBar( QWidget* parent )
m_autoUpdate->setText( tr( "Automatically update" ) ); m_autoUpdate->setText( tr( "Automatically update" ) );
m_autoUpdate->setLayoutDirection( Qt::RightToLeft ); m_autoUpdate->setLayoutDirection( Qt::RightToLeft );
m_autoUpdate->setPalette( whitePal ); m_autoUpdate->setPalette( whitePal );
connect( m_autoUpdate, SIGNAL( stateChanged( int ) ), this, SIGNAL( autoUpdateChanged( int ) ) ); connect( m_autoUpdate, SIGNAL( toggled( bool ) ), this, SIGNAL( autoUpdateChanged( bool ) ) );
ui->horizontalLayout->addWidget( m_autoUpdate ); ui->horizontalLayout->addWidget( m_autoUpdate );

View File

@@ -60,7 +60,7 @@ public slots:
void setAutoUpdateAvailable( bool b ); void setAutoUpdateAvailable( bool b );
signals: signals:
void filterTextChanged( const QString& filter ); void filterTextChanged( const QString& filter );
void autoUpdateChanged( int state ); void autoUpdateChanged( bool checked );
protected: protected:
void changeEvent( QEvent* e ); void changeEvent( QEvent* e );

View File

@@ -597,7 +597,9 @@ EchonestGenerator::sentenceSummary()
suffix = ", "; suffix = ", ";
else else
suffix = "."; suffix = ".";
} else } else if ( i < required.size() - 2 ) // An item in the list that is before the second to last one, don't use ", and", we only want that for the last item
suffix += ", ";
else
suffix += ", and "; suffix += ", and ";
} }
sentence += center + suffix; sentence += center + suffix;

View File

@@ -116,7 +116,7 @@ ViewManager::ViewManager( QObject* parent )
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) ); connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) );
connect( m_infobar, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) ); connect( m_infobar, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) );
connect( m_infobar, SIGNAL( autoUpdateChanged( int ) ), SLOT( autoUpdateChanged( int ) ) ); connect( m_infobar, SIGNAL( autoUpdateChanged( bool ) ), SLOT( autoUpdateChanged( bool ) ) );
connect( this, SIGNAL( tomahawkLoaded() ), m_whatsHotWidget, SLOT( fetchData() ) ); connect( this, SIGNAL( tomahawkLoaded() ), m_whatsHotWidget, SLOT( fetchData() ) );
connect( this, SIGNAL( tomahawkLoaded() ), m_welcomeWidget, SLOT( loadData() ) ); connect( this, SIGNAL( tomahawkLoaded() ), m_welcomeWidget, SLOT( loadData() ) );
@@ -569,9 +569,9 @@ ViewManager::applyFilter()
void void
ViewManager::autoUpdateChanged( int state ) ViewManager::autoUpdateChanged( bool toggled )
{ {
currentPage()->setAutoUpdate( state == Qt::Checked ); currentPage()->setAutoUpdate( toggled );
} }

View File

@@ -177,7 +177,7 @@ private slots:
void setFilter( const QString& filter ); void setFilter( const QString& filter );
void applyFilter(); void applyFilter();
void autoUpdateChanged( int ); void autoUpdateChanged( bool );
void onWidgetDestroyed( QWidget* widget ); void onWidgetDestroyed( QWidget* widget );

View File

@@ -296,6 +296,7 @@ CategoryAddItem::playlistToRenameLoaded()
QTimer::singleShot( 400, APP->mainWindow()->sourceTreeView(), SLOT( renamePlaylist() ) ); QTimer::singleShot( 400, APP->mainWindow()->sourceTreeView(), SLOT( renamePlaylist() ) );
disconnect( pl, SIGNAL( dynamicRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ), this, SLOT( playlistToRenameLoaded() ) ); disconnect( pl, SIGNAL( dynamicRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ), this, SLOT( playlistToRenameLoaded() ) );
disconnect( pl, SIGNAL( revisionLoaded( Tomahawk::PlaylistRevision ) ), this, SLOT( playlistToRenameLoaded() ) );
} }
@@ -307,8 +308,7 @@ CategoryAddItem::parsedDroppedTracks( const QList< query_ptr >& tracks )
playlist_ptr newpl = Playlist::create( SourceList::instance()->getLocal(), uuid(), "New Playlist", "", SourceList::instance()->getLocal()->friendlyName(), false, tracks ); playlist_ptr newpl = Playlist::create( SourceList::instance()->getLocal(), uuid(), "New Playlist", "", SourceList::instance()->getLocal()->friendlyName(), false, tracks );
ViewManager::instance()->show( newpl ); ViewManager::instance()->show( newpl );
// Give a shot to try to rename it. The playlist has to be created first. ugly. connect( newpl.data(), SIGNAL( revisionLoaded( Tomahawk::PlaylistRevision ) ), this, SLOT( playlistToRenameLoaded() ) );
QTimer::singleShot( 300, APP->mainWindow()->sourceTreeView(), SLOT( renamePlaylist() ) );
} else if( m_categoryType == SourcesModel::StationsCategory ) { } else if( m_categoryType == SourcesModel::StationsCategory ) {
// seed the playlist with these song or artist filters // seed the playlist with these song or artist filters
QString name; QString name;

View File

@@ -99,7 +99,7 @@ SourceTreeView::SourceTreeView( QWidget* parent )
m_model = new SourcesModel( this ); m_model = new SourcesModel( this );
m_proxyModel = new SourcesProxyModel( m_model, this ); m_proxyModel = new SourcesProxyModel( m_model, this );
connect( m_proxyModel, SIGNAL( selectRequest( QPersistentModelIndex ) ), SLOT( selectRequest( QPersistentModelIndex ) ) ); connect( m_proxyModel, SIGNAL( selectRequest( QPersistentModelIndex ) ), SLOT( selectRequest( QPersistentModelIndex ) ), Qt::QueuedConnection );
connect( m_proxyModel, SIGNAL( expandRequest( QPersistentModelIndex ) ), SLOT( expandRequest( QPersistentModelIndex ) ) ); connect( m_proxyModel, SIGNAL( expandRequest( QPersistentModelIndex ) ), SLOT( expandRequest( QPersistentModelIndex ) ) );
connect( m_proxyModel, SIGNAL( toggleExpandRequest( QPersistentModelIndex ) ), SLOT( toggleExpandRequest( QPersistentModelIndex ) ) ); connect( m_proxyModel, SIGNAL( toggleExpandRequest( QPersistentModelIndex ) ), SLOT( toggleExpandRequest( QPersistentModelIndex ) ) );