From 0b3a8cd8f233ae037ea9e5cee78b710e3e962830 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Thu, 13 Dec 2018 04:46:07 +0100 Subject: remove Inkscape::URI::fromUtf8 --- src/object/uri.cpp | 31 ------------------------------- src/object/uri.h | 7 ------- 2 files changed, 38 deletions(-) (limited to 'src/object') diff --git a/src/object/uri.cpp b/src/object/uri.cpp index f6d044a6e..52fc9dc44 100644 --- a/src/object/uri.cpp +++ b/src/object/uri.cpp @@ -228,37 +228,6 @@ std::string URI::toNativeFilename() const return Glib::filename_from_uri(uristr); } -URI URI::fromUtf8( gchar const* path ) { - if ( !path ) { - throw MalformedURIException(); - } - Glib::ustring tmp; - for ( int i = 0; path[i]; i++ ) - { - gint one = 0x0ff & path[i]; - if ( ('a' <= one && one <= 'z') - || ('A' <= one && one <= 'Z') - || ('0' <= one && one <= '9') - || one == '_' - || one == '-' - || one == '!' - || one == '.' - || one == '~' - || one == '\'' - || one == '(' - || one == ')' - || one == '*' - ) { - tmp += (gunichar)one; - } else { - gchar scratch[4]; - g_snprintf( scratch, 4, "%%%02X", one ); - tmp.append( scratch ); - } - } - return URI( tmp.data() ); -} - /* TODO !!! proper error handling */ URI URI::from_native_filename(gchar const *path) { gchar *uri = g_filename_to_uri(path, nullptr, nullptr); diff --git a/src/object/uri.h b/src/object/uri.h index 04c4fabe6..d3cbae596 100644 --- a/src/object/uri.h +++ b/src/object/uri.h @@ -133,13 +133,6 @@ public: */ const char *getOpaque() const { return _impl->getOpaque(); } - /** - * @deprecated The regular constructor auto-detects UTF-8 characters and percent-encodes them. - * - * @todo remove, it's unused and percent-encodes most reserved characters, including "%", ":", "?", "#". - */ - static URI fromUtf8( char const* path ); - /** * Construct a "file" URI from an absolute filename. */ -- cgit v1.2.3