From 1f5a3d8d259377fb4bf4e9b2b0148a3c55cd56b1 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sat, 11 Oct 2014 19:09:47 +0100 Subject: [PATCH] Remove virtual keyword from some functions. These functions are not overloaded at the moment in any child class but some of them are called very often which adds a significant overhead. If really needed they should be reverted to virtual when we actually overload them. --- src/libtomahawk/playlist/PlayableProxyModel.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libtomahawk/playlist/PlayableProxyModel.h b/src/libtomahawk/playlist/PlayableProxyModel.h index 6f53995ca..f4b3ee802 100644 --- a/src/libtomahawk/playlist/PlayableProxyModel.h +++ b/src/libtomahawk/playlist/PlayableProxyModel.h @@ -43,7 +43,7 @@ public: virtual QString guid() const; - virtual PlayableModel* sourceModel() const { return m_model; } + PlayableModel* sourceModel() const { return m_model; } virtual void setSourcePlayableModel( PlayableModel* sourceModel ); virtual void setSourceModel( QAbstractItemModel* model ); @@ -59,18 +59,18 @@ public: virtual void removeIndexes( const QModelIndexList& indexes ); virtual void removeIndexes( const QList< QPersistentModelIndex >& indexes ); - virtual bool showOfflineResults() const { return m_showOfflineResults; } - virtual void setShowOfflineResults( bool b ); + bool showOfflineResults() const { return m_showOfflineResults; } + void setShowOfflineResults( bool b ); - virtual bool hideDupeItems() const { return m_hideDupeItems; } - virtual void setHideDupeItems( bool b ); + bool hideDupeItems() const { return m_hideDupeItems; } + void setHideDupeItems( bool b ); - virtual int maxVisibleItems() const { return m_maxVisibleItems; } - virtual void setMaxVisibleItems( int items ); + int maxVisibleItems() const { return m_maxVisibleItems; } + void setMaxVisibleItems( int items ); - virtual PlayableItem* itemFromIndex( const QModelIndex& index ) const { return sourceModel()->itemFromIndex( index ); } - virtual PlayableItem* itemFromQuery( const Tomahawk::query_ptr& query ) const { return sourceModel()->itemFromQuery( query ); } - virtual PlayableItem* itemFromResult( const Tomahawk::result_ptr& result ) const { return sourceModel()->itemFromResult( result ); } + PlayableItem* itemFromIndex( const QModelIndex& index ) const { return sourceModel()->itemFromIndex( index ); } + PlayableItem* itemFromQuery( const Tomahawk::query_ptr& query ) const { return sourceModel()->itemFromQuery( query ); } + PlayableItem* itemFromResult( const Tomahawk::result_ptr& result ) const { return sourceModel()->itemFromResult( result ); } virtual Tomahawk::playlistinterface_ptr playlistInterface() const; void setPlaylistInterface( const Tomahawk::playlistinterface_ptr& playlistInterface ); @@ -103,7 +103,7 @@ signals: void selectRequest( const QPersistentModelIndex& index ); protected: - virtual bool filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const; + bool filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const Q_DECL_OVERRIDE; virtual bool lessThan( const QModelIndex& left, const QModelIndex& right ) const; Tomahawk::playlistinterface_ptr m_playlistInterface;