fix switching to artist info screen

if one switched from artist info screen while artist info was being
downloaded, {s,}he wouldn't be able to enter the screen again.
This commit is contained in:
Andrzej Rybczak
2010-08-29 02:13:09 +02:00
parent fa027bbcc9
commit f90176ffee
3 changed files with 3 additions and 2 deletions

View File

@@ -214,7 +214,7 @@ void Lastfm::Refetch()
bool Lastfm::SetArtistInfoArgs(const std::string &artist, const std::string &lang) bool Lastfm::SetArtistInfoArgs(const std::string &artist, const std::string &lang)
{ {
if (isDownloadInProgress) if (isDownloading())
return false; return false;
itsService.reset(new ArtistInfo); itsService.reset(new ArtistInfo);

View File

@@ -53,6 +53,7 @@ class Lastfm : public Screen<Scrollpad>
void Refetch(); void Refetch();
bool isDownloading() { return isDownloadInProgress && !isReadyToTake; }
bool SetArtistInfoArgs(const std::string &artist, const std::string &lang = ""); bool SetArtistInfoArgs(const std::string &artist, const std::string &lang = "");
protected: protected:

View File

@@ -2142,7 +2142,7 @@ int main(int argc, char *argv[])
# ifdef HAVE_CURL_CURL_H # ifdef HAVE_CURL_CURL_H
else if (Keypressed(input, Key.ArtistInfo)) else if (Keypressed(input, Key.ArtistInfo))
{ {
if (myScreen == myLastfm) if (myScreen == myLastfm || myLastfm->isDownloading())
{ {
myLastfm->SwitchTo(); myLastfm->SwitchTo();
continue; continue;