mirror of https://github.com/kiwix/libkiwix.git
+ fix mgmt of custom libraries with relative paths
This commit is contained in:
parent
435e7ac76f
commit
bd81a2c662
|
@ -92,10 +92,10 @@ namespace kiwix {
|
||||||
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) {
|
if (itr->id == book.id) {
|
||||||
if (itr->readOnly == book.readOnly || book.readOnly) {
|
if (!itr->readOnly) {
|
||||||
itr->readOnly = book.readOnly;
|
itr->readOnly = book.readOnly;
|
||||||
|
|
||||||
if (itr->path.empty())
|
if (itr->path.empty())
|
||||||
itr->path = book.path;
|
itr->path = book.path;
|
||||||
|
|
||||||
if (itr->pathAbsolute.empty())
|
if (itr->pathAbsolute.empty())
|
||||||
|
@ -118,9 +118,9 @@ namespace kiwix {
|
||||||
itr->favicon = book.favicon;
|
itr->favicon = book.favicon;
|
||||||
itr->faviconMimeType = book.faviconMimeType;
|
itr->faviconMimeType = book.faviconMimeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,9 +142,6 @@ namespace kiwix {
|
||||||
if (!itr->path.empty())
|
if (!itr->path.empty())
|
||||||
bookNode.append_attribute("path") = itr->path.c_str();
|
bookNode.append_attribute("path") = itr->path.c_str();
|
||||||
|
|
||||||
if (!itr->pathAbsolute.empty())
|
|
||||||
bookNode.append_attribute("pathAbsolute") = itr->pathAbsolute.c_str();
|
|
||||||
|
|
||||||
if (!itr->last.empty() && itr->last != "undefined") {
|
if (!itr->last.empty() && itr->last != "undefined") {
|
||||||
bookNode.append_attribute("last") = itr->last.c_str();
|
bookNode.append_attribute("last") = itr->last.c_str();
|
||||||
}
|
}
|
||||||
|
@ -152,9 +149,6 @@ namespace kiwix {
|
||||||
if (!itr->indexPath.empty())
|
if (!itr->indexPath.empty())
|
||||||
bookNode.append_attribute("indexPath") = itr->indexPath.c_str();
|
bookNode.append_attribute("indexPath") = itr->indexPath.c_str();
|
||||||
|
|
||||||
if (!itr->indexPathAbsolute.empty())
|
|
||||||
bookNode.append_attribute("indexPathAbsolute") = itr->indexPathAbsolute.c_str();
|
|
||||||
|
|
||||||
if (!itr->indexPath.empty() || !itr->indexPathAbsolute.empty()) {
|
if (!itr->indexPath.empty() || !itr->indexPathAbsolute.empty()) {
|
||||||
if (itr->indexType == XAPIAN)
|
if (itr->indexType == XAPIAN)
|
||||||
bookNode.append_attribute("indexType") = "xapian";
|
bookNode.append_attribute("indexType") = "xapian";
|
||||||
|
@ -490,7 +484,7 @@ namespace kiwix {
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
if (ok == true && mode == REMOTE && (!itr->path.empty() || itr->url.empty()))
|
if (ok == true && mode == REMOTE && (!itr->path.empty() || itr->url.empty()))
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
if (ok == true && maxSize != 0 && (unsigned int)atoi(itr->size.c_str()) > maxSize * 1024 * 1024)
|
if (ok == true && maxSize != 0 && (unsigned int)atoi(itr->size.c_str()) > maxSize * 1024 * 1024)
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
Loading…
Reference in New Issue