summaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
authorulteq <ulteq@web.de>2017-12-27 19:03:03 +0100
committerulteq <ulteq@web.de>2017-12-28 14:42:58 +0100
commit0a006ed6767e42bbc1608400faf0fa9e008ff49c (patch)
treeda2b95c011ba693fa304f95ce73701ec22fa045c /src/options.c
parent4b72d9f3e11786f4d052b02ca777019670579e72 (diff)
Add option to change the imlib cache size
This option allows you to change the default imlib2 image cache size of 4 MiB.
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index 1ed5b54..c874832 100644
--- a/src/options.c
+++ b/src/options.c
@@ -68,6 +68,7 @@ void init_parse_options(int argc, char **argv)
opt.jump_on_resort = 1;
opt.screen_clip = 1;
+ opt.cache_size = 4;
#ifdef HAVE_LIBXINERAMA
/* if we're using xinerama, then enable it by default */
opt.xinerama = 1;
@@ -410,6 +411,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
{"xinerama-index", 1, 0, 239},
{"insecure" , 0, 0, 240},
{"no-recursive" , 0, 0, 241},
+ {"cache-size" , 1, 0, 243},
{0, 0, 0, 0}
};
int optch = 0, cmdx = 0;
@@ -772,6 +774,14 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
break;
case 241:
opt.recursive = 0;
+ break;
+ case 243:
+ opt.cache_size = atoi(optarg);
+ if (opt.cache_size < 0)
+ opt.cache_size = 0;
+ if (opt.cache_size > 2048)
+ opt.cache_size = 2048;
+ break;
default:
break;
}