mirror of https://github.com/kiwix/libkiwix.git
+ better deal with accented paths
This commit is contained in:
parent
6959085e3c
commit
cf07bf827b
|
@ -253,20 +253,20 @@ namespace kiwix {
|
||||||
|
|
||||||
bool Manager::addBookFromPath(const string pathToOpen, const string pathToSave, const string url, const bool checkMetaData) {
|
bool Manager::addBookFromPath(const string pathToOpen, const string pathToSave, const string url, const bool checkMetaData) {
|
||||||
kiwix::Book book;
|
kiwix::Book book;
|
||||||
|
|
||||||
if (this->readBookFromPath(pathToOpen, book)) {
|
if (this->readBookFromPath(pathToOpen, book)) {
|
||||||
|
|
||||||
|
if (!pathToSave.empty() && pathToSave != pathToOpen) {
|
||||||
|
book.path = pathToSave;
|
||||||
|
book.pathAbsolute = pathToSave;
|
||||||
|
}
|
||||||
|
|
||||||
if (!checkMetaData ||
|
if (!checkMetaData ||
|
||||||
checkMetaData && !book.title.empty() && !book.language.empty() && !book.date.empty()) {
|
checkMetaData && !book.title.empty() && !book.language.empty() && !book.date.empty()) {
|
||||||
book.url = url;
|
book.url = url;
|
||||||
library.addBook(book);
|
library.addBook(book);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pathToSave.empty() && pathToSave != pathToOpen) {
|
|
||||||
book.path = pathToSave;
|
|
||||||
book.pathAbsolute = pathToSave;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue