mirror of https://github.com/kiwix/libkiwix.git
+ add "remove" button in the download manager
This commit is contained in:
parent
2b50a1d505
commit
5b679f6b1b
|
@ -92,7 +92,7 @@ namespace kiwix {
|
|||
}
|
||||
|
||||
bool Library::removeBookByIndex(const unsigned int bookIndex) {
|
||||
books.erase(books.begin()+bookIndex-1);
|
||||
books.erase(books.begin()+bookIndex);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -248,8 +248,9 @@ namespace kiwix {
|
|||
unsigned int bookIndex = 0;
|
||||
std::vector<kiwix::Book>::iterator itr;
|
||||
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||
if ( itr->id == id)
|
||||
if ( itr->id == id) {
|
||||
return this->library.removeBookByIndex(bookIndex);
|
||||
}
|
||||
bookIndex++;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue