From 8939af740761e2ff0b20203d2ddb4efeb2ce4941 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Sun, 19 Jun 2011 00:39:53 -0400 Subject: [PATCH] fix a bunch of warnings --- src/audiocontrols.cpp | 2 +- src/libtomahawk/infosystem/infoplugins/adiumplugin.h | 3 +-- src/libtomahawk/playlist/albumproxymodel.cpp | 4 ++-- .../playlist/dynamic/widgets/LoadingSpinner.cpp | 3 +++ src/libtomahawk/playlist/trackproxymodel.cpp | 4 ++-- src/libtomahawk/playlist/trackview.cpp | 5 ++++- src/libtomahawk/playlist/treeproxymodel.cpp | 5 +++-- src/libtomahawk/viewmanager.cpp | 2 -- src/sip/jabber/jabber.cpp | 3 ++- src/sourcetree/sourcesproxymodel.cpp | 7 +++++-- src/sourcetree/sourcetreeview.cpp | 1 - 11 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/audiocontrols.cpp b/src/audiocontrols.cpp index c94b6fa63..b6c77d682 100644 --- a/src/audiocontrols.cpp +++ b/src/audiocontrols.cpp @@ -49,7 +49,7 @@ AudioControls::AudioControls( QWidget* parent ) font.setPixelSize( 12 ); #ifdef Q_WS_MAC - font.setPointSize( font.pointSize() - 2 ); + font.setPixelSize( font.pixelSize() - 2 ); #endif ui->artistTrackLabel->setFont( font ); diff --git a/src/libtomahawk/infosystem/infoplugins/adiumplugin.h b/src/libtomahawk/infosystem/infoplugins/adiumplugin.h index 5f3153b35..76417fb74 100644 --- a/src/libtomahawk/infosystem/infoplugins/adiumplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/adiumplugin.h @@ -48,10 +48,9 @@ public slots: private slots: void clearStatus(); - -private: void settingsChanged(); +private: void audioStarted( const QVariant &input ); void audioFinished( const QVariant &input ); void audioStopped(); diff --git a/src/libtomahawk/playlist/albumproxymodel.cpp b/src/libtomahawk/playlist/albumproxymodel.cpp index 95a764e15..90541d5df 100644 --- a/src/libtomahawk/playlist/albumproxymodel.cpp +++ b/src/libtomahawk/playlist/albumproxymodel.cpp @@ -53,8 +53,8 @@ AlbumProxyModel::setSourceAlbumModel( AlbumModel* sourceModel ) { m_model = sourceModel; - connect( m_model, SIGNAL( trackCountChanged( unsigned int ) ), - SIGNAL( sourceTrackCountChanged( unsigned int ) ) ); + if ( m_model && m_model->metaObject()->indexOfSignal( "trackCountChanged(uint)" ) > -1 ) + connect( m_model, SIGNAL( trackCountChanged( unsigned int ) ), SIGNAL( sourceTrackCountChanged( unsigned int ) ) ); QSortFilterProxyModel::setSourceModel( sourceModel ); } diff --git a/src/libtomahawk/playlist/dynamic/widgets/LoadingSpinner.cpp b/src/libtomahawk/playlist/dynamic/widgets/LoadingSpinner.cpp index b1bd4efc2..e1a5d91a8 100644 --- a/src/libtomahawk/playlist/dynamic/widgets/LoadingSpinner.cpp +++ b/src/libtomahawk/playlist/dynamic/widgets/LoadingSpinner.cpp @@ -65,6 +65,9 @@ void LoadingSpinner::fadeOut() { m_showHide->setDirection( QTimeLine::Backward ); + if( m_showHide->state() == QTimeLine::Running ) + m_showHide->stop(); + m_showHide->start(); } diff --git a/src/libtomahawk/playlist/trackproxymodel.cpp b/src/libtomahawk/playlist/trackproxymodel.cpp index 224f995cb..07b1d9e48 100644 --- a/src/libtomahawk/playlist/trackproxymodel.cpp +++ b/src/libtomahawk/playlist/trackproxymodel.cpp @@ -57,8 +57,8 @@ TrackProxyModel::setSourceTrackModel( TrackModel* sourceModel ) { m_model = sourceModel; - connect( m_model, SIGNAL( trackCountChanged( unsigned int ) ), - SIGNAL( sourceTrackCountChanged( unsigned int ) ) ); + if ( m_model && m_model->metaObject()->indexOfSignal( "trackCountChanged(uint)" ) > -1 ) + connect( m_model, SIGNAL( trackCountChanged( unsigned int ) ), SIGNAL( sourceTrackCountChanged( unsigned int ) ) ); QSortFilterProxyModel::setSourceModel( m_model ); } diff --git a/src/libtomahawk/playlist/trackview.cpp b/src/libtomahawk/playlist/trackview.cpp index aa7a95886..2b0981b11 100644 --- a/src/libtomahawk/playlist/trackview.cpp +++ b/src/libtomahawk/playlist/trackview.cpp @@ -133,7 +133,10 @@ TrackView::setTrackModel( TrackModel* model ) m_proxyModel->setSourceTrackModel( m_model ); } - connect( m_model, SIGNAL( itemSizeChanged( QModelIndex ) ), SLOT( onItemResized( QModelIndex ) ) ); + + if ( m_model && m_model->metaObject()->indexOfSignal( "itemSizeChanged(QModelIndex)" ) > -1 ) + connect( m_model, SIGNAL( itemSizeChanged( QModelIndex ) ), SLOT( onItemResized( QModelIndex ) ) ); + connect( m_model, SIGNAL( loadingStarted() ), m_loadingSpinner, SLOT( fadeIn() ) ); connect( m_model, SIGNAL( loadingFinished() ), m_loadingSpinner, SLOT( fadeOut() ) ); diff --git a/src/libtomahawk/playlist/treeproxymodel.cpp b/src/libtomahawk/playlist/treeproxymodel.cpp index 82570805d..0d20e9d4b 100644 --- a/src/libtomahawk/playlist/treeproxymodel.cpp +++ b/src/libtomahawk/playlist/treeproxymodel.cpp @@ -46,8 +46,9 @@ TreeProxyModel::setSourceModel( TreeModel* sourceModel ) { m_model = sourceModel; - connect( m_model, SIGNAL( trackCountChanged( unsigned int ) ), - SIGNAL( sourceTrackCountChanged( unsigned int ) ) ); + if ( m_model && m_model->metaObject()->indexOfSignal( "trackCountChanged(uint)" ) > -1 ) + connect( m_model, SIGNAL( trackCountChanged( unsigned int ) ), SIGNAL( sourceTrackCountChanged( unsigned int ) ) ); + QSortFilterProxyModel::setSourceModel( sourceModel ); } diff --git a/src/libtomahawk/viewmanager.cpp b/src/libtomahawk/viewmanager.cpp index d08089da8..1e14db964 100644 --- a/src/libtomahawk/viewmanager.cpp +++ b/src/libtomahawk/viewmanager.cpp @@ -198,8 +198,6 @@ ViewManager::show( const Tomahawk::dynplaylist_ptr& playlist ) { m_dynamicWidgets[ playlist ] = new Tomahawk::DynamicWidget( playlist, m_stack ); - connect( playlist.data(), SIGNAL( deleted( Tomahawk::dynplaylist_ptr ) ), this, SLOT( onDynamicDeleted( Tomahawk::dynplaylist_ptr ) ) ); - playlist->resolve(); } diff --git a/src/sip/jabber/jabber.cpp b/src/sip/jabber/jabber.cpp index 77d5b04ff..e1b239536 100644 --- a/src/sip/jabber/jabber.cpp +++ b/src/sip/jabber/jabber.cpp @@ -232,7 +232,8 @@ JabberPlugin::connectPlugin( bool startup ) //FIXME: we're badly workarounding some missing reconnection api here, to be fixed soon QTimer::singleShot( 1000, m_client, SLOT( connectToServer() ) ); - connect(m_client->connection(), SIGNAL(error(SocketError)), SLOT(onError(SocketError))); + if ( m_client->connection() ) + connect(m_client->connection(), SIGNAL(error(SocketError)), SLOT(onError(SocketError))); m_state = Connecting; emit stateChanged( m_state ); diff --git a/src/sourcetree/sourcesproxymodel.cpp b/src/sourcetree/sourcesproxymodel.cpp index b778d5c31..094238688 100644 --- a/src/sourcetree/sourcesproxymodel.cpp +++ b/src/sourcetree/sourcesproxymodel.cpp @@ -35,8 +35,11 @@ SourcesProxyModel::SourcesProxyModel( SourcesModel* model, QObject* parent ) setSourceModel( model ); - connect( model, SIGNAL( askForExpand( QModelIndex ) ), this, SLOT( askedToExpand( QModelIndex ) ) ); - connect( model, SIGNAL( selectRequest( QModelIndex ) ), this, SLOT( selectRequested( QModelIndex ) ) ); + + if ( model && model->metaObject()->indexOfSignal( "trackCountChanged(QModelIndex)" ) > -1 ) + connect( model, SIGNAL( askForExpand( QModelIndex ) ), this, SLOT( askedToExpand( QModelIndex ) ) ); + if ( model && model->metaObject()->indexOfSignal( "selectRequest(QModelIndex)" ) > -1 ) + connect( model, SIGNAL( selectRequest( QModelIndex ) ), this, SLOT( selectRequested( QModelIndex ) ) ); } diff --git a/src/sourcetree/sourcetreeview.cpp b/src/sourcetree/sourcetreeview.cpp index ee36708b2..817105f1d 100644 --- a/src/sourcetree/sourcetreeview.cpp +++ b/src/sourcetree/sourcetreeview.cpp @@ -106,7 +106,6 @@ SourceTreeView::SourceTreeView( QWidget* parent ) header()->setStretchLastSection( false ); header()->setResizeMode( 0, QHeaderView::Stretch ); - connect( m_model, SIGNAL( clicked( QModelIndex ) ), SIGNAL( clicked( QModelIndex ) ) ); connect( this, SIGNAL( clicked( QModelIndex ) ), SLOT( onItemActivated( QModelIndex ) ) ); connect( this, SIGNAL( expanded( QModelIndex ) ), this, SLOT( onItemExpanded( QModelIndex ) ) ); // connect( selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), SLOT( onSelectionChanged() ) );