Commit 395ecfab authored by Sebastian Ramacher's avatar Sebastian Ramacher
Browse files

Print better error message if no plugins are available (fixes #284)

parent fbfbefe1
Pipeline #477 passed with stages
in 2 minutes and 19 seconds
......@@ -195,15 +195,16 @@ load_dir(void* data, void* userdata)
}
}
void
bool
zathura_plugin_manager_load(zathura_plugin_manager_t* plugin_manager)
{
if (plugin_manager == NULL || plugin_manager->path == NULL) {
return;
return false;
}
/* read all files in the plugin directory */
girara_list_foreach(plugin_manager->path, load_dir, plugin_manager);
return girara_list_size(plugin_manager->plugins) > 0;
}
zathura_plugin_t*
......
......@@ -37,8 +37,9 @@ void zathura_plugin_manager_add_dir(zathura_plugin_manager_t* plugin_manager, co
* Loads all plugins available in the previously given directories
*
* @param plugin_manager The plugin manager
* @return Success if some plugins have been loaded, false otherwise
*/
void zathura_plugin_manager_load(zathura_plugin_manager_t* plugin_manager);
bool zathura_plugin_manager_load(zathura_plugin_manager_t* plugin_manager);
/**
* Returns the (if available) associated plugin
......
......@@ -430,7 +430,9 @@ zathura_init(zathura_t* zathura)
g_set_prgname("org.pwmt.zathura");
/* load plugins */
zathura_plugin_manager_load(zathura->plugins.manager);
if (zathura_plugin_manager_load(zathura->plugins.manager) == false) {
girara_error("Found no plugins. Please install at least one plugin.");
}
/* configuration */
config_load_default(zathura);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment