[Xfce4-commits] <midori:master> Only show cache preference if there is a cache

Christian Dywan noreply at xfce.org
Mon Aug 8 15:46:01 CEST 2011


Updating branch refs/heads/master
         to 5c08872db091a9b7b92c0f00f3fd435915cdafd3 (commit)
       from 5a0e6099c3137ae0a1463de252b8dd4f59b52af1 (commit)

commit 5c08872db091a9b7b92c0f00f3fd435915cdafd3
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Aug 8 15:44:38 2011 +0200

    Only show cache preference if there is a cache
    
    App and private mode never make use of the web cache.

 midori/midori-preferences.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c
index 734ed16..aee12c2 100644
--- a/midori/midori-preferences.c
+++ b/midori/midori-preferences.c
@@ -22,6 +22,11 @@
 #include <glib/gi18n.h>
 #include <libsoup/soup.h>
 
+#if WEBKIT_CHECK_VERSION (1, 3, 11)
+    #define LIBSOUP_USE_UNSTABLE_REQUEST_API
+    #include <libsoup/soup-cache.h>
+#endif
+
 #if HAVE_LIBNOTIFY
     #include <libnotify/notify.h>
 #endif
@@ -456,13 +461,16 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     midori_preferences_notify_proxy_type_cb (settings, NULL, entry);
     #endif
     #if WEBKIT_CHECK_VERSION (1, 3, 11)
-    label = katze_property_label (settings, "maximum-cache-size");
-    INDENTED_ADD (label);
-    button = katze_property_proxy (settings, "maximum-cache-size", NULL);
-    SPANNED_ADD (button);
-    label = gtk_label_new (_("MB"));
-    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-    SPANNED_ADD (label);
+    if (soup_session_get_feature (webkit_get_default_session (), SOUP_TYPE_CACHE))
+    {
+        label = katze_property_label (settings, "maximum-cache-size");
+        INDENTED_ADD (label);
+        button = katze_property_proxy (settings, "maximum-cache-size", NULL);
+        SPANNED_ADD (button);
+        label = gtk_label_new (_("MB"));
+        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+        SPANNED_ADD (label);
+    }
     #endif
     label = katze_property_label (settings, "identify-as");
     INDENTED_ADD (label);


More information about the Xfce4-commits mailing list