mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-27 21:39:37 +00:00
Book::Illustration::getData()
This commit is contained in:
16
src/book.cpp
16
src/book.cpp
@ -226,16 +226,20 @@ Book::Illustration& Book::getMutableDefaultIllustration()
|
||||
return m_illustration;
|
||||
}
|
||||
|
||||
const std::string& Book::getFavicon() const {
|
||||
const Illustration& favicon = getDefaultIllustration();
|
||||
if (favicon.data.empty() && !favicon.url.empty()) {
|
||||
const std::string& Book::Illustration::getData() const
|
||||
{
|
||||
if (data.empty() && !url.empty()) {
|
||||
try {
|
||||
favicon.data = download(favicon.url);
|
||||
data = download(url);
|
||||
} catch(...) {
|
||||
std::cerr << "Cannot download favicon from " << favicon.url;
|
||||
std::cerr << "Cannot download favicon from " << url;
|
||||
}
|
||||
}
|
||||
return favicon.data;
|
||||
return data;
|
||||
}
|
||||
|
||||
const std::string& Book::getFavicon() const {
|
||||
return getDefaultIllustration().getData();
|
||||
}
|
||||
|
||||
const std::string& Book::getFaviconUrl() const
|
||||
|
Reference in New Issue
Block a user