]> spindle.queued.net Git - midori/commitdiff
Try to search for it, if middle click open encounters a non-URI
authorChristian Dywan <christian@twotoasts.de>
Mon, 7 Dec 2009 19:35:11 +0000 (20:35 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 7 Dec 2009 19:38:02 +0000 (20:38 +0100)
midori/midori-view.c

index c2cbf8c102aff0d077520143a1388e0aefc80f39..ac854a732180206a128cf463c881d83524d10f07 100644 (file)
@@ -1260,14 +1260,22 @@ gtk_widget_button_press_event_cb (WebKitWebView*  web_view,
             clipboard = gtk_clipboard_get_for_display (
                 gtk_widget_get_display (GTK_WIDGET (view)),
                 GDK_SELECTION_PRIMARY);
-            uri = gtk_clipboard_wait_for_text (clipboard);
-            if (uri && strchr (uri, '.'))
+            if ((uri = gtk_clipboard_wait_for_text (clipboard)))
             {
+                KatzeArray* empty_array = katze_array_new (KATZE_TYPE_ITEM);
                 guint i = 0;
                 while (uri[i++] != '\0')
                     if (uri[i] == '\n' || uri[i] == '\r')
                         uri[i] = ' ';
-                new_uri = sokoke_magic_uri (g_strstrip (uri), NULL);
+                new_uri = sokoke_magic_uri (g_strstrip (uri), empty_array);
+                g_object_unref (empty_array);
+                if (!new_uri)
+                {
+                    gchar* search;
+                    g_object_get (view->settings, "location-entry-search",
+                                  &search, NULL);
+                    new_uri = sokoke_search_uri (search, uri);
+                }
                 if (event->state & GDK_CONTROL_MASK)
                 {
                     background = view->open_tabs_in_the_background;