From cf07bf827b479fa3b33fde8d71074cc09beebecc Mon Sep 17 00:00:00 2001 From: kelson42 Date: Mon, 5 Sep 2011 19:21:58 +0000 Subject: [PATCH] + better deal with accented paths --- src/common/kiwix/manager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/kiwix/manager.cpp b/src/common/kiwix/manager.cpp index 2ded03f32..8d5f192e0 100644 --- a/src/common/kiwix/manager.cpp +++ b/src/common/kiwix/manager.cpp @@ -253,20 +253,20 @@ namespace kiwix { bool Manager::addBookFromPath(const string pathToOpen, const string pathToSave, const string url, const bool checkMetaData) { kiwix::Book book; - + if (this->readBookFromPath(pathToOpen, book)) { + if (!pathToSave.empty() && pathToSave != pathToOpen) { + book.path = pathToSave; + book.pathAbsolute = pathToSave; + } + if (!checkMetaData || checkMetaData && !book.title.empty() && !book.language.empty() && !book.date.empty()) { book.url = url; library.addBook(book); return true; } - - if (!pathToSave.empty() && pathToSave != pathToOpen) { - book.path = pathToSave; - book.pathAbsolute = pathToSave; - } } return false;