static GTlsDatabase *tlsdb;
static int cookiepolicy;
static char *stylefile = NULL;
-static SoupCache *diskcache = NULL;
static void addaccelgroup(Client *c);
static void beforerequest(WebKitWebView *w, WebKitWebFrame *f,
void
cleanup(void)
{
- if (diskcache) {
- soup_cache_flush(diskcache);
- soup_cache_dump(diskcache);
- }
while (clients)
destroyclient(clients);
g_free(cookiefile);
case WEBKIT_LOAD_FINISHED:
c->progress = 100;
updatetitle(c);
- if (diskcache) {
- soup_cache_flush(diskcache);
- soup_cache_dump(diskcache);
- }
break;
default:
break;
{
int i;
char *styledirfile, *stylepath;
- SoupSession *s;
WebKitWebContext *context;
GError *error = NULL;
g_free(stylepath);
}
- /* request handler */
- s = webkit_get_default_session();
-
/* cookie policy */
webkit_cookie_manager_set_persistent_storage(
webkit_web_context_get_cookie_manager(context), cookiefile,
cookiepolicy_get());
/* disk cache */
- if (enablediskcache) {
- diskcache = soup_cache_new(cachefolder,
- SOUP_CACHE_SINGLE_USER);
- soup_cache_set_max_size(diskcache, diskcachebytes);
- soup_cache_load(diskcache);
- soup_session_add_feature(s, SOUP_SESSION_FEATURE(diskcache));
- }
+ webkit_web_context_set_cache_model(context, enablecache ?
+ WEBKIT_CACHE_MODEL_WEB_BROWSER :
+ WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER);
/* ssl */
tlsdb = g_tls_file_database_new(cafile, &error);