mirror of https://github.com/kiwix/libkiwix.git
Book's illustrations are now immutable
This commit is contained in:
parent
8a6adddc16
commit
9f42884507
|
@ -142,7 +142,7 @@ class Book
|
|||
uint64_t m_mediaCount = 0;
|
||||
bool m_readOnly = false;
|
||||
uint64_t m_size = 0;
|
||||
std::vector<std::shared_ptr<Illustration>> m_illustrations;
|
||||
std::vector<std::shared_ptr<const Illustration>> m_illustrations;
|
||||
|
||||
// Used as the return value of getDefaultIllustration() when no default
|
||||
// illustration is found in the book
|
||||
|
|
|
@ -73,11 +73,7 @@ bool Book::update(const kiwix::Book& other)
|
|||
m_articleCount = other.m_articleCount;
|
||||
m_mediaCount = other.m_mediaCount;
|
||||
m_size = other.m_size;
|
||||
m_illustrations.clear();
|
||||
for ( const auto& ill : other.m_illustrations ) {
|
||||
m_illustrations.push_back(std::make_shared<Illustration>(*ill));
|
||||
}
|
||||
|
||||
m_illustrations = other.m_illustrations;
|
||||
m_downloadId = other.m_downloadId;
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue