+ fix in ro library mgmt

This commit is contained in:
kelson42 2013-08-06 13:09:34 +08:00
parent c80914b774
commit 435e7ac76f
1 changed files with 28 additions and 27 deletions

View File

@ -91,8 +91,8 @@ 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)) {
if (itr->id == book.id) {
if (itr->readOnly == book.readOnly || book.readOnly) {
itr->readOnly = book.readOnly;
if (itr->path.empty())
@ -122,6 +122,7 @@ namespace kiwix {
return false;
}
}
}
/* otherwise */
this->books.push_back(book);