[Xfce4-commits] <midori:master> Make webkit_web_view_mime_type_decision_cb more explicit

Christian Dywan noreply at xfce.org
Tue Apr 10 21:32:02 CEST 2012


Updating branch refs/heads/master
         to f76d5385647283105b1bff9f57e9350ec63bb220 (commit)
       from e0c021de3d93d016dc1e55475f0ff889b8aba732 (commit)

commit f76d5385647283105b1bff9f57e9350ec63bb220
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Apr 10 21:26:43 2012 +0200

    Make webkit_web_view_mime_type_decision_cb more explicit

 midori/midori-view.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index 14b583f..35c0885 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -2956,23 +2956,23 @@ webkit_web_view_mime_type_decision_cb (GtkWidget*               web_view,
        case 4:
             g_object_set_data (G_OBJECT (view), "save-as-download", (gpointer)1);
             webkit_web_policy_decision_download (decision);
-            webkit_web_view_stop_loading (WEBKIT_WEB_VIEW (view->web_view));
-            return TRUE;
+            break;
         case 3:
             g_object_set_data (G_OBJECT (view), "open-download", (gpointer)1);
         case 1:
             webkit_web_policy_decision_download (decision);
-            /* Apparently WebKit will continue loading which ends in an error.
-               It's unclear whether it's a bug or we are doing something wrong. */
-            webkit_web_view_stop_loading (WEBKIT_WEB_VIEW (view->web_view));
-            return TRUE;
+            break;
         case 2:
+            webkit_web_policy_decision_ignore (decision);
+            break;
         default:
-            /* Apparently WebKit will continue loading which ends in an error.
-               It's unclear whether it's a bug or we are doing something wrong. */
-            webkit_web_view_stop_loading (WEBKIT_WEB_VIEW (view->web_view));
-            return FALSE;
+            g_warn_if_reached ();
     }
+
+    /* Apparently WebKit will continue loading which ends in an error.
+       It's unclear whether it's a bug or we are doing something wrong. */
+    webkit_web_view_stop_loading (WEBKIT_WEB_VIEW (view->web_view));
+    return TRUE;
 }
 
 static gboolean


More information about the Xfce4-commits mailing list