]> spindle.queued.net Git - midori/commitdiff
Apply URI magic when opening selected text in a tab
authorChristian Dywan <christian@twotoasts.de>
Thu, 30 Jul 2009 21:30:07 +0000 (23:30 +0200)
committerChristian Dywan <christian@twotoasts.de>
Thu, 30 Jul 2009 21:30:07 +0000 (23:30 +0200)
midori/midori-view.c

index 6fc24260dc1cc57178c40f9fc37e145407f2ccff..e16d20af2efe7a643eba069c9e06e13564e88e19 100644 (file)
@@ -1111,12 +1111,17 @@ static void
 midori_web_view_menu_new_tab_activate_cb (GtkWidget*  widget,
                                           MidoriView* view)
 {
-    gchar* uri = view->link_uri;
-
-    if (!uri)
-        uri = (gchar*)g_object_get_data (G_OBJECT (widget), "uri");
-    g_signal_emit (view, signals[NEW_TAB], 0, uri,
-        view->open_tabs_in_the_background);
+    if (view->link_uri)
+        g_signal_emit (view, signals[NEW_TAB], 0, view->link_uri,
+                       view->open_tabs_in_the_background);
+    else
+    {
+        gchar* data = (gchar*)g_object_get_data (G_OBJECT (widget), "uri");
+        gchar* uri = sokoke_magic_uri (data, NULL);
+        g_signal_emit (view, signals[NEW_TAB], 0, uri,
+                       view->open_tabs_in_the_background);
+        g_free (uri);
+    }
 }
 
 static void