Permalink
Browse files

Merge branch 'fix-save-on-unload' into guns

  • Loading branch information...
2 parents 4bbd2ec + 0d60de4 commit dd0394e42ed12cc168f4f494013daa6fc9211f9f @guns committed Sep 13, 2011
Showing with 5 additions and 2 deletions.
  1. +2 −1 src/plugins/plugin.c
  2. +3 −1 src/plugins/weechat-plugin.h
View
@@ -1159,7 +1159,8 @@ void
plugin_end ()
{
/* write plugins config options */
- plugin_config_write ();
+ if (CONFIG_BOOLEAN(config_plugin_save_config_on_unload))
+ plugin_config_write ();
/* unload all plugins */
plugin_unload_all ();
@@ -1170,7 +1170,9 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
#define weechat_config_write_line(__config, __option, __value...) \
weechat_plugin->config_write_line(__config, __option, ##__value)
#define weechat_config_write(__config) \
- weechat_plugin->config_write(__config)
+ ((weechat_config_boolean \
+ (weechat_config_get ("weechat.plugin.save_config_on_unload"))) ? \
+ weechat_plugin->config_write(__config) : WEECHAT_CONFIG_WRITE_OK)
#define weechat_config_read(__config) \
weechat_plugin->config_read(__config)
#define weechat_config_reload(__config) \

0 comments on commit dd0394e

Please sign in to comment.