fix compilation --without-curl
This commit is contained in:
@@ -103,9 +103,11 @@ void Lyrics::SwitchTo()
|
|||||||
|
|
||||||
itsScrollBegin = 0;
|
itsScrollBegin = 0;
|
||||||
|
|
||||||
|
# ifdef HAVE_CURL_CURL_H
|
||||||
// take lyrics if they were downloaded
|
// take lyrics if they were downloaded
|
||||||
if (isReadyToTake)
|
if (isReadyToTake)
|
||||||
Take();
|
Take();
|
||||||
|
# endif // HAVE_CURL_CURL_H
|
||||||
|
|
||||||
if (const MPD::Song *s = myScreen->CurrentSong())
|
if (const MPD::Song *s = myScreen->CurrentSong())
|
||||||
{
|
{
|
||||||
@@ -255,7 +257,7 @@ void Lyrics::Load()
|
|||||||
pthread_create(&itsDownloader, 0, DownloadWrapper, this);
|
pthread_create(&itsDownloader, 0, DownloadWrapper, this);
|
||||||
isDownloadInProgress = 1;
|
isDownloadInProgress = 1;
|
||||||
# else
|
# 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();
|
w->Flush();
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
@@ -287,6 +289,7 @@ void Lyrics::Edit()
|
|||||||
system(("nohup " + Config.external_editor + " \"" + itsFilename + "\" > /dev/null 2>&1 &").c_str());
|
system(("nohup " + Config.external_editor + " \"" + itsFilename + "\" > /dev/null 2>&1 &").c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_CURL_CURL_H
|
||||||
void Lyrics::Save(const std::string &lyrics)
|
void Lyrics::Save(const std::string &lyrics)
|
||||||
{
|
{
|
||||||
std::ofstream output(itsFilename.c_str());
|
std::ofstream output(itsFilename.c_str());
|
||||||
@@ -296,6 +299,7 @@ void Lyrics::Save(const std::string &lyrics)
|
|||||||
output.close();
|
output.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // HAVE_CURL_CURL_H
|
||||||
|
|
||||||
void Lyrics::Refetch()
|
void Lyrics::Refetch()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -140,10 +140,13 @@ namespace
|
|||||||
mySearcher->hasToBeResized = 1;
|
mySearcher->hasToBeResized = 1;
|
||||||
myLibrary->hasToBeResized = 1;
|
myLibrary->hasToBeResized = 1;
|
||||||
myPlaylistEditor->hasToBeResized = 1;
|
myPlaylistEditor->hasToBeResized = 1;
|
||||||
myLastfm->hasToBeResized = 1;
|
|
||||||
myLyrics->hasToBeResized = 1;
|
myLyrics->hasToBeResized = 1;
|
||||||
mySelectedItemsAdder->hasToBeResized = 1;
|
mySelectedItemsAdder->hasToBeResized = 1;
|
||||||
|
|
||||||
|
# ifdef HAVE_CURL_CURL_H
|
||||||
|
myLastfm->hasToBeResized = 1;
|
||||||
|
# endif // HAVE_CURL_CURL_H
|
||||||
|
|
||||||
# ifdef HAVE_TAGLIB_H
|
# ifdef HAVE_TAGLIB_H
|
||||||
myTinyTagEditor->hasToBeResized = 1;
|
myTinyTagEditor->hasToBeResized = 1;
|
||||||
myTagEditor->hasToBeResized = 1;
|
myTagEditor->hasToBeResized = 1;
|
||||||
@@ -1941,7 +1944,11 @@ int main(int argc, char *argv[])
|
|||||||
if (myScreen == myPlaylist)
|
if (myScreen == myPlaylist)
|
||||||
myPlaylist->EnableHighlighting();
|
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();
|
LockStatusbar();
|
||||||
Statusbar() << "Find: ";
|
Statusbar() << "Find: ";
|
||||||
@@ -2084,10 +2091,12 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
myLyrics->Refetch();
|
myLyrics->Refetch();
|
||||||
}
|
}
|
||||||
|
# ifdef HAVE_CURL_CURL_H
|
||||||
else if (myScreen == myLastfm)
|
else if (myScreen == myLastfm)
|
||||||
{
|
{
|
||||||
myLastfm->Refetch();
|
myLastfm->Refetch();
|
||||||
}
|
}
|
||||||
|
# endif // HAVE_CURL_CURL_H
|
||||||
}
|
}
|
||||||
else if (Keypressed(input, Key.SongInfo))
|
else if (Keypressed(input, Key.SongInfo))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user