Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
395ecfab
Commit
395ecfab
authored
May 08, 2022
by
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
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
zathura/plugin.c
View file @
395ecfab
...
...
@@ -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
*
...
...
zathura/plugin.h
View file @
395ecfab
...
...
@@ -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
...
...
zathura/zathura.c
View file @
395ecfab
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment