From a8a8218e93af223bdbefd118622ebd2cf1ea4ede Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 9 Jul 2012 09:54:18 -0400 Subject: [PATCH] Cleanup --- src/libtomahawk/TomahawkSettings.cpp | 2 +- src/libtomahawk/jobview/JobStatusModel.cpp | 32 ---------------------- src/libtomahawk/jobview/JobStatusModel.h | 4 --- src/libtomahawk/jobview/JobStatusView.cpp | 6 ++-- 4 files changed, 4 insertions(+), 40 deletions(-) diff --git a/src/libtomahawk/TomahawkSettings.cpp b/src/libtomahawk/TomahawkSettings.cpp index 54082f4aa..0b90f4dc0 100644 --- a/src/libtomahawk/TomahawkSettings.cpp +++ b/src/libtomahawk/TomahawkSettings.cpp @@ -1305,7 +1305,7 @@ TomahawkSettings::updateIndex() DatabaseCommand* cmd = new DatabaseCommand_UpdateSearchIndex(); Database::instance()->enqueue( QSharedPointer( cmd ) ); - QTimer::singleShot( 2000, this, SLOT( updateIndex() ) ); + QTimer::singleShot( 5000, this, SLOT( updateIndex() ) ); } diff --git a/src/libtomahawk/jobview/JobStatusModel.cpp b/src/libtomahawk/jobview/JobStatusModel.cpp index 42a089f28..64ec73c05 100644 --- a/src/libtomahawk/jobview/JobStatusModel.cpp +++ b/src/libtomahawk/jobview/JobStatusModel.cpp @@ -44,10 +44,6 @@ JobStatusSortModel::setJobModel( JobStatusModel* model ) m_sourceModel = model; - connect( m_sourceModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( rowsInsertedSlot( QModelIndex, int, int ) ) ); - connect( m_sourceModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( rowsRemovedSlot( QModelIndex, int, int ) ) ); - connect( m_sourceModel, SIGNAL( modelReset() ), this, SLOT( modelResetSlot() ) ); - connect( m_sourceModel, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SLOT( dataChangedSlot( QModelIndex, QModelIndex ) ) ); connect( m_sourceModel, SIGNAL( customDelegateJobInserted( int, JobStatusItem* ) ), this, SLOT( customDelegateJobInsertedSlot( int, JobStatusItem* ) ) ); connect( m_sourceModel, SIGNAL( customDelegateJobRemoved( int ) ), this, SLOT( customDelegateJobRemovedSlot( int ) ) ); connect( m_sourceModel, SIGNAL( refreshDelegates() ), this, SLOT( refreshDelegatesSlot() ) ); @@ -61,34 +57,6 @@ JobStatusSortModel::addJob( JobStatusItem* item ) } -void -JobStatusSortModel::rowsInsertedSlot( const QModelIndex& index, int start, int end ) -{ - emit checkCount(); -} - - -void -JobStatusSortModel::rowsRemovedSlot( const QModelIndex& index, int start, int end ) -{ - emit checkCount(); -} - - -void -JobStatusSortModel::modelResetSlot() -{ - emit checkCount(); -} - - -void -JobStatusSortModel::dataChangedSlot( const QModelIndex& topLeft, const QModelIndex& bottomRight ) -{ - emit dataChanged( mapFromSource( topLeft ), mapFromSource( bottomRight ) ); -} - - void JobStatusSortModel::customDelegateJobInsertedSlot( int row, JobStatusItem* item ) { diff --git a/src/libtomahawk/jobview/JobStatusModel.h b/src/libtomahawk/jobview/JobStatusModel.h index 41c5652c7..dc4d80ca5 100644 --- a/src/libtomahawk/jobview/JobStatusModel.h +++ b/src/libtomahawk/jobview/JobStatusModel.h @@ -85,10 +85,6 @@ signals: public slots: void addJob( JobStatusItem* item ); - void rowsInsertedSlot( const QModelIndex& index, int start, int end ); - void rowsRemovedSlot( const QModelIndex& index, int start, int end ); - void modelResetSlot(); - void dataChangedSlot( const QModelIndex& topLeft, const QModelIndex& bottomRight ); void customDelegateJobInsertedSlot( int row, JobStatusItem* item); void customDelegateJobRemovedSlot( int row ); void refreshDelegatesSlot(); diff --git a/src/libtomahawk/jobview/JobStatusView.cpp b/src/libtomahawk/jobview/JobStatusView.cpp index c845a5a08..26254ebff 100644 --- a/src/libtomahawk/jobview/JobStatusView.cpp +++ b/src/libtomahawk/jobview/JobStatusView.cpp @@ -89,9 +89,9 @@ JobStatusView::setModel( JobStatusSortModel* m ) m_view->setModel( m ); m_view->setItemDelegate( new JobStatusDelegate( m_view ) ); - connect( m_view->model(), SIGNAL( checkCount() ), this, SLOT( checkCount() ) ); - connect( m_view->model(), SIGNAL( checkCount() ), this, SLOT( checkCount() ) ); - connect( m_view->model(), SIGNAL( checkCount() ), this, SLOT( checkCount() ) ); + connect( m_view->model(), SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( checkCount() ) ); + connect( m_view->model(), SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( checkCount() ) ); + connect( m_view->model(), SIGNAL( modelReset() ), this, SLOT( checkCount() ) ); connect( m_view->model(), SIGNAL( customDelegateJobInserted( int, JobStatusItem* ) ), this, SLOT( customDelegateJobInserted( int, JobStatusItem* ) ) ); connect( m_view->model(), SIGNAL( customDelegateJobRemoved( int ) ), this, SLOT( customDelegateJobRemoved( int ) ) ); connect( m_view->model(), SIGNAL( refreshDelegates() ), this, SLOT( refreshDelegates() ) );