pass ProxySongList around since it already has shared_ptr inside

This commit is contained in:
Andrzej Rybczak
2012-09-16 07:13:54 +02:00
parent ddd18681ba
commit 48cf01f084
19 changed files with 83 additions and 89 deletions

View File

@@ -38,13 +38,13 @@ inline HasSongs *hasSongs(BaseScreen *screen)
return dynamic_cast<HasSongs *>(screen);
}
inline std::shared_ptr<ProxySongList> proxySongList(BaseScreen *screen)
inline ProxySongList proxySongList(BaseScreen *screen)
{
auto ptr = nullProxySongList();
auto pl = ProxySongList();
auto hs = hasSongs(screen);
if (hs)
ptr = hs->getProxySongList();
return ptr;
pl = hs->proxySongList();
return pl;
}
inline MPD::Song *currentSong(BaseScreen *screen)
@@ -52,7 +52,7 @@ inline MPD::Song *currentSong(BaseScreen *screen)
MPD::Song *ptr = 0;
auto pl = proxySongList(screen);
if (pl)
ptr = pl->currentSong();
ptr = pl.currentSong();
return ptr;
}
@@ -471,7 +471,7 @@ bool addSongsToPlaylist(const MPD::SongList &list, bool play, size_t position =
std::string Timestamp(time_t t);
void markSongsInPlaylist(std::shared_ptr<ProxySongList> pl);
void markSongsInPlaylist(ProxySongList pl);
std::wstring Scroller(const std::wstring &str, size_t &pos, size_t width);