mirror of https://github.com/kiwix/libkiwix.git
commit
788d16ec01
|
@ -208,12 +208,16 @@ bool Manager::addBookFromPath(const std::string& pathToOpen,
|
|||
|
||||
bool Manager::readBookFromPath(const std::string& path, kiwix::Book* book)
|
||||
{
|
||||
std::string tmp_path = path;
|
||||
if (isRelativePath(path)) {
|
||||
tmp_path = computeAbsolutePath(getCurrentDirectory(), path);
|
||||
}
|
||||
try {
|
||||
kiwix::Reader reader(path);
|
||||
kiwix::Reader reader(tmp_path);
|
||||
book->update(reader);
|
||||
book->setPathValid(true);
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << "Invalid " << path << " : " << e.what() << std::endl;
|
||||
std::cerr << "Invalid " << tmp_path << " : " << e.what() << std::endl;
|
||||
book->setPathValid(false);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -241,8 +241,6 @@ Entry Reader::getMainPage() const
|
|||
throw NoEntry();
|
||||
}
|
||||
|
||||
string url = "";
|
||||
|
||||
zim::Article article;
|
||||
if (this->zimFileHandler->getFileheader().hasMainPage())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue