mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
remove usage of smartpointerlist
This commit is contained in:
@@ -124,7 +124,7 @@ SpotifyAccount::aboutToShow( QAction* action, const playlist_ptr& playlist )
|
|||||||
|
|
||||||
// If it's not being synced, allow the option to sync
|
// If it's not being synced, allow the option to sync
|
||||||
bool found = false;
|
bool found = false;
|
||||||
SmartPointerList<PlaylistUpdaterInterface> updaters = playlist->updaters();
|
QList<PlaylistUpdaterInterface*> updaters = playlist->updaters();
|
||||||
foreach ( PlaylistUpdaterInterface* updater, updaters )
|
foreach ( PlaylistUpdaterInterface* updater, updaters )
|
||||||
{
|
{
|
||||||
if ( SpotifyPlaylistUpdater* spotifyUpdater = qobject_cast< SpotifyPlaylistUpdater* >( updater ) )
|
if ( SpotifyPlaylistUpdater* spotifyUpdater = qobject_cast< SpotifyPlaylistUpdater* >( updater ) )
|
||||||
@@ -163,7 +163,7 @@ SpotifyAccount::syncActionTriggered( bool checked )
|
|||||||
}
|
}
|
||||||
|
|
||||||
SpotifyPlaylistUpdater* updater = 0;
|
SpotifyPlaylistUpdater* updater = 0;
|
||||||
SmartPointerList<PlaylistUpdaterInterface> updaters = playlist->updaters();
|
QList<PlaylistUpdaterInterface*> updaters = playlist->updaters();
|
||||||
foreach ( PlaylistUpdaterInterface* u, updaters )
|
foreach ( PlaylistUpdaterInterface* u, updaters )
|
||||||
{
|
{
|
||||||
if ( SpotifyPlaylistUpdater* spotifyUpdater = qobject_cast< SpotifyPlaylistUpdater* >( u ) )
|
if ( SpotifyPlaylistUpdater* spotifyUpdater = qobject_cast< SpotifyPlaylistUpdater* >( u ) )
|
||||||
|
@@ -34,7 +34,6 @@
|
|||||||
#include "Query.h"
|
#include "Query.h"
|
||||||
|
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "utils/SmartPointerList.h"
|
|
||||||
|
|
||||||
class DatabaseCommand_LoadAllPlaylists;
|
class DatabaseCommand_LoadAllPlaylists;
|
||||||
class DatabaseCommand_LoadAllSortedPlaylists;
|
class DatabaseCommand_LoadAllSortedPlaylists;
|
||||||
@@ -192,7 +191,7 @@ public:
|
|||||||
|
|
||||||
void addUpdater( PlaylistUpdaterInterface* updater );
|
void addUpdater( PlaylistUpdaterInterface* updater );
|
||||||
void removeUpdater( PlaylistUpdaterInterface* updater );
|
void removeUpdater( PlaylistUpdaterInterface* updater );
|
||||||
SmartPointerList<PlaylistUpdaterInterface> updaters() const { return m_updaters; }
|
QList<PlaylistUpdaterInterface*> updaters() const { return m_updaters; }
|
||||||
|
|
||||||
Tomahawk::playlistinterface_ptr playlistInterface();
|
Tomahawk::playlistinterface_ptr playlistInterface();
|
||||||
|
|
||||||
@@ -302,7 +301,7 @@ private:
|
|||||||
QQueue<RevisionQueueItem> m_revisionQueue;
|
QQueue<RevisionQueueItem> m_revisionQueue;
|
||||||
QQueue<RevisionQueueItem> m_updateQueue;
|
QQueue<RevisionQueueItem> m_updateQueue;
|
||||||
|
|
||||||
SmartPointerList<PlaylistUpdaterInterface> m_updaters;
|
QList<PlaylistUpdaterInterface*> m_updaters;
|
||||||
|
|
||||||
bool m_locallyChanged;
|
bool m_locallyChanged;
|
||||||
bool m_deleted;
|
bool m_deleted;
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
#include "Artist.h"
|
#include "Artist.h"
|
||||||
#include "Album.h"
|
#include "Album.h"
|
||||||
#include "utils/TomahawkUtils.h"
|
#include "utils/TomahawkUtils.h"
|
||||||
#include "utils/SmartPointerList.h"
|
|
||||||
#include "playlist/PlaylistUpdaterInterface.h"
|
#include "playlist/PlaylistUpdaterInterface.h"
|
||||||
|
|
||||||
#include <QtGui/QPixmap>
|
#include <QtGui/QPixmap>
|
||||||
@@ -70,7 +69,7 @@ public:
|
|||||||
virtual bool isTemporaryPage() const { return false; }
|
virtual bool isTemporaryPage() const { return false; }
|
||||||
virtual bool isBeingPlayed() 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:
|
/** subclasses implementing ViewPage can emit the following signals:
|
||||||
* nameChanged( const QString& )
|
* nameChanged( const QString& )
|
||||||
|
@@ -201,7 +201,7 @@ InfoBar::setFilterAvailable( bool b )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
InfoBar::setUpdaters( const SmartPointerList<PlaylistUpdaterInterface>& updaters )
|
InfoBar::setUpdaters( const QList<PlaylistUpdaterInterface*>& updaters )
|
||||||
{
|
{
|
||||||
QList< QWidget* > newUpdaterWidgets;
|
QList< QWidget* > newUpdaterWidgets;
|
||||||
foreach ( PlaylistUpdaterInterface* updater, updaters )
|
foreach ( PlaylistUpdaterInterface* updater, updaters )
|
||||||
|
@@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "Artist.h"
|
#include "Artist.h"
|
||||||
#include <utils/SmartPointerList.h>
|
|
||||||
|
|
||||||
class QueryLabel;
|
class QueryLabel;
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
@@ -64,7 +63,7 @@ public slots:
|
|||||||
void setFilter( const QString& filter );
|
void setFilter( const QString& filter );
|
||||||
void setFilterAvailable( bool b );
|
void setFilterAvailable( bool b );
|
||||||
|
|
||||||
void setUpdaters( const SmartPointerList<Tomahawk::PlaylistUpdaterInterface>& updaters );
|
void setUpdaters( const QList<Tomahawk::PlaylistUpdaterInterface*>& updaters );
|
||||||
signals:
|
signals:
|
||||||
void filterTextChanged( const QString& filter );
|
void filterTextChanged( const QString& filter );
|
||||||
|
|
||||||
@@ -84,7 +83,7 @@ private:
|
|||||||
QPixmap m_bgTile;
|
QPixmap m_bgTile;
|
||||||
QPalette m_whitePal;
|
QPalette m_whitePal;
|
||||||
|
|
||||||
SmartPointerList<Tomahawk::PlaylistUpdaterInterface> m_updaters;;
|
QList<Tomahawk::PlaylistUpdaterInterface*> m_updaters;;
|
||||||
QList<QWidget*> m_updaterConfigurations;
|
QList<QWidget*> m_updaterConfigurations;
|
||||||
|
|
||||||
QSearchField* m_searchWidget;
|
QSearchField* m_searchWidget;
|
||||||
|
@@ -109,13 +109,13 @@ PlaylistView::deleteItems()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SmartPointerList<PlaylistUpdaterInterface>
|
QList<PlaylistUpdaterInterface*>
|
||||||
PlaylistView::updaters() const
|
PlaylistView::updaters() const
|
||||||
{
|
{
|
||||||
if ( !m_model->playlist().isNull() )
|
if ( !m_model->playlist().isNull() )
|
||||||
return m_model->playlist()->updaters();
|
return m_model->playlist()->updaters();
|
||||||
|
|
||||||
return SmartPointerList<PlaylistUpdaterInterface>();
|
return QList<PlaylistUpdaterInterface*>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ public:
|
|||||||
|
|
||||||
virtual bool showFilter() const { return true; }
|
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 title() const { return playlistModel()->title(); }
|
||||||
virtual QString description() const { return m_model->description(); }
|
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
|
* Exposed clear. This class doesn't have a QPtrList autodelete functionality
|
||||||
* ever, so if people think that, they're really confused! -- Ian Monroe
|
* 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*>
|
template <class T> class SmartPointerList : private QList<T*>
|
||||||
{
|
{
|
||||||
|
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
#include "SourceTreeItem.h"
|
#include "SourceTreeItem.h"
|
||||||
#include "playlist/dynamic/DynamicPlaylist.h"
|
#include "playlist/dynamic/DynamicPlaylist.h"
|
||||||
#include "utils/SmartPointerList.h"
|
|
||||||
|
|
||||||
class PlaylistItem : public SourceTreeItem
|
class PlaylistItem : public SourceTreeItem
|
||||||
{
|
{
|
||||||
@@ -62,7 +61,7 @@ private:
|
|||||||
bool m_loaded;
|
bool m_loaded;
|
||||||
Tomahawk::playlist_ptr m_playlist;
|
Tomahawk::playlist_ptr m_playlist;
|
||||||
QIcon m_icon, m_overlaidIcon;
|
QIcon m_icon, m_overlaidIcon;
|
||||||
SmartPointerList<Tomahawk::PlaylistUpdaterInterface> m_overlaidUpdaters;
|
QList<Tomahawk::PlaylistUpdaterInterface*> m_overlaidUpdaters;
|
||||||
};
|
};
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(PlaylistItem::DropTypes)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(PlaylistItem::DropTypes)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user