From bfcffc3e8c3d318d867c59cd3f9a51a4cee3f0f8 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 16 Jun 2020 23:51:34 +0200 Subject: [PATCH] Create data directory only if database is enabled (fixes #158) --- zathura/zathura.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zathura/zathura.c b/zathura/zathura.c index d65ed1c..df7970a 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -358,6 +358,11 @@ init_database(zathura_t* zathura) char* database = NULL; girara_setting_get(zathura->ui.session, "database", &database); + /* create zathura data directory if database enabled */ + if (g_strcmp0(database, "null") != 0) { + create_directories(zathura); + } + if (g_strcmp0(database, "plain") == 0) { girara_debug("Using plain database backend."); zathura->database = zathura_plaindatabase_new(zathura->config.data_dir); @@ -419,9 +424,6 @@ zathura_init(zathura_t* zathura) /* Set application ID */ g_set_prgname("org.pwmt.zathura"); - /* create zathura data directory */ - create_directories(zathura); - /* load plugins */ zathura_plugin_manager_load(zathura->plugins.manager);