diff --git a/include/manager.h b/include/manager.h index 843af32d9..13087ca70 100644 --- a/include/manager.h +++ b/include/manager.h @@ -69,27 +69,13 @@ class Manager /** * Read a `library.xml` and add book in the file to the library. * - * @param path The path to the `library.xml`. + * @param path The (utf8) path to the `library.xml`. * @param readOnly Set if the libray path could be overwritten latter with * updated content. * @return True if file has been properly parsed. */ bool readFile(const std::string& path, const bool readOnly = true); - /** - * Read a `library.xml` and add book in the file to the library. - * - * @param nativePath The path of the `library.xml` - * @param UTF8Path The utf8 version (?) of the path. Also the path where the - * library will be writen i readOnly is False. - * @param readOnly Set if the libray path could be overwritten latter with - * updated content. - * @return True if file has been properly parsed. - */ - bool readFile(const std::string& nativePath, - const std::string& UTF8Path, - const bool readOnly = true); - /** * Load a library content store in the string. * diff --git a/src/manager.cpp b/src/manager.cpp index ba01e9b18..cf2534856 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -137,25 +137,18 @@ bool Manager::readOpds(const std::string& content, const std::string& urlHost) } bool Manager::readFile(const std::string& path, const bool readOnly) -{ - return this->readFile(path, path, readOnly); -} - -bool Manager::readFile(const std::string& nativePath, - const std::string& UTF8Path, - const bool readOnly) { bool retVal = true; pugi::xml_document doc; #ifdef _WIN32 - pugi::xml_parse_result result = doc.load_file(Utf8ToWide(nativePath).c_str()); + pugi::xml_parse_result result = doc.load_file(Utf8ToWide(path).c_str()); #else - pugi::xml_parse_result result = doc.load_file(nativePath.c_str()); + pugi::xml_parse_result result = doc.load_file(path.c_str()); #endif if (result) { - this->parseXmlDom(doc, readOnly, UTF8Path); + this->parseXmlDom(doc, readOnly, path); } else { retVal = false; } @@ -164,7 +157,7 @@ bool Manager::readFile(const std::string& nativePath, * able to know where to save the library if new content are * available */ if (!readOnly) { - this->writableLibraryPath = UTF8Path; + this->writableLibraryPath = path; } return retVal;