diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b3b92c94..44ba445be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ ELSE() ENDIF() FIND_PACKAGE( Taglib 1.6.0 REQUIRED ) -FIND_PACKAGE( LibLastFm REQUIRED ) +FIND_PACKAGE( LibLastFm 0.3.3 REQUIRED ) FIND_PACKAGE( LibEchonest REQUIRED ) IF( UNIX AND NOT APPLE ) diff --git a/CMakeModules/FindLibLastFm.cmake b/CMakeModules/FindLibLastFm.cmake index 1d863b084..c73038a7d 100644 --- a/CMakeModules/FindLibLastFm.cmake +++ b/CMakeModules/FindLibLastFm.cmake @@ -10,8 +10,8 @@ find_path(LIBLASTFM_INCLUDE_DIR NAMES Audioscrobbler HINTS ~/usr/include /opt/local/include - /usr/include /usr/local/include + /usr/include /opt/kde4/include ${KDE4_INCLUDE_DIR} PATH_SUFFIXES lastfm @@ -21,9 +21,9 @@ find_library( LIBLASTFM_LIBRARY NAMES lastfm PATHS ~/usr/lib /opt/local/lib + /usr/local/lib /usr/lib /usr/lib64 - /usr/local/lib /opt/kde4/lib ${KDE4_LIB_DIR} ) diff --git a/src/libtomahawk/database/databaseworker.cpp b/src/libtomahawk/database/databaseworker.cpp index 9143643ec..e626ccb6d 100644 --- a/src/libtomahawk/database/databaseworker.cpp +++ b/src/libtomahawk/database/databaseworker.cpp @@ -169,7 +169,7 @@ DatabaseWorker::doWork() } if ( m_outstanding > 0 ) - doWork(); + QTimer::singleShot( 0, this, SLOT( doWork() ) ); } diff --git a/src/libtomahawk/playlist/playlistmanager.cpp b/src/libtomahawk/playlist/playlistmanager.cpp index 53b166754..b4f958a50 100644 --- a/src/libtomahawk/playlist/playlistmanager.cpp +++ b/src/libtomahawk/playlist/playlistmanager.cpp @@ -4,6 +4,8 @@ #include "audio/audioengine.h" #include "utils/animatedsplitter.h" +#include "topbar/topbar.h" +#include "widgets/infowidgets/sourceinfowidget.h" #include "collectionmodel.h" #include "collectionflatmodel.h" @@ -19,8 +21,6 @@ #include "sourcelist.h" #include "tomahawksettings.h" -#include "widgets/infowidgets/sourceinfowidget.h" - #define FILTER_TIMEOUT 280 PlaylistManager* PlaylistManager::s_instance = 0; @@ -43,10 +43,12 @@ PlaylistManager::PlaylistManager( QObject* parent ) , m_modesAvailable( false ) { s_instance = this; - m_stack = new QStackedWidget(); m_widget->setLayout( new QVBoxLayout() ); + m_topbar = new TopBar(); + m_stack = new QStackedWidget(); + m_splitter = new AnimatedSplitter(); m_splitter->setOrientation( Qt::Vertical ); m_splitter->setChildrenCollapsible( false ); @@ -62,6 +64,7 @@ PlaylistManager::PlaylistManager( QObject* parent ) m_splitter->hide( 1, false ); m_widget->layout()->setMargin( 0 ); + m_widget->layout()->addWidget( m_topbar ); m_widget->layout()->addWidget( m_splitter ); m_superCollectionView = new CollectionView(); @@ -81,6 +84,36 @@ PlaylistManager::PlaylistManager( QObject* parent ) m_widget->layout()->setMargin( 0 ); connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) ); + + connect( m_topbar, SIGNAL( filterTextChanged( QString ) ), + this, SLOT( setFilter( QString ) ) ); + + connect( this, SIGNAL( numSourcesChanged( unsigned int ) ), + m_topbar, SLOT( setNumSources( unsigned int ) ) ); + + connect( this, SIGNAL( numTracksChanged( unsigned int ) ), + m_topbar, SLOT( setNumTracks( unsigned int ) ) ); + + connect( this, SIGNAL( numArtistsChanged( unsigned int ) ), + m_topbar, SLOT( setNumArtists( unsigned int ) ) ); + + connect( this, SIGNAL( numShownChanged( unsigned int ) ), + m_topbar, SLOT( setNumShown( unsigned int ) ) ); + + connect( m_topbar, SIGNAL( flatMode() ), + this, SLOT( setTableMode() ) ); + + connect( m_topbar, SIGNAL( artistMode() ), + this, SLOT( setTreeMode() ) ); + + connect( m_topbar, SIGNAL( albumMode() ), + this, SLOT( setAlbumMode() ) ); + + connect( this, SIGNAL( statsAvailable( bool ) ), + m_topbar, SLOT( setStatsVisible( bool ) ) ); + + connect( this, SIGNAL( modesAvailable( bool ) ), + m_topbar, SLOT( setModesVisible( bool ) ) ); } @@ -493,7 +526,7 @@ PlaylistManager::linkPlaylist() m_interfaceHistory << m_currentInterface; } - applyFilter(); +// applyFilter(); AudioEngine::instance()->setPlaylist( m_currentInterface ); if ( m_currentInterface && m_statsAvailable ) diff --git a/src/libtomahawk/playlist/playlistmanager.h b/src/libtomahawk/playlist/playlistmanager.h index 40ff02e08..49d583d82 100644 --- a/src/libtomahawk/playlist/playlistmanager.h +++ b/src/libtomahawk/playlist/playlistmanager.h @@ -23,6 +23,7 @@ class TrackProxyModel; class TrackModel; class TrackView; class SourceInfoWidget; +class TopBar; class DLLEXPORT PlaylistManager : public QObject { @@ -85,6 +86,7 @@ private: void linkPlaylist(); QWidget* m_widget; + TopBar* m_topbar; QStackedWidget* m_stack; AnimatedSplitter* m_splitter; diff --git a/src/tomahawkwindow.cpp b/src/tomahawkwindow.cpp index d4a1145c1..f6f0272e0 100644 --- a/src/tomahawkwindow.cpp +++ b/src/tomahawkwindow.cpp @@ -22,7 +22,6 @@ #include "network/controlconnection.h" #include "playlist/playlistmanager.h" #include "sip/SipHandler.h" -#include "topbar/topbar.h" #include "utils/proxystyle.h" #include "utils/widgetdragfilter.h" #include "utils/xspfloader.h" @@ -41,7 +40,6 @@ using namespace Tomahawk; TomahawkWindow::TomahawkWindow( QWidget* parent ) : QMainWindow( parent ) , ui( new Ui::TomahawkWindow ) - , m_topbar( new TopBar( this ) ) , m_audioControls( new AudioControls( this ) ) , m_trayIcon( new TomahawkTrayIcon( this ) ) { @@ -68,12 +66,12 @@ TomahawkWindow::TomahawkWindow( QWidget* parent ) ui->sidebarSplitter->setStretchFactor( 1, 1 ); ui->sidebarSplitter->hide( 1, false ); - QToolBar* toolbar = addToolBar( "TomahawkToolbar" ); +/* QToolBar* toolbar = addToolBar( "TomahawkToolbar" ); toolbar->setObjectName( "TomahawkToolbar" ); toolbar->addWidget( m_topbar ); toolbar->setMovable( false ); toolbar->setFloatable( false ); - toolbar->installEventFilter( new WidgetDragFilter( toolbar ) ); + toolbar->installEventFilter( new WidgetDragFilter( toolbar ) );*/ statusBar()->addPermanentWidget( m_audioControls, 1 ); @@ -115,37 +113,6 @@ TomahawkWindow::saveSettings() void TomahawkWindow::setupSignals() { - // - connect( m_topbar, SIGNAL( filterTextChanged( const QString& ) ), - PlaylistManager::instance(), SLOT( setFilter( const QString& ) ) ); - - connect( PlaylistManager::instance(), SIGNAL( numSourcesChanged( unsigned int ) ), - m_topbar, SLOT( setNumSources( unsigned int ) ) ); - - connect( PlaylistManager::instance(), SIGNAL( numTracksChanged( unsigned int ) ), - m_topbar, SLOT( setNumTracks( unsigned int ) ) ); - - connect( PlaylistManager::instance(), SIGNAL( numArtistsChanged( unsigned int ) ), - m_topbar, SLOT( setNumArtists( unsigned int ) ) ); - - connect( PlaylistManager::instance(), SIGNAL( numShownChanged( unsigned int ) ), - m_topbar, SLOT( setNumShown( unsigned int ) ) ); - - connect( m_topbar, SIGNAL( flatMode() ), - PlaylistManager::instance(), SLOT( setTableMode() ) ); - - connect( m_topbar, SIGNAL( artistMode() ), - PlaylistManager::instance(), SLOT( setTreeMode() ) ); - - connect( m_topbar, SIGNAL( albumMode() ), - PlaylistManager::instance(), SLOT( setAlbumMode() ) ); - - connect( PlaylistManager::instance(), SIGNAL( statsAvailable( bool ) ), - m_topbar, SLOT( setStatsVisible( bool ) ) ); - - connect( PlaylistManager::instance(), SIGNAL( modesAvailable( bool ) ), - m_topbar, SLOT( setModesVisible( bool ) ) ); - // connect( PlaylistManager::instance(), SIGNAL( repeatModeChanged( PlaylistInterface::RepeatMode ) ), m_audioControls, SLOT( onRepeatModeChanged( PlaylistInterface::RepeatMode ) ) ); diff --git a/src/tomahawkwindow.h b/src/tomahawkwindow.h index 95ea53302..ccb9abf6e 100644 --- a/src/tomahawkwindow.h +++ b/src/tomahawkwindow.h @@ -12,7 +12,6 @@ class QAction; class AudioControls; -class TopBar; class TomahawkTrayIcon; namespace Ui @@ -66,7 +65,6 @@ private: void setupSignals(); Ui::TomahawkWindow* ui; - TopBar* m_topbar; AudioControls* m_audioControls; TomahawkTrayIcon* m_trayIcon; QNetworkAccessManager m_nam;