1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-23 09:19:41 +01:00

remove usage of smartpointerlist

This commit is contained in:
Leo Franchi 2012-04-30 22:41:37 -04:00
parent 4b3682c1c5
commit 8392251280
9 changed files with 17 additions and 16 deletions

@ -124,7 +124,7 @@ SpotifyAccount::aboutToShow( QAction* action, const playlist_ptr& playlist )
// If it's not being synced, allow the option to sync
bool found = false;
SmartPointerList<PlaylistUpdaterInterface> updaters = playlist->updaters();
QList<PlaylistUpdaterInterface*> updaters = playlist->updaters();
foreach ( PlaylistUpdaterInterface* updater, updaters )
{
if ( SpotifyPlaylistUpdater* spotifyUpdater = qobject_cast< SpotifyPlaylistUpdater* >( updater ) )
@ -163,7 +163,7 @@ SpotifyAccount::syncActionTriggered( bool checked )
}
SpotifyPlaylistUpdater* updater = 0;
SmartPointerList<PlaylistUpdaterInterface> updaters = playlist->updaters();
QList<PlaylistUpdaterInterface*> updaters = playlist->updaters();
foreach ( PlaylistUpdaterInterface* u, updaters )
{
if ( SpotifyPlaylistUpdater* spotifyUpdater = qobject_cast< SpotifyPlaylistUpdater* >( u ) )

@ -34,7 +34,6 @@
#include "Query.h"
#include "DllMacro.h"
#include "utils/SmartPointerList.h"
class DatabaseCommand_LoadAllPlaylists;
class DatabaseCommand_LoadAllSortedPlaylists;
@ -192,7 +191,7 @@ public:
void addUpdater( PlaylistUpdaterInterface* updater );
void removeUpdater( PlaylistUpdaterInterface* updater );
SmartPointerList<PlaylistUpdaterInterface> updaters() const { return m_updaters; }
QList<PlaylistUpdaterInterface*> updaters() const { return m_updaters; }
Tomahawk::playlistinterface_ptr playlistInterface();
@ -302,7 +301,7 @@ private:
QQueue<RevisionQueueItem> m_revisionQueue;
QQueue<RevisionQueueItem> m_updateQueue;
SmartPointerList<PlaylistUpdaterInterface> m_updaters;
QList<PlaylistUpdaterInterface*> m_updaters;
bool m_locallyChanged;
bool m_deleted;

@ -25,7 +25,6 @@
#include "Artist.h"
#include "Album.h"
#include "utils/TomahawkUtils.h"
#include "utils/SmartPointerList.h"
#include "playlist/PlaylistUpdaterInterface.h"
#include <QtGui/QPixmap>
@ -70,7 +69,7 @@ public:
virtual bool isTemporaryPage() const { return false; }
virtual bool isBeingPlayed() const { return false; }
virtual SmartPointerList<PlaylistUpdaterInterface> updaters() const { return SmartPointerList<PlaylistUpdaterInterface>(); }
virtual QList<PlaylistUpdaterInterface*> updaters() const { return QList<PlaylistUpdaterInterface*>(); }
/** subclasses implementing ViewPage can emit the following signals:
* nameChanged( const QString& )

@ -201,7 +201,7 @@ InfoBar::setFilterAvailable( bool b )
void
InfoBar::setUpdaters( const SmartPointerList<PlaylistUpdaterInterface>& updaters )
InfoBar::setUpdaters( const QList<PlaylistUpdaterInterface*>& updaters )
{
QList< QWidget* > newUpdaterWidgets;
foreach ( PlaylistUpdaterInterface* updater, updaters )

@ -24,7 +24,6 @@
#include "DllMacro.h"
#include "Artist.h"
#include <utils/SmartPointerList.h>
class QueryLabel;
class QCheckBox;
@ -64,7 +63,7 @@ public slots:
void setFilter( const QString& filter );
void setFilterAvailable( bool b );
void setUpdaters( const SmartPointerList<Tomahawk::PlaylistUpdaterInterface>& updaters );
void setUpdaters( const QList<Tomahawk::PlaylistUpdaterInterface*>& updaters );
signals:
void filterTextChanged( const QString& filter );
@ -84,7 +83,7 @@ private:
QPixmap m_bgTile;
QPalette m_whitePal;
SmartPointerList<Tomahawk::PlaylistUpdaterInterface> m_updaters;;
QList<Tomahawk::PlaylistUpdaterInterface*> m_updaters;;
QList<QWidget*> m_updaterConfigurations;
QSearchField* m_searchWidget;

@ -109,13 +109,13 @@ PlaylistView::deleteItems()
}
SmartPointerList<PlaylistUpdaterInterface>
QList<PlaylistUpdaterInterface*>
PlaylistView::updaters() const
{
if ( !m_model->playlist().isNull() )
return m_model->playlist()->updaters();
return SmartPointerList<PlaylistUpdaterInterface>();
return QList<PlaylistUpdaterInterface*>();
}

@ -43,7 +43,7 @@ public:
virtual bool showFilter() const { return true; }
virtual SmartPointerList<Tomahawk::PlaylistUpdaterInterface> updaters() const;
virtual QList<Tomahawk::PlaylistUpdaterInterface*> updaters() const;
virtual QString title() const { return playlistModel()->title(); }
virtual QString description() const { return m_model->description(); }

@ -55,6 +55,11 @@ private slots:
* Exposed clear. This class doesn't have a QPtrList autodelete functionality
* ever, so if people think that, they're really confused! -- Ian Monroe
*
* NOTE:
* This class is NOT implicitly shared like QList. Passing it around
* ***will*** cause it to iterate and copy all the elements in the copy
* constructor!
*
*/
template <class T> class SmartPointerList : private QList<T*>
{

@ -21,7 +21,6 @@
#include "SourceTreeItem.h"
#include "playlist/dynamic/DynamicPlaylist.h"
#include "utils/SmartPointerList.h"
class PlaylistItem : public SourceTreeItem
{
@ -62,7 +61,7 @@ private:
bool m_loaded;
Tomahawk::playlist_ptr m_playlist;
QIcon m_icon, m_overlaidIcon;
SmartPointerList<Tomahawk::PlaylistUpdaterInterface> m_overlaidUpdaters;
QList<Tomahawk::PlaylistUpdaterInterface*> m_overlaidUpdaters;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(PlaylistItem::DropTypes)