Merge branch 'master' into cairocanvas
[ardour.git] / gtk2_ardour / editor.cc
index 57ae65e9a5a410fcd850cf51bcc2ee24535f6f0a..2b430c8a40e9c4db9db6543f80f34c70a0a0c638 100644 (file)
@@ -47,6 +47,7 @@
 #include "pbd/stacktrace.h"
 
 #include <glibmm/miscutils.h>
+#include <glibmm/uriutils.h>
 #include <gtkmm/image.h>
 #include <gdkmm/color.h>
 #include <gdkmm/bitmap.h>
@@ -3178,33 +3179,8 @@ Editor::convert_drop_to_paths (
        }
 
        for (vector<string>::iterator i = uris.begin(); i != uris.end(); ++i) {
-
                if ((*i).substr (0,7) == "file://") {
-
-                       string const p = PBD::url_decode (*i);
-
-                       // scan forward past three slashes
-
-                       string::size_type slashcnt = 0;
-                       string::size_type n = 0;
-                       string::const_iterator x = p.begin();
-
-                       while (slashcnt < 3 && x != p.end()) {
-                               if ((*x) == '/') {
-                                       slashcnt++;
-                               } else if (slashcnt == 3) {
-                                       break;
-                               }
-                               ++n;
-                               ++x;
-                       }
-
-                       if (slashcnt != 3 || x == p.end()) {
-                               error << _("malformed URL passed to drag-n-drop code") << endmsg;
-                               continue;
-                       }
-
-                       paths.push_back (p.substr (n - 1));
+                       paths.push_back (Glib::filename_from_uri (*i));
                }
        }
 
@@ -3213,7 +3189,6 @@ Editor::convert_drop_to_paths (
 
 void
 Editor::new_tempo_section ()
-
 {
 }