diff options
Diffstat (limited to 'src/serialisation')
-rw-r--r-- | src/serialisation/Parser.cpp | 32 | ||||
-rw-r--r-- | src/serialisation/Serialiser.cpp | 1 |
2 files changed, 16 insertions, 17 deletions
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index 2ef387e8..dfd5bdf6 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -61,21 +61,21 @@ relative_uri(Glib::ustring base, const Glib::ustring uri, bool leading_slash) { Glib::ustring ret; if (uri != base) { - SerdURI base_uri; - serd_uri_parse((const uint8_t*)base.c_str(), &base_uri); - - SerdURI normal_base_uri; - SerdNode normal_base_uri_node = serd_node_new_uri_from_string( - (const uint8_t*)".", &base_uri, &normal_base_uri); - - Glib::ustring normal_base_str((const char*)normal_base_uri_node.buf); - - ret = uri; - if (uri.length() >= normal_base_str.length() - && uri.substr(0, normal_base_str.length()) == normal_base_str) { + SerdURI base_uri; + serd_uri_parse((const uint8_t*)base.c_str(), &base_uri); + + SerdURI normal_base_uri; + SerdNode normal_base_uri_node = serd_node_new_uri_from_string( + (const uint8_t*)".", &base_uri, &normal_base_uri); + + Glib::ustring normal_base_str((const char*)normal_base_uri_node.buf); + + ret = uri; + if (uri.length() >= normal_base_str.length() + && uri.substr(0, normal_base_str.length()) == normal_base_str) { ret = uri.substr(normal_base_str.length()); - if (leading_slash && ret[0] != '/') - ret = Glib::ustring("/") + ret; + if (leading_slash && ret[0] != '/') + ret = Glib::ustring("/") + ret; } } @@ -588,9 +588,9 @@ Parser::parse_file(Ingen::Shared::World* world, std::string uri; try { uri = Glib::filename_to_uri(path, ""); - } catch (const Glib::ConvertError& e) { + } catch (const Glib::ConvertError& e) { LOG(error) << "Path to URI conversion error: " << e.what() << endl; - return false; + return false; } const uint8_t* uri_c_str = (const uint8_t*)uri.c_str(); diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index 8ff1887f..6e6db3ed 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -200,7 +200,6 @@ void Serialiser::Impl::write_bundle(SharedPtr<const Patch> patch, const std::string& a_path) { - std::string path = Glib::filename_from_uri(a_path); if (Glib::file_test(path, Glib::FILE_TEST_EXISTS) && !Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) { |