mirror of https://github.com/kiwix/libkiwix.git
+ fix in ro library mgmt
This commit is contained in:
parent
c80914b774
commit
435e7ac76f
|
@ -91,35 +91,36 @@ namespace kiwix {
|
||||||
/* Try to find it */
|
/* Try to find it */
|
||||||
std::vector<kiwix::Book>::iterator itr;
|
std::vector<kiwix::Book>::iterator itr;
|
||||||
for ( itr = this->books.begin(); itr != this->books.end(); ++itr ) {
|
for ( itr = this->books.begin(); itr != this->books.end(); ++itr ) {
|
||||||
if (itr->id == book.id && (itr->readOnly == book.readOnly || book.readOnly)) {
|
if (itr->id == book.id) {
|
||||||
|
if (itr->readOnly == book.readOnly || book.readOnly) {
|
||||||
|
itr->readOnly = book.readOnly;
|
||||||
|
|
||||||
itr->readOnly = book.readOnly;
|
if (itr->path.empty())
|
||||||
|
itr->path = book.path;
|
||||||
|
|
||||||
if (itr->path.empty())
|
if (itr->pathAbsolute.empty())
|
||||||
itr->path = book.path;
|
itr->pathAbsolute = book.pathAbsolute;
|
||||||
|
|
||||||
if (itr->pathAbsolute.empty())
|
if (itr->url.empty())
|
||||||
itr->pathAbsolute = book.pathAbsolute;
|
itr->url = book.url;
|
||||||
|
|
||||||
if (itr->url.empty())
|
if (itr->indexPath.empty()) {
|
||||||
itr->url = book.url;
|
itr->indexPath = book.indexPath;
|
||||||
|
itr->indexType = book.indexType;
|
||||||
|
}
|
||||||
|
|
||||||
if (itr->indexPath.empty()) {
|
if (itr->indexPathAbsolute.empty()) {
|
||||||
itr->indexPath = book.indexPath;
|
itr->indexPathAbsolute = book.indexPathAbsolute;
|
||||||
itr->indexType = book.indexType;
|
itr->indexType = book.indexType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itr->faviconMimeType.empty()) {
|
||||||
|
itr->favicon = book.favicon;
|
||||||
|
itr->faviconMimeType = book.faviconMimeType;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itr->indexPathAbsolute.empty()) {
|
|
||||||
itr->indexPathAbsolute = book.indexPathAbsolute;
|
|
||||||
itr->indexType = book.indexType;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itr->faviconMimeType.empty()) {
|
|
||||||
itr->favicon = book.favicon;
|
|
||||||
itr->faviconMimeType = book.faviconMimeType;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue