Merge branch 'master' of ssh://git.code.sf.net/p/kiwix/kiwix

This commit is contained in:
renaud gaudin 2013-08-06 16:06:42 +08:00
commit 2f7e909b88
2 changed files with 28 additions and 33 deletions

View File

@ -91,32 +91,33 @@ namespace kiwix {
/* Try to find it */
std::vector<kiwix::Book>::iterator itr;
for ( itr = this->books.begin(); itr != this->books.end(); ++itr ) {
if (itr->id == book.id && (itr->readOnly == book.readOnly || book.readOnly)) {
itr->readOnly = book.readOnly;
if (itr->path.empty())
itr->path = book.path;
if (itr->pathAbsolute.empty())
itr->pathAbsolute = book.pathAbsolute;
if (itr->url.empty())
itr->url = book.url;
if (itr->indexPath.empty()) {
itr->indexPath = book.indexPath;
itr->indexType = book.indexType;
}
if (itr->indexPathAbsolute.empty()) {
itr->indexPathAbsolute = book.indexPathAbsolute;
itr->indexType = book.indexType;
}
if (itr->faviconMimeType.empty()) {
itr->favicon = book.favicon;
itr->faviconMimeType = book.faviconMimeType;
if (itr->id == book.id) {
if (!itr->readOnly) {
itr->readOnly = book.readOnly;
if (itr->path.empty())
itr->path = book.path;
if (itr->pathAbsolute.empty())
itr->pathAbsolute = book.pathAbsolute;
if (itr->url.empty())
itr->url = book.url;
if (itr->indexPath.empty()) {
itr->indexPath = book.indexPath;
itr->indexType = book.indexType;
}
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;

View File

@ -142,9 +142,6 @@ namespace kiwix {
if (!itr->path.empty())
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") {
bookNode.append_attribute("last") = itr->last.c_str();
}
@ -152,9 +149,6 @@ namespace kiwix {
if (!itr->indexPath.empty())
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->indexType == XAPIAN)
bookNode.append_attribute("indexType") = "xapian";
@ -490,7 +484,7 @@ namespace kiwix {
ok = false;
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)
ok = false;