From bf9bed56d71d616f0c47147e726c16092b3016d1 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Thu, 2 Jun 2011 15:43:46 +0000 Subject: [PATCH] + last improvement in the download manager --- src/common/kiwix/manager.cpp | 12 ++++++++++++ src/common/kiwix/manager.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/common/kiwix/manager.cpp b/src/common/kiwix/manager.cpp index 31a8f4cd2..1382c16c3 100644 --- a/src/common/kiwix/manager.cpp +++ b/src/common/kiwix/manager.cpp @@ -297,6 +297,18 @@ namespace kiwix { return false; } + bool Manager::setBookPath(const string id, const string path) { + std::vector::iterator itr; + for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) { + if ( itr->id == id) { + itr->path = path; + return true; + } + } + + return false; + } + void Manager::removeBookPaths() { std::vector::iterator itr; for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) { diff --git a/src/common/kiwix/manager.h b/src/common/kiwix/manager.h index e7194e232..c10818385 100644 --- a/src/common/kiwix/manager.h +++ b/src/common/kiwix/manager.h @@ -54,6 +54,7 @@ namespace kiwix { bool removeBookById(const string id); bool setCurrentBookId(const string id); bool setBookIndex(const string id, const string path, const supportedIndexType type); + bool setBookPath(const string id, const string path); string getCurrentBookId(); bool addBookFromPath(const string path, const string url = ""); Library cloneLibrary();