We get an int from girara_config_get

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2013-03-26 13:03:07 +01:00
parent ca2d279d10
commit 4b7347efa7

View file

@ -280,11 +280,13 @@ zathura_init(zathura_t* zathura)
/* page cache */ /* page cache */
zathura->page_cache.size = ZATHURA_PAGE_CACHE_DEFAULT_SIZE; int cache_size = 0;
girara_setting_get(zathura->ui.session, "page-cache-size", &zathura->page_cache.size); girara_setting_get(zathura->ui.session, "page-cache-size", &cache_size);
if (zathura->page_cache.size <= 0) { if (cache_size <= 0) {
girara_warning("page-cache-size is not positive, using %d instead", ZATHURA_PAGE_CACHE_DEFAULT_SIZE); girara_warning("page-cache-size is not positive, using %d instead", ZATHURA_PAGE_CACHE_DEFAULT_SIZE);
zathura->page_cache.size = ZATHURA_PAGE_CACHE_DEFAULT_SIZE; zathura->page_cache.size = ZATHURA_PAGE_CACHE_DEFAULT_SIZE;
} else {
zathura->page_cache.size = cache_size;
} }
zathura->page_cache.cache = g_malloc(zathura->page_cache.size * sizeof(int)); zathura->page_cache.cache = g_malloc(zathura->page_cache.size * sizeof(int));