fix compilation --without-curl

master
Andrzej Rybczak 16 years ago
parent 6cc12a8da6
commit 1381a45d06
  1. 6
      src/lyrics.cpp
  2. 13
      src/ncmpcpp.cpp

@ -103,9 +103,11 @@ void Lyrics::SwitchTo()
itsScrollBegin = 0;
# ifdef HAVE_CURL_CURL_H
// take lyrics if they were downloaded
if (isReadyToTake)
Take();
# endif // HAVE_CURL_CURL_H
if (const MPD::Song *s = myScreen->CurrentSong())
{
@ -255,7 +257,7 @@ void Lyrics::Load()
pthread_create(&itsDownloader, 0, DownloadWrapper, this);
isDownloadInProgress = 1;
# else
*w << "Local lyrics not found. As ncmpcpp has been compiled without curl support, you can put appropriate lyrics into " << Folder << " directory (file syntax is \"$ARTIST - $TITLE.txt\") or recompile ncmpcpp with curl support.";
*w << "Local lyrics not found. As ncmpcpp has been compiled without curl support, you can put appropriate lyrics into " << itsFolder << " directory (file syntax is \"$ARTIST - $TITLE.txt\") or recompile ncmpcpp with curl support.";
w->Flush();
# endif
}
@ -287,6 +289,7 @@ void Lyrics::Edit()
system(("nohup " + Config.external_editor + " \"" + itsFilename + "\" > /dev/null 2>&1 &").c_str());
}
#ifdef HAVE_CURL_CURL_H
void Lyrics::Save(const std::string &lyrics)
{
std::ofstream output(itsFilename.c_str());
@ -296,6 +299,7 @@ void Lyrics::Save(const std::string &lyrics)
output.close();
}
}
#endif // HAVE_CURL_CURL_H
void Lyrics::Refetch()
{

@ -140,10 +140,13 @@ namespace
mySearcher->hasToBeResized = 1;
myLibrary->hasToBeResized = 1;
myPlaylistEditor->hasToBeResized = 1;
myLastfm->hasToBeResized = 1;
myLyrics->hasToBeResized = 1;
mySelectedItemsAdder->hasToBeResized = 1;
# ifdef HAVE_CURL_CURL_H
myLastfm->hasToBeResized = 1;
# endif // HAVE_CURL_CURL_H
# ifdef HAVE_TAGLIB_H
myTinyTagEditor->hasToBeResized = 1;
myTagEditor->hasToBeResized = 1;
@ -1941,7 +1944,11 @@ int main(int argc, char *argv[])
if (myScreen == myPlaylist)
myPlaylist->EnableHighlighting();
}
else if (myScreen == myHelp || myScreen == myLyrics || myScreen == myLastfm)
else if (myScreen == myHelp || myScreen == myLyrics
# ifdef HAVE_CURL_CURL_H
|| myScreen == myLastfm
# endif // HAVE_CURL_CURL_H
)
{
LockStatusbar();
Statusbar() << "Find: ";
@ -2084,10 +2091,12 @@ int main(int argc, char *argv[])
{
myLyrics->Refetch();
}
# ifdef HAVE_CURL_CURL_H
else if (myScreen == myLastfm)
{
myLastfm->Refetch();
}
# endif // HAVE_CURL_CURL_H
}
else if (Keypressed(input, Key.SongInfo))
{

Loading…
Cancel
Save